Massassi Forums Logo

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.

ForumsCog Forum → A bit more realism in civilian sectors.
A bit more realism in civilian sectors.
2002-11-03, 11:30 AM #1
Meh, new topic = more exposure.

Code:
# CivFlee.cog
#  This cog gives civilians an aversion to armed gunmen roaming amongst them.
# [Grismath]
#======================================================================================#
symbols
message		startup
message		pulse
message		timer
thing		player		local
thing		civ0
thing		civ1
thing		civ2
thing		civ3
thing		civ4
thing		civ5
thing		civ6
thing		civ7
ai		regular
ai		flee
flex		fTime		// Length of fleeing period
int		X=0		local
int		Y=0		local
end
#======================================================================================#
code
#--------------------------------------------------------
startup:
Sleep(0.5);
for(X=0;X<8;X=X+1) AISetClass(civ0[X], regular);
player=GetLocalPlayerThing();
SetPulse(1);
return;
#--------------------------------------------------------
pulse:
for(X=0;X<8;X=X+1) {
 if(HasLOS(civ0[X], player)) {
  if(GetCurWeapon(player) != 1) {
   AISetClass(civ0[X], flee);
   SetTimerEx(fTime, 1337, X, 0);
}}}
return;
#--------------------------------------------------------
timer:
 if(GetSenderID()==1337) {
  Y=GetParam(1);
  AISetClass(civ0[Y], regular);
 }
return;
#--------------------------------------------------------
end
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2002-11-04, 4:11 AM #2
Nifty, now all it has to check for is friendlies (I take it is for MotS) and enemies in the civs LOS.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-11-04, 2:31 PM #3
What would their reaction to friendlies be?
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2002-11-05, 3:37 AM #4
More nervous, backing away, and if the player is related to the friendlies. Or it could also be fleeing in some cases. [http://forums.massassi.net/html/wink.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack

↑ Up to the top!