How do I make it so that if a certain enemy sees the player, you fail a mission objective.(you CAN fail objectives, right?)
This is the static archive of the Massassi Forums. The forums are
closed indefinitely. Thanks for all the memories!
You can also download
Super Old Archived Message Boards
from when Massassi first started.
"View" counts are as of the day the forums were archived, and will no longer increase.
![http://forums.massassi.net/html/smile.gif [http://forums.massassi.net/html/smile.gif]](http://forums.massassi.net/html/smile.gif)
Symbols
thing target local
thing actor
end
#=================#
startup:
SetPulse(1);
Return;
#=================#
Pulse:
target=FirstThingInView(actor, 180, 10, 0x404);
if(target == GetLocalPlayerThing())
{
Print("Mission Failed...");
JKEndLevel(0);
}
Return;
#============#symbols
message startup
message pulse
message entered
sector sector1
thing player local
thing watcher
end
code
startup:
player=GetLocalPlayerThing();
return;
entered:
SetPulse(0.1);
return;
pulse:
if(IsAiTargetInSight(watcher)==player)
{
SetThingHealth(player, 0);
Print("Mission failed...");
}
return;
end
and made it so the pulse isn't always running just set the sector to one just before the thing would be able to see him. and i fixed all the verb mistakes, this should work fine. i haven't tested it though
I meant for Fetch to add it into his actor cog so I wasn't thinking about making the cog complete.![http://forums.massassi.net/html/smile.gif [http://forums.massassi.net/html/smile.gif]](http://forums.massassi.net/html/smile.gif)
![http://forums.massassi.net/html/confused.gif [http://forums.massassi.net/html/confused.gif]](http://forums.massassi.net/html/confused.gif)
symbols
message entered
message pulse
int test local
sector testsec
thing watcher
end
#======================================#
code
entered:
SetPulse(1);
return;
#======================================#
pulse:
if(IsAiTargetInSight(watcher)==1)
{
SetThingHealth(player, 0);
Print("Mission failed...");
}
return;
end![http://forums.massassi.net/html/smile.gif [http://forums.massassi.net/html/smile.gif]](http://forums.massassi.net/html/smile.gif)