New engine features |
Top Previous Next |
vec_for_ent (position, entity)
Converts the given position vector from the entity coordinate system to a world coordinate position.
function move_halo() { while(you) { vec_set(my.pan, your.pan); vec_set(my.x, vector(0, 0, 80)); // the halo floats 80 quants above its creator's origin vec_for_ent(my.x, you); // convert this position to world coordinates wait(1); } ent_remove(my); // the creator has been removed here, so remove the halo as well }
action moving_entity() { ent_create("halo.tga", nullvector, move_halo); while (1) { my.x += 1 - random(2); // plain random movement (no collision detection!) my.y += 1 - random(2); wait (1); } }
ent_type (entity)
Returns the type of the entity or the type of the current level for ent_type(NULL).
0 - No valid type 1 - Polygon based BSP map (A4, A5, A6) 2 - Mesh based ABT map (A7) 3 - Mesh based BSP map (A7) 4 - Terrain 5 - Model 6 - Sprite
var entity_type;
BMAP* arrow_pcx = "arrow.pcx";
function mouse_startup() { // allow the player to touch the entities even if they are 5,000 quants away from the camera mouse_range = 5000; mouse_mode = 1; mouse_map = arrow_pcx; while (1) { vec_set(mouse_pos, mouse_cursor); wait(1); } }
function type_startup() { while (1) { entity_type = ent_type(mouse_ent); wait (1); } }
PANEL* test_pan = { digits(160, 180, 4, *, 1, entity_type); flags = visible; }
Map_compiler improvements
The map compiler now supports a smooth flag for Lighting v2.0.
|