Thanks for any help, I could not show the code because of internet problems, but here it is:
I get the texts 'ready' and 'scanning', and for the first second or so I get the text 'found something', but that should be a constant text. I never get the text 'scanned'.
The building action
enable_scan = on;
while(1)
{
// now the building should animate, but it has no life animation
draw_text("ready", 380, 285, vector(255,255,255));
if (event_type == event_scan) // the building has been scanned
{
draw_text("scanned", 380, 275, vector(255,255,255));
in_area = true; // so the building is in area of effect
}
else // wait with this until the scan works
{ in_area = false; }
wait(1);
}
Is being called by the player entity every frame:
function scanner()
{
vec_set(player_pos, vector(player.x - 4, player.y, player.z)); // start scan from the player pos
found = c_scan(player_pos, player.pan, vector(360,1,area_size), // scan a full circle for area size
SCAN_ENTS | SCAN_LIMIT | IGNORE_ME | IGNORE_YOU); // don't scan player, last scanned
draw_text("scanning", 380, 315, vector(255,255,255));
if (found > 0)
{
draw_text("found something", 380, 305, vector(255,255,255));
}
}
edit: more complete
Last edited by voswouter87; 06/20/07 14:55.