6#include "WeaponClass.h"
7#include "WeaponBagClass.h"
8#include "SoldierGameObj.h"
9#include "PhysicsSceneClass.h"
10#include "MoveablePhysClass.h"
11#include "VehicleGameObj.h"
23 void Created(GameObject *obj);
24 void Timer_Expired(GameObject *obj,
int number);
58 void Created(GameObject *obj);
59 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
60 void Send_Custom(GameObject *obj,
int custom,
int param);
69 void Created(GameObject *obj);
70 void Timer_Expired(GameObject *obj,
int number);
106 bool playingTransition;
108 void Created(GameObject *obj);
109 void Damaged(GameObject *obj,GameObject *damager,
float damage);
110 void Animation_Complete(GameObject *obj,
const char *anim);
111 void Play_Animation(GameObject *obj,
bool loop,
float start,
float end);
123 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
135 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
143 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
156 void Created(GameObject *obj);
157 void Poked(GameObject *obj, GameObject *poker);
158 void Timer_Expired(GameObject *obj,
int number);
172 void Created(GameObject *obj);
173 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
174 void Killed(GameObject *obj,GameObject *killer);
175 void Destroyed(GameObject *obj);
176 void Detach(GameObject *obj);
197 Vector3 centerLocation;
199 int aiIgnorePlayers[128];
200 float repairGunRange;
201 float repairGunEffectiveRange;
203 float weaponEffectiveRange;
207 float targetDistance;
211 Vector3 moveLocation;
213 GameObject *lastTarget;
214 GameObject *lastSecondaryTarget;
215 bool lastRepairTarget;
216 bool lastUseRepairGun;
217 int wanderPointGroup;
218 int randomResetAmount;
219 void Created(GameObject *obj);
220 void Enemy_Seen(GameObject *obj,GameObject *seen);
221 void Timer_Expired(GameObject *obj,
int number);
222 void AttackTarget(GameObject *obj,GameObject *target,GameObject *secondaryTarget,
bool repairTarget,
bool useRepairGun);
223 void Action_Complete(GameObject *obj,
int action_id,ActionCompleteReason reason);
224 void Damaged(GameObject *obj,GameObject *damager,
float damage);
225 bool inRange(GameObject *obj);
226 inline bool Valid_Repair_Target(GameObject *obj,GameObject *target,
int playerType);
227 inline bool Valid_Repair_Target_C4(GameObject *obj,GameObject *target,
int playerType);
228 bool Get_Random_Wander_Point(Vector3 *position);
239 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
244 struct GenericDateTime
253 GenericDateTime(
const GenericDateTime &dateTime)
255 this->month = dateTime.month;
256 this->day = dateTime.day;
257 this->year = dateTime.year;
258 this->hour = dateTime.hour;
259 this->minute = dateTime.minute;
260 this->second = dateTime.second;
261 this->lTime = dateTime.lTime;
265 time_t theTime = time(0);
268 timeinfo = localtime(&theTime);
269 this->year = timeinfo->tm_year+1900;
270 this->month = timeinfo->tm_mon+1;
271 this->day = timeinfo->tm_mday;
272 this->hour = timeinfo->tm_hour;
273 this->minute = timeinfo->tm_min;
274 this->second = timeinfo->tm_sec;
275 this->lTime = (long)mktime(timeinfo);
280 sprintf(debug,
"msg %d/%d/%d %d:%02d:%02d {%lu}",month,day,year,hour,minute,second,lTime);
281 Console_Input(debug);
284 static bool IsInPathfindZone(Vector3 spot)
286 if (!Get_Random_Pathfind_Spot(spot,5.0f,&spot))
290 static void RotateZoneBox(
float Angle,Matrix3 Basis)
292 Angle = Angle*3.14159265f/180.0f;
293 float Sin = sin(Angle);
294 float Cos = cos(Angle);
295 Basis[0][0] = Cos;Basis[0][1] = Sin;Basis[0][2] = 0.0f;
296 Basis[1][0] = Sin;Basis[1][1] = Cos;Basis[1][2] = 0.0f;
297 Basis[2][0] = 0.0f;Basis[2][1] = 0.0f;Basis[2][2] = 1.0f;
299 static float rotationClamp(
float startRotation,
float addRotation)
301 startRotation += addRotation;
302 while (startRotation > 180)
303 startRotation -= 360;
304 while (startRotation < -180)
305 startRotation += 360;
306 return startRotation;
308 static char *JMG_Get_Compass_Directions(
float compassDegree)
311 sprintf(name,
"%s",compassDegree <= -168.75 ?
"W":
312 compassDegree <= -146.25 ?
"WSW":
313 compassDegree <= -123.75 ?
"SW":
314 compassDegree <= -101.25 ?
"SSW":
315 compassDegree <= -78.75 ?
"S":
316 compassDegree <= -56.25 ?
"SSE":
317 compassDegree <= -33.75 ?
"SE":
318 compassDegree <= -11.25 ?
"ESE":
319 compassDegree <= 11.25 ?
"E":
320 compassDegree <= 33.75 ?
"ENE":
321 compassDegree <= 56.25 ?
"NE":
322 compassDegree <= 78.75 ?
"NNE":
323 compassDegree <= 101.25 ?
"N":
324 compassDegree <= 123.75 ?
"NNW":
325 compassDegree <= 146.25 ?
"NW":
326 compassDegree <= 168.75 ?
"WNW":
327 compassDegree <= 180 ?
"W" :
"ERROR");
330 static char *formatDigitGrouping(
double money)
332 static char groupedMoney[43];
333 if (abs(money) > 100000000000000000000000000.0)
335 sprintf(groupedMoney,
"%.2lf",money);
338 char sMoney[40],tMoney[53],fMoney[53];
339 sprintf(sMoney,
"%.0lf",abs(money));
340 int length = strlen(sMoney),count = -1,pos;
341 pos = length+1+(length-1)/3;
343 for (
int x = length;x >= 0;x--)
346 tMoney[pos] = sMoney[x];
348 if (count == 3 && pos > 0)
356 sprintf(fMoney,
"-%s",tMoney);
358 sprintf(fMoney,
"%s",tMoney);
360 sprintf(sMoney,
"%.2lf",abs(money));
361 int nLength = strlen(sMoney);
362 pos = strlen(fMoney);
363 for (
int x = length;x < nLength;x++)
365 fMoney[pos] = sMoney[x];
369 sprintf(groupedMoney,
"%s",fMoney);
372 static char *formatDigitGrouping(
unsigned long value)
374 static char groupedMoney[43];
375 if (value > 10000000000000000000)
377 sprintf(groupedMoney,
"%lu",value);
380 char sValue[40],tValue[53],fValue[53];
381 sprintf(sValue,
"%lu",value);
382 int length = strlen(sValue),count = -1,pos;
383 pos = length+1+(length-1)/3;
385 for (
int x = length;x >= 0;x--)
388 tValue[pos] = sValue[x];
390 if (count == 3 && pos > 0)
397 sprintf(fValue,
"%s",tValue);
399 sprintf(groupedMoney,
"%s",fValue);
402 static char JMG_Get_Sex(GameObject *obj)
404 int TestID = Commands->Get_ID(obj);
407 if (!Get_Model(obj) || !_stricmp(Get_Model(obj),
"null"))
413 static const char *JMG_Get_Units_Sex(GameObject *Unit)
415 if (JMG_Get_Sex(Unit) ==
'A')
417 else if (JMG_Get_Sex(Unit) ==
'B')
422 static const char *JMG_Get_Units_Sex2(GameObject *Unit)
424 if (JMG_Get_Sex(Unit) ==
'A')
426 else if (JMG_Get_Sex(Unit) ==
'B')
431 static const char *JMG_Get_Units_Sex3(GameObject *Unit)
433 if (JMG_Get_Sex(Unit) ==
'A')
435 else if (JMG_Get_Sex(Unit) ==
'B')
440 static char *AorAn(
const char *name)
442 static char retChar[2];
443 if (strlen(name) == 0)
444 sprintf(retChar,
"A");
447 if (name[0] ==
'A' || name[0] ==
'a' || name[0] ==
'E' || name[0] ==
'e' || name[0] ==
'I' || name[0] ==
'i' || name[0] ==
'O' || name[0] ==
'o' || name[0] ==
'U' || name[0] ==
'u' || name[0] ==
'Y' || name[0] ==
'y')
448 sprintf(retChar,
"An");
450 sprintf(retChar,
"A");
454 static char *AorAn2(
const char *name)
456 static char retChar[2];
457 if (strlen(name) == 0)
458 sprintf(retChar,
"a");
461 if (name[0] ==
'A' || name[0] ==
'a' || name[0] ==
'E' || name[0] ==
'e' || name[0] ==
'I' || name[0] ==
'i' || name[0] ==
'O' || name[0] ==
'o' || name[0] ==
'U' || name[0] ==
'u' || name[0] ==
'Y' || name[0] ==
'y')
462 sprintf(retChar,
"an");
464 sprintf(retChar,
"a");
468 static char *Get_The_Units_Name(GameObject *Unit)
470 static char RetChar[512];
471 if (Commands->Is_A_Star(Unit))
472 sprintf(RetChar,
"%s",Get_Player_Name(Unit));
475 const char *name = Get_Translated_Preset_Name(Unit);
476 sprintf(RetChar,
"%s %s",AorAn(name),name);
480 static char *Get_The_Units_Name2(GameObject *Unit)
482 static char RetChar[512];
483 if (Commands->Is_A_Star(Unit))
484 sprintf(RetChar,
"%s",Get_Player_Name(Unit));
487 const char *name = Get_Translated_Preset_Name(Unit);
488 sprintf(RetChar,
"%s %s",AorAn2(name),Get_Translated_Preset_Name(Unit));
492 static long JMG_Get_Player_ID(GameObject *obj)
496 SoldierGameObj *o = obj->As_SoldierGameObj();
499 if (!((cPlayer *)o->Get_Player_Data()))
501 return ((cPlayer *)o->Get_Player_Data())->Get_Id();
503 static int JMG_Get_Current_Weapon_ID(GameObject *obj)
507 PhysicalGameObj *o2 = obj->As_PhysicalGameObj();
510 ArmedGameObj *o3 = o2->As_ArmedGameObj();
513 WeaponBagClass *w = o3->Get_Weapon_Bag();
514 if ((w->Get_Index()) && (w->Get_Index() < w->Get_Count()))
515 return w->Peek_Weapon(w->Get_Index())->Get_ID();
518 static float SimpleDistance(
const Vector3 &Pos1,
const Vector3 &Pos2)
520 float DiffX = Pos1.X-Pos2.X;
521 float DiffY = Pos1.Y-Pos2.Y;
522 float DiffZ = Pos1.Z-Pos2.Z;
523 return (DiffX*DiffX+DiffY*DiffY+DiffZ*DiffZ);
525 static float SimpleFlatDistance(
const Vector3 &Pos1,
const Vector3 &Pos2)
527 float DiffX = Pos1.X-Pos2.X;
528 float DiffY = Pos1.Y-Pos2.Y;
529 return (DiffX*DiffX+DiffY*DiffY);
531 static float MathClamp(
float Value,
float Min,
float Max)
539 static double MathClampDouble(
double Value,
double Min,
double Max)
547 static int MathClampInt(
int Value,
int Min,
int Max)
555 static void DisplayChatMessage(GameObject *obj,
int Red,
int Green,
int Blue,
const char *Message)
559 int Strlen = strlen(Message);
562 Send_Message_Player(obj,Red,Green,Blue,Message);
567 for (x = 0;x < 220 && x < Strlen;x++)
570 Send_Message_Player(obj,255,0,200,msg);
572 static void MessageAllPlayers(
int Red,
int Green,
int Blue,
const char *MSG)
574 for (
int x = 0;x < 128;x++)
576 GameObject *Player = Get_GameObj(x);
579 DisplayChatMessage(Player,Red,Green,Blue,MSG);
582 static void MessageTeamPlayers(
int Red,
int Green,
int Blue,
int Team,
const char *MSG)
584 for (
int x = 0;x < 128;x++)
586 GameObject *Player = Get_GameObj(x);
587 if (!Player || Get_Team(x) != Team)
589 DisplayChatMessage(Player,Red,Green,Blue,MSG);
592 static void MessageTeamPlayersType(
int Red,
int Green,
int Blue,
int Team,
const char *MSG)
594 for (
int x = 0;x < 128;x++)
596 GameObject *Player = Get_GameObj(x);
597 if (!Player || Commands->Get_Player_Type(Player) != Team)
599 DisplayChatMessage(Player,Red,Green,Blue,MSG);
602 static void MessageTeamPlayersAndType(
int Red,
int Green,
int Blue,
int Team,
const char *MSG)
604 for (
int x = 0;x < 128;x++)
606 GameObject *Player = Get_GameObj(x);
607 if (!Player || !(Commands->Get_Player_Type(Player) == Team || Get_Team(x) == Team))
609 DisplayChatMessage(Player,Red,Green,Blue,MSG);
612 static GameObject *FindNearestPlayer(
const Vector3 &pos)
614 GameObject *nearestPlayer = NULL;
615 float nearest = -1.0f;
616 for (
int x = 1;x < 128;x++)
618 GameObject *player = Get_GameObj(x);
619 if (!player || Get_Player_Type(player) == -4)
621 float tempDist = SimpleDistance(pos,Commands->Get_Position(player));
622 if (nearest < 0 || tempDist < nearest)
625 nearestPlayer = player;
628 return nearestPlayer;
630 static char *Rp2Encrypt(
const char *String,
int EncryptionFactor,
int Start)
632 static char FinalString[65536];
633 sprintf(FinalString,
" ");
634 int loops = strlen(String),x = 0;
635 int CurrentAdd = Start;
638 if (String[x] > 31 && String[x] < 127)
640 int Temp = (String[x]+CurrentAdd);
643 FinalString[x] = (char)Temp;
646 FinalString[x] = String[x];
649 if (CurrentAdd > EncryptionFactor)
651 FinalString[x] =
'\0';
655 static char *Rp2Encrypt2(
const char *String,
int EncryptionFactor,
int Start)
657 static char FinalString[65536];
658 sprintf(FinalString,
" ");
659 int loops = strlen(String),x = 0;
660 int CurrentAdd = Start;
663 if (String[x] > 31 && String[x] < 127)
665 int Temp = (String[x]+CurrentAdd);
668 FinalString[x] = (char)Temp;
671 FinalString[x] = String[x];
674 if (CurrentAdd > EncryptionFactor)
676 FinalString[x] =
'\0';
680 static char *Rp2Encrypt3(
const char *String,
int EncryptionFactor,
int Start)
682 static char FinalString[65536];
683 sprintf(FinalString,
" ");
684 int loops = strlen(String),x = 0;
685 int CurrentAdd = Start;
688 if (String[x] > 31 && String[x] < 127)
690 int Temp = (String[x]+CurrentAdd);
693 FinalString[x] = (char)Temp;
696 FinalString[x] = String[x];
699 if (CurrentAdd > EncryptionFactor)
701 FinalString[x] =
'\0';
705 static char *Rp2Encrypt4(
const char *String,
int EncryptionFactor,
int Start)
707 static char FinalString[65536];
708 sprintf(FinalString,
" ");
709 int loops = strlen(String),x = 0;
710 int CurrentAdd = Start;
713 if (String[x] > 31 && String[x] < 127)
715 int Temp = (String[x]+CurrentAdd);
718 FinalString[x] = (char)Temp;
721 FinalString[x] = String[x];
724 if (CurrentAdd > EncryptionFactor)
726 FinalString[x] =
'\0';
730 static char *Rp2Decrypt(
const char *String,
int EncryptionFactor,
int Start)
732 static char FinalString[65536];
733 int loops = strlen(String),x = 0;
734 int CurrentAdd = Start;
737 if (String[x] > 31 && String[x] < 127)
739 int Temp = String[x]-CurrentAdd;
742 FinalString[x] = (char)Temp;
745 if (String[x] ==
'\n')
746 FinalString[x] =
'\0';
748 FinalString[x] = String[x];
751 if (CurrentAdd > EncryptionFactor)
753 FinalString[x] =
'\0';
757 static bool IsTruePhysicalObject(GameObject *obj)
759 if (obj->As_ScriptableGameObj() && obj->As_PhysicalGameObj())
761 if (obj->As_SoldierGameObj())
763 if (obj->As_VehicleGameObj())
777 static float MathClampDegrees(
float Value)
779 while (Value < -180.0f)
781 while (Value > 180.0f)
785 static bool hasStatedDeathMessage[128];
786 static void setStatedDeathMessage(
int playerId,
bool value)
788 hasStatedDeathMessage[playerId] = value;
790 static void JMG_Player_Death_Message(GameObject *obj,GameObject *killer,
const char *overrideMessage)
792 int playerId = JMG_Get_Player_ID(obj);
793 if (hasStatedDeathMessage[playerId])
797 sprintf(deathMsg,
"%s",overrideMessage);
799 sprintf(deathMsg,
"%s died",JmgUtility::Get_The_Units_Name(obj));
800 else if (killer == obj)
801 sprintf(deathMsg,
"%s killed %s",JmgUtility::Get_The_Units_Name(obj),JmgUtility::JMG_Get_Units_Sex(obj));
803 sprintf(deathMsg,
"%s killed %s",JmgUtility::Get_The_Units_Name(killer),JmgUtility::Get_The_Units_Name2(obj));
804 if (Commands->Is_A_Star(obj))
805 MessageAllPlayers(255,255,0,deathMsg);
806 hasStatedDeathMessage[playerId] =
true;
808 static void SetHUDHelpText(
unsigned long stringId,Vector3 color)
810 for (
int x = 0;x < 128;x++)
812 GameObject *Player = Get_GameObj(x);
815 Set_HUD_Help_Text_Player(Player,stringId,color);
818 static void SetHUDHelpText(
unsigned long stringId,
const char *message,Vector3 color)
820 for (
int x = 0;x < 128;x++)
822 GameObject *Player = Get_GameObj(x);
825 Set_HUD_Help_Text_Player_Text(Player,stringId,message,color);
828 static bool DegreeDiff(
float Deg1,
float Deg2,
float MaxDiff)
830 if (abs(Deg1-Deg2) <= MaxDiff)
832 if (360-abs(Deg1-Deg2) <= MaxDiff)
836 static bool CanSeeStealth(
int stealthModeOverride,GameObject *obj,GameObject *seen)
838 if (stealthModeOverride == -1)
840 if (!stealthModeOverride && seen->As_SmartGameObj() && seen->As_SmartGameObj()->Is_Stealthed())
842 float dist = JmgUtility::SimpleDistance(Commands->Get_Position(obj),Commands->Get_Position(seen));
843 if (seen->As_SoldierGameObj() && dist > seen->As_SoldierGameObj()->Get_Stealth_Fade_Distance()*seen->As_SoldierGameObj()->Get_Stealth_Fade_Distance())
845 else if (seen->As_VehicleGameObj() && dist > seen->As_VehicleGameObj()->Get_Stealth_Fade_Distance()*seen->As_VehicleGameObj()->Get_Stealth_Fade_Distance())
847 else if (dist > seen->As_SmartGameObj()->Get_Stealth_Fade_Distance()*seen->As_SmartGameObj()->Get_Stealth_Fade_Distance())
852 static void Create_2D_Wave_Sound_Dialog(
const char *soundName)
854 for (
int x = 1;x < 128;x++)
856 GameObject *player = Get_GameObj(x);
859 Create_2D_Wave_Sound_Dialog_Player(player,soundName);
874 void Created(GameObject *obj);
877 int objectivePriority;
889 void Created(GameObject *obj);
895class NewObjectiveSystem
897 bool objectiveStringIdsLoaded;
898 const char *objectiveNewString;
899 const char *objectiveCancelledString;
900 const char *objectiveStatusChangedString;
901 const char *objectivePrioritieStrings[12];
902 const char *objectiveStatusStrings[4];
903 const char *objectiveListString;
904 const char *objectiveUpdateObjectiveString;
905 const char *objectiveCancelledStringNumbered;
906 const char *objectiveStatusChangedStringNumbered;
907 const char *objectiveUpdateObjectiveStringNumbered;
908 char primaryObjectiveModel[32];
909 char secondaryObjectiveModel[32];
910 char tertiaryObjectiveModel[32];
913 enum Priority{Undefined=-1,Unknown,Primary,Secondary,Tertiary,Quaternary,Quinary,Senary,Septenary,Octonary,Nonary,Denary,Bonus};
914 enum Status{Removed=-2,NotDefined=-1,Pending,Accomplished,Failed,Hidden};
916 char infantryAttachBone[32];
917 struct ObjectiveVisibleSettingOverride
920 char markerModel[16];
923 int overrideTextColor;
925 int overrideHudColor;
927 ObjectiveVisibleSettingOverride(
int objectiveId,
const char *model,
int markerColor,
const char *attachBone,
int overrideTextColor,Vector3 textColor,
int overrideHudColor,Vector3 hudColor)
929 this->objectiveId = objectiveId;
930 sprintf(this->markerModel,
"%s",model);
931 this->markerColor = markerColor;
932 sprintf(this->attachBone,
"%s",attachBone);
933 this->overrideTextColor = overrideTextColor;
934 this->textColor = textColor;
935 this->overrideHudColor = overrideHudColor;
936 this->hudColor = hudColor;
938 static Vector3 DefaultRenegadeColors(
int color)
942 case RADAR_BLIP_COLOR_NOD:
return Vector3(200,0,0);
943 case RADAR_BLIP_COLOR_GDI:
return Vector3(225,175,65);
944 case RADAR_BLIP_COLOR_NEUTRAL:
return Vector3(225,225,240);
945 case RADAR_BLIP_COLOR_MUTANT:
return Vector3(0,100,0);
946 case RADAR_BLIP_COLOR_RENEGADE:
return Vector3(0,0,255);
947 case RADAR_BLIP_COLOR_PRIMARY_OBJECTIVE:
return Vector3(50,225,50);
948 case RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE:
return Vector3(50,150,250);
949 case RADAR_BLIP_COLOR_TERTIARY_OBJECTIVE:
return Vector3(150,50,150);
950 default:
return Vector3(0,0,0);
954 SList<ObjectiveVisibleSettingOverride> overrideVisibleObjectiveSettings;
961 unsigned long nameId;
963 unsigned long descriptionId;
968 ObjectiveNode(
int id, Priority priority, Status status,
unsigned long nameId,
char *soundFilename,
unsigned long descriptionId,
int radarMarkerId,
int objectiveNumber)
971 this->priority = priority;
972 this->status = status;
973 this->nameId = nameId;
974 this->soundFilename = soundFilename;
975 this->descriptionId = descriptionId;
976 this->radarMarkerId = radarMarkerId;
978 this->objectiveNumber = objectiveNumber;
982 ObjectiveNode *objectiveNodeList;
985 void initilizeStringIds()
987 objectiveNewString = Get_Translated_String(Get_String_ID_By_Desc(
"IDS_OBJ2_NEW_OBJ"));
988 objectiveCancelledString = Get_Translated_String(Get_String_ID_By_Desc(
"IDS_OBJ2_CANCELLED"));
989 objectiveStatusChangedString = Get_Translated_String(Get_String_ID_By_Desc(
"IDS_OBJ2_STATUS_CHANGED"));
990 objectiveListString = Get_Translated_String(Get_String_ID_By_Desc(
"IDS_OBJ2_LIST"));
991 objectiveUpdateObjectiveString = Get_Translated_String(Get_String_ID_By_Desc(
"IDS_OBJ2_UPDATED"));
992 char descriptionString[512];
993 for (
int x = 0;x < 12;x++)
995 sprintf(descriptionString,
"IDS_OBJ2_PRIORITY_%0d",x);
996 objectivePrioritieStrings[x] = Get_Translated_String(Get_String_ID_By_Desc(descriptionString));
998 for (
int x = 0;x < 4;x++)
1000 sprintf(descriptionString,
"IDS_OBJ2_STATE_%0d",x);
1001 objectiveStatusStrings[x] = Get_Translated_String(Get_String_ID_By_Desc(descriptionString));
1003 objectiveCancelledStringNumbered = Get_Translated_String(Get_String_ID_By_Desc(
"IDS_OBJ2_CANCELLED_NUMBERED"));
1004 objectiveStatusChangedStringNumbered = Get_Translated_String(Get_String_ID_By_Desc(
"IDS_OBJ2_STATUS_CHANGED_NUMBERED"));
1005 objectiveUpdateObjectiveStringNumbered = Get_Translated_String(Get_String_ID_By_Desc(
"IDS_OBJ2_UPDATED_NUMBERED"));
1006 objectiveStringIdsLoaded =
true;
1008 void selectMessageAndColor(
int objectiveId,
const char *format,Priority priority)
1010 ObjectiveVisibleSettingOverride *overrideMarker = FindOverrideForObjective(objectiveId);
1011 if (overrideMarker && overrideMarker->overrideTextColor)
1012 if (overrideMarker->overrideTextColor == -1)
1014 Vector3 color = ObjectiveVisibleSettingOverride::DefaultRenegadeColors(overrideMarker->markerColor);
1015 JmgUtility::MessageTeamPlayersAndType((
int)color.X,(
int)color.Y,(
int)color.Z,team,format);
1018 JmgUtility::MessageTeamPlayersAndType((
int)overrideMarker->textColor.X,(
int)overrideMarker->textColor.Y,(
int)overrideMarker->textColor.Z,team,format);
1022 case Primary: JmgUtility::MessageTeamPlayersAndType(50,255,50,team,format);
break;
1023 case Secondary: JmgUtility::MessageTeamPlayersAndType(50,150,250,team,format);
break;
1024 case Tertiary:
case Unknown: JmgUtility::MessageTeamPlayersAndType(150,50,150,team,format);
break;
1025 default: JmgUtility::MessageTeamPlayersAndType(125,150,150,team,format);
break;
1028 void messagePlayerAndColor(
int objectiveId,GameObject *player,
const char *format,Priority priority)
1030 ObjectiveVisibleSettingOverride *overrideMarker = FindOverrideForObjective(objectiveId);
1031 if (overrideMarker && overrideMarker->overrideTextColor)
1032 if (overrideMarker->overrideTextColor == -1)
1034 Vector3 color = ObjectiveVisibleSettingOverride::DefaultRenegadeColors(overrideMarker->markerColor);
1035 JmgUtility::DisplayChatMessage(player,(
int)color.X,(
int)color.Y,(
int)color.Z,format);
1038 JmgUtility::DisplayChatMessage(player,(
int)overrideMarker->textColor.X,(
int)overrideMarker->textColor.Y,(
int)overrideMarker->textColor.Z,format);
1042 case Primary: JmgUtility::DisplayChatMessage(player,50,255,50,format);
break;
1043 case Secondary: JmgUtility::DisplayChatMessage(player,50,150,250,format);
break;
1044 case Tertiary:
case Unknown: JmgUtility::DisplayChatMessage(player,150,50,150,format);
break;
1045 default: JmgUtility::DisplayChatMessage(player,125,150,150,format);
break;
1048 void messagePlayerAndColorBasic(GameObject *player,
const char *format,Priority priority)
1052 case Primary: JmgUtility::DisplayChatMessage(player,50,255,50,format);
break;
1053 case Secondary: JmgUtility::DisplayChatMessage(player,50,150,250,format);
break;
1054 case Tertiary:
case Unknown: JmgUtility::DisplayChatMessage(player,150,50,150,format);
break;
1055 default: JmgUtility::DisplayChatMessage(player,125,150,150,format);
break;
1058 char *formatObjectiveString(
const char *format,...)
1060 static char displayMsg[256];
1062 va_start(args,format);
1063 vsprintf(displayMsg,format,args);
1067 bool addObjective(
int id, Priority priority, Status status,
unsigned long nameId,
char *soundFilename,
unsigned long descriptionId,
int radarMarkerId,
int objectiveNumber)
1069 if (priority == Undefined)
1071 if (!objectiveStringIdsLoaded)
1072 initilizeStringIds();
1073 ObjectiveNode *current = objectiveNodeList;
1074 if (!objectiveNodeList)
1075 objectiveNodeList =
new ObjectiveNode(
id,priority,status,nameId,soundFilename,descriptionId,radarMarkerId,objectiveNumber);
1078 if (current->id ==
id)
1079 if (current->active)
1081 Destroy_Radar_Marker(current->radarMarkerId);
1086 Destroy_Radar_Marker(current->radarMarkerId);
1088 current->priority = priority;
1089 current->status = status;
1090 current->nameId = nameId;
1091 current->soundFilename = soundFilename;
1092 current->descriptionId = descriptionId;
1093 current->radarMarkerId = radarMarkerId;
1094 current->objectiveNumber = objectiveNumber;
1095 current->active =
true;
1100 current->next =
new ObjectiveNode(
id,priority,status,nameId,soundFilename,descriptionId,radarMarkerId,objectiveNumber);
1103 current = current->next;
1106 if (status != Hidden && descriptionId)
1108 selectMessageAndColor(
id,formatObjectiveString(objectiveNewString,objectivePrioritieStrings[priority]),priority);
1109 if (objectiveNumber)
1110 selectMessageAndColor(
id,formatObjectiveString(Get_Translated_String(descriptionId),objectiveNumber),priority);
1112 selectMessageAndColor(
id,Get_Translated_String(descriptionId),priority);
1116 void Destroy_Radar_Marker(
int markerId)
1118 Destroy_Objective_GameObject(markerId);
1119 GameObject *marker = Commands->Find_Object(markerId);
1122 Commands->Destroy_Object(marker);
1124 ObjectiveVisibleSettingOverride *FindOverrideForObjective(
int objectiveId)
1126 for (SLNode<ObjectiveVisibleSettingOverride> *node = overrideVisibleObjectiveSettings.Head();node;node = node->Next())
1127 if (node->Data() && node->Data()->objectiveId == objectiveId)
1128 return node->Data();
1131 GameObject *Create_Radar_Marker(Vector3 pos, Priority priority,
int objectiveId)
1133 GameObject *radarMarker = Commands->Create_Object(
"Daves Arrow",pos);
1134 Commands->Set_Player_Type(radarMarker,team);
1135 Commands->Set_Is_Visible(radarMarker,
false);
1136 ObjectiveVisibleSettingOverride *overrideMarker = FindOverrideForObjective(objectiveId);
1137 if (overrideMarker && _stricmp(overrideMarker->markerModel,
""))
1138 Commands->Set_Model(radarMarker,overrideMarker->markerModel);
1142 case Priority::Primary:Commands->Set_Model(radarMarker,primaryObjectiveModel);
break;
1143 case Priority::Secondary:Commands->Set_Model(radarMarker,secondaryObjectiveModel);
break;
1144 case Priority::Tertiary:Commands->Set_Model(radarMarker,tertiaryObjectiveModel);
break;
1145 default:Commands->Set_Model(radarMarker,
"null");
break;
1149 Commands->Set_Obj_Radar_Blip_Shape(radarMarker,RADAR_BLIP_SHAPE_OBJECTIVE);
1150 if (overrideMarker && overrideMarker->markerColor != -1)
1151 Commands->Set_Obj_Radar_Blip_Color(radarMarker,overrideMarker->markerColor);
1153 Commands->Set_Obj_Radar_Blip_Color(radarMarker,priority == Primary ? RADAR_BLIP_COLOR_PRIMARY_OBJECTIVE : priority == Secondary ? RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE : RADAR_BLIP_COLOR_TERTIARY_OBJECTIVE);
1155 Create_Objective_GameObject(radarMarker,objectiveId,priority,overrideMarker);
1159 NewObjectiveSystem(
int team,
bool showRadarStars =
true,
const char *primaryObjectiveModel =
"null",
const char *secondaryObjectiveModel =
"null",
const char *tertiaryObjectiveModel =
"null")
1161 sprintf(infantryAttachBone,
"c pelvis");
1163 objectiveStringIdsLoaded =
false;
1164 objectiveCounts = 0;
1165 sprintf(this->primaryObjectiveModel,
"%s",primaryObjectiveModel);
1166 sprintf(this->secondaryObjectiveModel,
"%s",secondaryObjectiveModel);
1167 sprintf(this->tertiaryObjectiveModel,
"%s",tertiaryObjectiveModel);
1168 this->showRadarStars = showRadarStars;
1169 objectiveNodeList = NULL;
1170 overrideVisibleObjectiveSettings.Remove_All();
1172 ~NewObjectiveSystem()
1174 objectiveStringIdsLoaded =
false;
1175 objectiveCounts = 0;
1176 ObjectiveNode *temp = objectiveNodeList,*die;
1183 objectiveNodeList = NULL;
1185 bool Add_Objective(
int objectiveId, Priority priority, Status status,
unsigned long nameId,
char *soundFilename,
unsigned long descriptionId,GameObject *blipUnit,
int objectiveNumber = 0)
1189 GameObject *radarMarker = Create_Radar_Marker(Commands->Get_Position(blipUnit),priority,objectiveId);
1192 ObjectiveVisibleSettingOverride *overrideMarker = FindOverrideForObjective(objectiveId);
1193 if (overrideMarker && _stricmp(overrideMarker->attachBone,
""))
1194 Commands->Attach_To_Object_Bone(radarMarker,blipUnit,overrideMarker->attachBone);
1196 Commands->Attach_To_Object_Bone(radarMarker,blipUnit,blipUnit->As_SoldierGameObj() ? infantryAttachBone :
"origin");
1197 return addObjective(objectiveId,priority,status,nameId,soundFilename,descriptionId,Commands->Get_ID(radarMarker),objectiveNumber);
1199 bool Add_Objective(
int objectiveId, Priority priority, Status status,
unsigned long nameId,
char *soundFilename,
unsigned long descriptionId,Vector3 blipPosition,
int objectiveNumber = 0)
1201 GameObject *radarMarker = Create_Radar_Marker(blipPosition,priority,objectiveId);
1204 return addObjective(objectiveId,priority,status,nameId,soundFilename,descriptionId,Commands->Get_ID(radarMarker),objectiveNumber);
1206 bool Get_Radar_Blip_Position(
int objectiveId,Vector3 *position)
1208 ObjectiveNode *current = objectiveNodeList;
1211 if (current->id == objectiveId)
1213 GameObject *objectiveMarker = Commands->Find_Object(current->radarMarkerId);
1214 if (objectiveMarker)
1216 *position = Commands->Get_Position(objectiveMarker);
1221 current = current->next;
1225 void Set_Radar_Blip(
int objectiveId,GameObject *blipUnit,
const char *modelOverride = NULL)
1229 ObjectiveNode *current = objectiveNodeList;
1232 if (current->id == objectiveId)
1234 Destroy_Radar_Marker(current->radarMarkerId);
1235 GameObject *radarMarker = Create_Radar_Marker(Commands->Get_Position(blipUnit),current->priority,objectiveId);
1238 Commands->Attach_To_Object_Bone(radarMarker,blipUnit,blipUnit->As_SoldierGameObj() ? infantryAttachBone :
"origin");
1239 current->radarMarkerId = Commands->Get_ID(radarMarker);
1242 current = current->next;
1245 void Remove_Radar_Blip(
int objectiveId)
1247 ObjectiveNode *current = objectiveNodeList;
1250 if (current->id == objectiveId)
1252 Destroy_Radar_Marker(current->radarMarkerId);
1255 current = current->next;
1258 void Set_Radar_Blip(
int objectiveId,Vector3 blipPosition,
const char *modelOverride = NULL)
1260 ObjectiveNode *current = objectiveNodeList;
1263 if (current->id == objectiveId)
1265 Destroy_Radar_Marker(current->radarMarkerId);
1266 GameObject *radarMarker = Create_Radar_Marker(blipPosition,current->priority,objectiveId);
1269 current->radarMarkerId = Commands->Get_ID(radarMarker);
1272 current = current->next;
1275 bool Add_Objective(
int objectiveId, Priority priority, Status status,
unsigned long nameId,
char *soundFilename,
unsigned long descriptionId,
int objectiveNumber = 0)
1277 return addObjective(objectiveId,priority,status,nameId,soundFilename,descriptionId,0,objectiveNumber);
1279 long Get_Mission_Text_Id(
int objectiveId)
1281 ObjectiveNode *current = objectiveNodeList;
1284 if (current->id == objectiveId)
1285 return current->nameId;
1286 current = current->next;
1290 bool Remove_Objective(
int objectiveId)
1292 ObjectiveNode *current = objectiveNodeList;
1295 if (current->id == objectiveId)
1296 if (current->active)
1299 if (current->status == Pending && current->nameId)
1300 if (current->objectiveNumber)
1301 selectMessageAndColor(objectiveId,formatObjectiveString(objectiveCancelledStringNumbered,objectivePrioritieStrings[current->priority],current->objectiveNumber),current->priority);
1303 selectMessageAndColor(objectiveId,formatObjectiveString(objectiveCancelledString,objectivePrioritieStrings[current->priority]),current->priority);
1304 Destroy_Radar_Marker(current->radarMarkerId);
1305 current->active =
false;
1310 current = current->next;
1314 bool Set_Objective_Status(
int objectiveId,Status status)
1316 ObjectiveNode *current = objectiveNodeList;
1319 if (current->id == objectiveId)
1320 if (current->status != status)
1322 if (status != Hidden && current->status != Hidden && current->nameId)
1323 if (current->objectiveNumber)
1324 selectMessageAndColor(objectiveId,formatObjectiveString(objectiveStatusChangedStringNumbered,objectivePrioritieStrings[current->priority],current->objectiveNumber,objectiveStatusStrings[status]),current->priority);
1326 selectMessageAndColor(objectiveId,formatObjectiveString(objectiveStatusChangedString,objectivePrioritieStrings[current->priority],objectiveStatusStrings[status]),current->priority);
1327 GameObject *marker = Commands->Find_Object(current->radarMarkerId);
1330 if (status == Pending)
1332 Commands->Set_Is_Rendered(marker,
true);
1334 Commands->Set_Obj_Radar_Blip_Shape(marker,RADAR_BLIP_SHAPE_OBJECTIVE);
1338 Commands->Set_Is_Rendered(marker,
false);
1340 Commands->Set_Obj_Radar_Blip_Shape(marker,RADAR_BLIP_SHAPE_NONE);
1342 Commands->Set_Player_Type(marker,status == Pending);
1344 current->status = status;
1349 current = current->next;
1353 bool Set_Objective_Mission(
int objectiveId,
unsigned int nameStringId,
unsigned int descriptionStringId)
1355 ObjectiveNode *current = objectiveNodeList;
1358 if (current->id == objectiveId)
1359 if (current->nameId != nameStringId || current->descriptionId != descriptionStringId)
1361 current->nameId = nameStringId;
1362 current->descriptionId = descriptionStringId;
1363 if (current->status != Hidden && descriptionStringId)
1365 if (current->objectiveNumber)
1367 selectMessageAndColor(objectiveId,formatObjectiveString(objectiveUpdateObjectiveStringNumbered,objectivePrioritieStrings[current->priority],current->objectiveNumber),current->priority);
1368 selectMessageAndColor(objectiveId,formatObjectiveString(Get_Translated_String(descriptionStringId),current->objectiveNumber),current->priority);
1372 selectMessageAndColor(objectiveId,formatObjectiveString(objectiveUpdateObjectiveString,objectivePrioritieStrings[current->priority]),current->priority);
1373 selectMessageAndColor(objectiveId,Get_Translated_String(descriptionStringId),current->priority);
1380 current = current->next;
1384 Status Get_Objective_Status(
int objectiveId)
1386 ObjectiveNode *current = objectiveNodeList;
1389 if (current->id == objectiveId)
1390 if (current->active)
1391 return current->status;
1394 current = current->next;
1398 Priority Get_Objective_Priority(
int objectiveId)
1400 ObjectiveNode *current = objectiveNodeList;
1403 if (current->id == objectiveId)
1404 return current->priority;
1405 current = current->next;
1409 int Get_Objective_Status_Count(Status status,Priority requiredPriority = Undefined)
1412 ObjectiveNode *current = objectiveNodeList;
1415 if (current->active && current->status == status && (requiredPriority == Undefined || current->priority == requiredPriority))
1417 current = current->next;
1421 int Get_Objective_Priority_Count(Priority requiredPriority,Status status = NotDefined)
1424 ObjectiveNode *current = objectiveNodeList;
1427 if (current->active && current->priority == requiredPriority && (status == NotDefined || current->status == status))
1429 current = current->next;
1433 void Dispaly_First_Pending_Primary_Objective_On_Hud(GameObject *obj)
1435 ObjectiveNode *current = objectiveNodeList;
1438 if (current->active && current->status == Pending && current->priority == Priority::Primary && current->nameId)
1440 ObjectiveVisibleSettingOverride *overrideMarker = FindOverrideForObjective(current->id);
1441 if (overrideMarker && overrideMarker->overrideHudColor)
1442 if (overrideMarker->overrideHudColor == -1)
1444 Vector3 color = ObjectiveVisibleSettingOverride::DefaultRenegadeColors(overrideMarker->markerColor);
1445 Set_HUD_Help_Text_Player(obj,current->nameId,Vector3(color.X/255.0f,color.Y/255.0f,color.Z/255.0f));
1448 Set_HUD_Help_Text_Player(obj,current->nameId,Vector3(overrideMarker->hudColor.X/255.0f,overrideMarker->hudColor.Y/255.0f,overrideMarker->hudColor.Z/255.0f));
1450 Set_HUD_Help_Text_Player(obj,current->nameId,Vector3(0,1,0));
1453 current = current->next;
1456 void Display_Current_Objectives(GameObject *player,Priority priority)
1458 messagePlayerAndColorBasic(player,formatObjectiveString(objectiveListString,objectivePrioritieStrings[priority]),priority);
1459 ObjectiveNode *current = objectiveNodeList;
1462 if (current->active && current->status == Pending && current->priority == priority && current->nameId)
1464 char objectiveMsg[220];
1465 if (current->objectiveNumber)
1466 sprintf(objectiveMsg,
"*%s",formatObjectiveString(Get_Translated_String(current->nameId),current->objectiveNumber));
1468 sprintf(objectiveMsg,
"*%s",Get_Translated_String(current->nameId));
1469 messagePlayerAndColor(current->id,player,objectiveMsg,priority);
1471 current = current->next;
1474 void Display_All_Objectives(GameObject *player)
1477 for (
int x = 0;x < 12;x++)
1478 counts[x] = Get_Objective_Status_Count(Pending,(Priority)x);
1479 for (
int x = 0;x < 12;x++)
1481 Display_Current_Objectives(player,(Priority)x);
1483 int Get_First_Pending_Objective_Of_Priority(Priority priority)
1485 ObjectiveNode *current = objectiveNodeList;
1488 if (current->active && current->status == Pending && current->priority == priority && current->nameId)
1490 current = current->next;
1494 Vector3 Get_Hud_Help_Text_Color(
int objectiveId,Priority priority)
1496 ObjectiveVisibleSettingOverride *overrideMarker = FindOverrideForObjective(objectiveId);
1497 if (overrideMarker && overrideMarker->overrideHudColor)
1498 return Vector3(overrideMarker->hudColor.X/255.0f,overrideMarker->hudColor.Y/255.0f,overrideMarker->hudColor.Z/255.0f);
1501 case Priority::Primary:
1502 return Vector3(0.196f,0.882f,0.196f);
1503 case Priority::Secondary:
1504 return Vector3(0.196f,0.588f,0.98f);
1505 case Priority::Tertiary:
1506 return Vector3(0.588f,0.196f,0.588f);
1508 return Vector3(1.0f,1.0f,1.0f);
1511 void Create_Objective_GameObject(GameObject *radarMarker,
int objectiveId,
int objectivePriority,ObjectiveVisibleSettingOverride *overrideMarker)
1513 GameObject *obj = Commands->Find_Object(controllerId);
1516 const SimpleDynVecClass<GameObjObserverClass *> & observer_list = obj->Get_Observers();
1517 for(
int index = 0;index < observer_list.Count();index++)
1518 if (!_stricmp(observer_list[index]->Get_Name(),
"JMG_Utility_Objective_System_Objective_GameObject"))
1521 if (script && (script->objectiveId == objectiveId || script->objectiveId == -2) && (script->objectivePriority == objectivePriority || script->objectivePriority == -2))
1523 GameObject *
object = Commands->Create_Object(script->preset,Commands->Get_Position(radarMarker));
1525 if (overrideMarker && _stricmp(overrideMarker->attachBone,
""))
1526 Commands->Attach_To_Object_Bone(
object,radarMarker,overrideMarker->attachBone);
1528 Commands->Attach_To_Object_Bone(
object,radarMarker,
"origin");
1530 sprintf(params,
"%d,%d",Commands->Get_ID(
object),Commands->Get_ID(radarMarker));
1531 Commands->Attach_Script(obj,
"JMG_Utility_Objective_System_Objective_GameObject_Tracker",params);
1535 void Destroy_Objective_GameObject(
int markerId)
1537 GameObject *obj = Commands->Find_Object(controllerId);
1540 const SimpleDynVecClass<GameObjObserverClass *> & observer_list = obj->Get_Observers();
1541 for(
int index = 0;index < observer_list.Count();index++)
1542 if (!_stricmp(observer_list[index]->Get_Name(),
"JMG_Utility_Objective_System_Objective_GameObject_Tracker"))
1545 if (script && script->markerId == markerId)
1547 GameObject *
object = Commands->Find_Object(script->gameObjectId);
1549 Commands->Destroy_Object(
object);
1550 script->Destroy_Script();
1554 bool Check_If_All_Objectives_Are_Complete(
int objectiveIds[],
int count)
1556 for (
int x = 0;x < count;x++)
1558 if (Get_Objective_Status(objectiveIds[x]) != Status::Accomplished)
1563 GameObject *GetObjectiveMarker(
int objectiveMarkerId,GameObject *sender,
int objectiveId);
1564 void OverrideObjectiveVisibilitySettings(
int objectiveId,
const char *model,
int markerColor,
const char *attachBone,
int overrideTextColor,Vector3 textColor,
int overrideHudColor,Vector3 hudColor)
1566 ObjectiveVisibleSettingOverride *overrideObject =
new ObjectiveVisibleSettingOverride(objectiveId,model,markerColor,attachBone,overrideTextColor,textColor,overrideHudColor,hudColor);
1567 overrideVisibleObjectiveSettings.Add_Tail(overrideObject);
1571class ClientNetworkObjectPositionSync
1574 struct SyncObjectNode
1579 struct SyncObjectNode *next;
1580 SyncObjectNode(GameObject *obj)
1582 this->
id = Commands->Get_ID(obj);
1583 this->facing = Commands->Get_Facing(obj);
1584 this->position = Commands->Get_Position(obj);
1590 SyncObjectNode *syncObjectNodeList;
1593 bool syncedPlayers[128];
1594 SyncObjectNode *lastSyncNode[128];
1597 for (
int x = 0;x < 128;x++)
1599 syncedPlayers[x] =
false;
1600 lastSyncNode[x] = NULL;
1603 void clientNoLongerSynced(
int playerId)
1605 syncedPlayers[playerId] =
false;
1606 lastSyncNode[playerId] = NULL;
1609 SyncControl syncControl;
1611 ClientNetworkObjectPositionSync()
1613 syncObjectNodeList = NULL;
1614 syncControl = SyncControl();
1616 SyncObjectNode *addNode(GameObject *obj)
1618 int id = Commands->Get_ID(obj);
1619 SyncObjectNode *current = syncObjectNodeList;
1620 if (!syncObjectNodeList)
1621 return syncObjectNodeList =
new SyncObjectNode(obj);
1627 current->facing = Commands->Get_Facing(obj);
1628 current->position = Commands->Get_Position(obj);
1631 if (current->id ==
id)
1635 current->next =
new SyncObjectNode(obj);
1636 return current->next;
1638 current = current->next;
1642 void checkForPlayersThatLeftTheGame()
1644 for (
int x = 1;x < 128;x++)
1646 GameObject *player = Get_GameObj(x);
1648 syncControl.clientNoLongerSynced(x);
1651 void triggerSingleNetworkSync()
1653 for (
int x = 1;x < 128;x++)
1655 if (syncControl.syncedPlayers[x])
1657 GameObject *player = Get_GameObj(x);
1660 if (!syncControl.lastSyncNode[x])
1661 syncControl.lastSyncNode[x] = syncObjectNodeList;
1662 if (syncControl.lastSyncNode[x])
1664 if (syncControl.lastSyncNode[x]->id)
1666 GameObject *syncObject = Commands->Find_Object(syncControl.lastSyncNode[x]->id);
1669 Force_Position_Update_Player(player,syncObject);
1670 Force_Orientation_Update_Player(player,syncObject);
1673 syncControl.lastSyncNode[x] = syncControl.lastSyncNode[x]->next;
1675 if (!syncControl.lastSyncNode[x])
1676 syncControl.syncedPlayers[x] =
true;
1681 SyncObjectNode *temp = syncObjectNodeList,*die;
1688 syncObjectNodeList = NULL;
1689 syncControl = SyncControl();
1693class Rp2SimplePositionSystem
1696 struct SimplePositionNode
1702 struct SimplePositionNode *next;
1703 SimplePositionNode(GameObject *obj,
int value = 0)
1705 this->
id = Commands->Get_ID(obj);
1706 this->facing = Commands->Get_Facing(obj);
1707 this->position = Commands->Get_Position(obj);
1708 this->value = value;
1712 SimplePositionNode *SimplePositionNodeList;
1714 Rp2SimplePositionSystem()
1717 SimplePositionNodeList = NULL;
1719 Rp2SimplePositionSystem &operator += (GameObject *obj)
1721 int id = Commands->Get_ID(obj);
1722 SimplePositionNode *Current = SimplePositionNodeList;
1723 if (!SimplePositionNodeList)
1724 SimplePositionNodeList =
new SimplePositionNode(obj);
1727 if (Current->id ==
id)
1731 Current->next =
new SimplePositionNode(obj);
1734 Current = Current->next;
1739 Rp2SimplePositionSystem &operator += (SimplePositionNode *node)
1741 SimplePositionNode *Current = SimplePositionNodeList;
1742 if (!SimplePositionNodeList)
1743 SimplePositionNodeList = node;
1746 if (Current->id == node->id)
1750 Current->next = node;
1753 Current = Current->next;
1761 SimplePositionNode *temp,*die;
1762 temp = SimplePositionNodeList;
1769 SimplePositionNodeList = NULL;
1771 SimplePositionNode *GetRandomFromGroup(
int value)
1773 int random = Commands->Get_Random_Int(0,ObjectCount*2),original;
1775 SimplePositionNode *Current = SimplePositionNodeList;
1778 if (random && value == Current->value)
1780 if (!random && value == Current->value)
1782 Current = Current->next;
1783 if (!Current && original != random && original)
1784 Current = SimplePositionNodeList;
1788 SimplePositionNode *GetNextFromGroup(
int value,SimplePositionNode *last)
1791 SimplePositionNode *Current = SimplePositionNodeList;
1794 if (found && value == Current->value)
1796 if (Current == last && value == Current->value)
1798 Current = Current->next;
1800 Current = SimplePositionNodeList;
1804 SimplePositionNode *GetRandom()
1806 int random = Commands->Get_Random_Int(0,ObjectCount*2);
1807 SimplePositionNode *Current = SimplePositionNodeList;
1814 Current = Current->next;
1816 Current = SimplePositionNodeList;
1820 SimplePositionNode *GetNearest(Vector3 pos)
1822 float LongestDistance = 0;
1823 SimplePositionNode *TempObject = NULL;
1824 SimplePositionNode *Current = SimplePositionNodeList;
1827 float Temp = JmgUtility::SimpleDistance(Current->position,pos);
1828 if (!TempObject || Temp < LongestDistance)
1830 TempObject = Current;
1831 LongestDistance = Temp;
1833 Current = Current->next;
1837 SimplePositionNode *GetNearestFromGroup(
int groupId,Vector3 pos)
1839 float LongestDistance = 0;
1840 SimplePositionNode *TempObject = NULL;
1841 SimplePositionNode *Current = SimplePositionNodeList;
1844 if (Current->value == groupId)
1846 float Temp = JmgUtility::SimpleDistance(Current->position,pos);
1847 if (!TempObject || Temp < LongestDistance)
1849 TempObject = Current;
1850 LongestDistance = Temp;
1853 Current = Current->next;
1857 Vector3 GetNearestVector(Vector3 pos)
1859 SimplePositionNode *TempObject = GetNearest(pos);
1861 return TempObject->position;
1864 SimplePositionNode *GetNearestFlat(Vector3 pos)
1866 float LongestDistance = 0;
1867 SimplePositionNode *TempObject = NULL;
1868 SimplePositionNode *Current = SimplePositionNodeList;
1871 float Temp = JmgUtility::SimpleFlatDistance(Current->position,pos);
1872 if (!TempObject || Temp < LongestDistance)
1874 TempObject = Current;
1875 LongestDistance = Temp;
1877 Current = Current->next;
1881 SimplePositionNode *GetRandom(
int minVal)
1883 int repeatLimit = ObjectCount;
1884 int random = Commands->Get_Random_Int(0,ObjectCount*2);
1885 SimplePositionNode *Current = SimplePositionNodeList;
1888 if (random && Current->value <= minVal)
1890 if (!random && Current->value <= minVal)
1892 Current = Current->next;
1893 if (!Current && repeatLimit)
1896 Current = SimplePositionNodeList;
1901 SimplePositionNode *GetRandomExcluding(SimplePositionNode *node)
1903 int repeatLimit = ObjectCount;
1904 int random = Commands->Get_Random_Int(0,ObjectCount*2);
1905 SimplePositionNode *Current = SimplePositionNodeList;
1910 if (!random && node != Current)
1912 Current = Current->next;
1913 if (!Current && repeatLimit)
1916 Current = SimplePositionNodeList;
1921 SimplePositionNode *GetRandomLowestValue()
1924 SimplePositionNode *current = SimplePositionNodeList;
1927 if (lowest == -1 || current->value <= lowest)
1928 lowest = current->value;
1929 current = current->next;
1931 int random = Commands->Get_Random_Int(0,ObjectCount*2)+1;
1932 int originalRandom = random;
1933 current = SimplePositionNodeList;
1936 if (random && current->value == lowest)
1940 current = current->next;
1941 if (!current && originalRandom != random)
1942 current = SimplePositionNodeList;
1946 SimplePositionNode *GetRandomOutsideOfRange(
float range,Vector3 pos)
1949 SimplePositionNode *current = SimplePositionNodeList;
1950 int random = Commands->Get_Random_Int(0,ObjectCount*2)+1;
1951 int originalRandom = random;
1954 if (JmgUtility::SimpleDistance(current->position,pos) > range && random)
1958 current = current->next;
1959 if (!current && originalRandom != random)
1960 current = SimplePositionNodeList;
1964 SimplePositionNode *GetRandomOutsideOfRangeInGroup(
int value,
float range,Vector3 pos)
1967 SimplePositionNode *current = SimplePositionNodeList;
1968 int random = Commands->Get_Random_Int(0,ObjectCount*2)+1;
1969 int originalRandom = random;
1972 if (current->value == value && JmgUtility::SimpleDistance(current->position,pos) > range && random)
1974 if (current->value == value && !random)
1976 current = current->next;
1977 if (!current && originalRandom != random)
1978 current = SimplePositionNodeList;
1982 SimplePositionNode *GetFurthestInGroup(
int value,Vector3 pos)
1984 float LongestDistance = 0;
1985 SimplePositionNode *TempObject = NULL;
1986 SimplePositionNode *Current = SimplePositionNodeList;
1989 if (Current->value == value)
1991 float Temp = JmgUtility::SimpleDistance(Current->position,pos);
1992 if (!TempObject || Temp > LongestDistance)
1994 TempObject = Current;
1995 LongestDistance = Temp;
1998 Current = Current->next;
2002 SimplePositionNode *GetRandomInsideOfRangeInGroup(
int value,
float range,Vector3 pos)
2005 SimplePositionNode *current = SimplePositionNodeList;
2006 int random = Commands->Get_Random_Int(0,ObjectCount*2)+1;
2007 int originalRandom = random;
2010 if (current->value == value && JmgUtility::SimpleDistance(current->position,pos) <= range && random)
2012 if (value && !random)
2014 current = current->next;
2015 if (!current && originalRandom != random)
2016 current = SimplePositionNodeList;
2020 SimplePositionNode *GetLowestValueFurthestFromSpot(Vector3 pos)
2023 SimplePositionNode *current = SimplePositionNodeList,*bestNode = NULL;
2026 if (lowest == -1 || current->value <= lowest)
2027 lowest = current->value;
2028 current = current->next;
2031 current = SimplePositionNodeList;
2035 float tempDist = JmgUtility::SimpleDistance(pos,current->position);
2036 if (!bestNode || tempDist > dist)
2041 current = current->next;
2045 SimplePositionNode *GetSpotNotVisibileFromSpot(Vector3 pos);
2046 SimplePositionNode *GetNonVisibleSpotFromPlayers(
int value);
2047 SimplePositionNode *GetFurthestSpotFromPlayers(
int value)
2049 SimplePositionNode *current = SimplePositionNodeList,*bestNode = NULL;
2053 if (current->value == value)
2055 GameObject *player = Commands->Get_A_Star(current->position);
2058 float tempDist = JmgUtility::SimpleDistance(Commands->Get_Position(player),current->position);
2059 if (!bestNode || tempDist > dist)
2065 current = current->next;
2069 void DecreaseValue()
2071 SimplePositionNode *Current = SimplePositionNodeList;
2076 Current = Current->next;
2079 void ChangeAllWanderPointGroupIdsThatMatch(
int changeId,
int newId)
2081 SimplePositionNode *current = SimplePositionNodeList;
2084 if (changeId == current->value)
2085 current->value = newId;
2086 current = current->next;
2089 void ChangeAllWanderPointGroupIdsThatMatchAndAreInRange(
int changeId,Vector3 pos,
float range,
int newId)
2091 float rangeSq = range*range;
2092 SimplePositionNode *current = SimplePositionNodeList;
2095 if (changeId == current->value)
2097 float tempDist = JmgUtility::SimpleDistance(pos,current->position);
2098 if (tempDist <= rangeSq)
2099 current->value = newId;
2101 current = current->next;
2112 ClientNetworkObjectPositionSync::SyncObjectNode *syncNode;
2113 void Created(GameObject *obj);
2114 void Timer_Expired(GameObject *obj,
int number);
2115 void Killed(GameObject *obj,GameObject *killer);
2116 void Destroyed(GameObject *obj);
2117 void Detach(GameObject *obj);
2133 void Created(GameObject *obj);
2134 void Timer_Expired(GameObject *obj,
int number);
2135 void Destroyed(GameObject *obj);
2136 void Detach(GameObject *obj);
2149 void Created(GameObject *obj);
2150 void Timer_Expired(GameObject *obj,
int number);
2172 int attachScriptsGroupId;
2173 void Created(GameObject *obj);
2174 void Timer_Expired(GameObject *obj,
int number);
2175 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2176 void CalculateRespawnTime();
2178 static Vector3 preSpawnLocation;
2181class JMG_Utility_Basic_Spawner_Spawned_Object :
public ScriptImpClass
2183 void Destroyed(GameObject *obj);
2186struct JMGVehicleAction
2193 float arriveDistance;
2198 position = Vector3();
2201 arriveDistance = 0.0f;
2203 bool operator == (JMGVehicleAction jva)
2205 return (targetId == jva.targetId && position == jva.position && useAmmo == jva.useAmmo);
2207 bool operator != (JMGVehicleAction jva)
2209 return (!(*
this == jva));
2211 JMGVehicleAction &operator = (JMGVehicleAction jva)
2213 targetId = jva.targetId;
2214 useAmmo = jva.useAmmo;
2215 position = jva.position;
2216 backward = jva.backward;
2217 following = jva.following;
2218 arriveDistance = jva.arriveDistance;
2251 struct JMGVehicleAmmo
2263 JMGVehicleAmmo primary;
2264 JMGVehicleAmmo secondary;
2265 JMGVehicleAction currentAction;
2266 JMGVehicleAction lastAction;
2267 bool overrideFireMode;
2268 bool overridePrimary;
2274 int doNotUsePathfind;
2276 float minDistanceSquared;
2285 bool drivingBackward;
2287 float maxHuntRangeSquared;
2288 Vector3 lastWanderPointSpot;
2289 float grabNextPointDistance;
2290 float retreatDistanceSquared;
2291 void Created(GameObject *obj);
2292 void Action_Complete(GameObject *obj,
int action,ActionCompleteReason reason);
2293 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2294 void Enemy_Seen(GameObject *obj,GameObject *seen);
2295 void Damaged(GameObject *obj,GameObject *damager,
float damage);
2296 void Timer_Expired(GameObject *obj,
int number);
2297 void RunAttack(GameObject *obj,GameObject *target);
2298 int GetThreatRating(GameObject * obj);
2299 GameObject *GetAttackObject(GameObject * obj);
2300 GameObject *SelectTarget(GameObject *obj,GameObject *target);
2301 GameObject *SetTarget(GameObject *target);
2302 GameObject *GetClosest(GameObject *obj,GameObject *new_target,GameObject *old_target);
2303 int SelectAmmo(GameObject *target);
2304 void StuckCheck(GameObject *obj);
2305 void ReturnHome(GameObject * obj);
2306 void AttackMove(GameObject *obj,GameObject *target,
bool followTarget,Vector3 targetLocation,
int fireMode,
float weaponError,
bool forceUpdate,
float arriveDistance);
2307 JMGVehicleAmmo DefineAmmo(
const AmmoDefinitionClass *ammo);
2308 bool GetRandomPosition(Vector3 *position);
2309 bool GetRandomPositionOutsideOfRange(Vector3 *position);
2312class DynamicClockSystem
2315 struct DynamicClockSystemNode
2323 struct DynamicClockSystemNode *next;
2324 DynamicClockSystemNode(GameObject *obj)
2326 clockId = Commands->Get_ID(obj);
2337 struct DynamicClockSystemNode *DynamicClockSystemNodeList;
2339 DynamicClockSystem()
2342 DynamicClockSystemNodeList = NULL;
2344 DynamicClockSystem &operator += (GameObject *obj)
2346 DynamicClockSystemNode *Current = DynamicClockSystemNodeList;
2347 if (!DynamicClockSystemNodeList)
2348 DynamicClockSystemNodeList =
new DynamicClockSystemNode(obj);
2351 if (Current->clock == obj)
2353 if (!Current->clock)
2355 Current->clockId = Commands->Get_ID(obj);
2356 Current->clock = obj;
2361 Current->next =
new DynamicClockSystemNode(obj);
2364 Current = Current->next;
2368 DynamicClockSystem &operator -= (GameObject *obj)
2370 if (!DynamicClockSystemNodeList)
2372 DynamicClockSystemNode *Current = DynamicClockSystemNodeList;
2375 if (Current->clock == obj)
2377 Current->clock = NULL;
2380 Current = Current->next;
2387 DynamicClockSystemNode *temp,*die;
2388 temp = DynamicClockSystemNodeList;
2395 DynamicClockSystemNodeList = NULL;
2397 inline void updateClocks()
2400 struct tm *ptm = localtime(&t);
2401 int curTime = ptm->tm_hour%24;
2402 curTime = (curTime < 0 ? curTime+24 : curTime);
2403 float frame = (curTime*60.0f+ptm->tm_min);
2404 DynamicClockSystemNode *Current = DynamicClockSystemNodeList;
2408 Commands->Set_Animation(Current->clock,
"s_ecwClock.a_ecwClock",
false,0,frame,frame,
true);
2409 Current = Current->next;
2413class JMG_Utility_Dynamic_Clock_Control :
public ScriptImpClass {
2415 void Created(GameObject *obj);
2416 void Timer_Expired(GameObject *obj,
int number);
2417 void Destroyed(GameObject *obj);
2421class JMG_Utility_Dynamic_Clock_Object :
public ScriptImpClass {
2422 int animSynced[128];
2423 void Created(GameObject *obj);
2424 void Timer_Expired(GameObject *obj,
int number);
2425 void Destroyed(GameObject *obj);
2438 void Entered(GameObject *obj,GameObject *enterer);
2439 void Exited(GameObject *obj,GameObject *exiter);
2449 void Destroyed(GameObject *obj);
2459 bool playingMusic[128];
2460 void Created(GameObject *obj);
2461 void Timer_Expired(GameObject *obj,
int number);
2462 void Destroyed(GameObject *obj);
2463 void Detach(GameObject *obj);
2464 static char musicFileName[256];
2466 static bool controllerPlaced;
2467 SCRIPTS_API
static void Set_Music(
const char *musicFilName,
int fadeOut,
int fadeIn);
2479 void Created(GameObject *obj);
2514 float preDamagedFrame;
2515 char originalModel[16];
2518 void Created(GameObject *obj);
2519 void Poked(GameObject *obj,GameObject *poker);
2520 void Damaged(GameObject *obj,GameObject *damager,
float damage);
2521 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2522 void SendCustom(GameObject *obj,
int param);
2533 void Created(GameObject *obj);
2546 float healthThresholds[3];
2547 void Created(GameObject *obj);
2548 void Damaged(GameObject *obj,GameObject *damager,
float damage);
2549 void SetModel(GameObject *obj);
2563 float healthThresholds[4];
2564 void Created(GameObject *obj);
2565 void Damaged(GameObject *obj,GameObject *damager,
float damage);
2566 void SetModel(GameObject *obj);
2575 void Created(GameObject *obj);
2576 void Poked(GameObject *obj, GameObject *poker);
2578 static int pctInaccessible[128];
2587 void Entered(GameObject *obj,GameObject *enterer);
2588 void Exited(GameObject *obj,GameObject *exiter);
2597 void Destroyed(GameObject *obj);
2609 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2621 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2632 void Created(GameObject *obj);
2633 void Timer_Expired(GameObject *obj,
int number);
2651 float noPathfindRange;
2653 int lastSeenSecondary;
2654 int currentTargetID;
2655 int secondaryTargetId;
2658 Vector3 homelocation;
2660 int minVisibilityTime;
2661 int maxVisibilityTime;
2662 float maxHuntDistance;
2665 void Created(GameObject *obj);
2666 void Timer_Expired(GameObject *obj,
int number);
2667 void Enemy_Seen(GameObject *obj,GameObject *seen);
2668 void Damaged(GameObject *obj,GameObject *damager,
float damage);
2669 bool chooseTarget(GameObject *obj,GameObject *damager,
int *compareId,
int *seenTimer);
2697 int previewObjectId;
2698 int placementBlocked;
2700 void Created(GameObject *obj);
2701 void Timer_Expired(GameObject *obj,
int number);
2702 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2703 void Killed(GameObject *obj,GameObject *killer);
2704 void Destroyed(GameObject *obj);
2705 void DestroyPreview();
2709 placementBlocked = 0;
2712class JMG_Utility_Infantry_Placed_Buildable_Object_Attached :
public ScriptImpClass {
2713 void Damaged(GameObject *obj,GameObject *damager,
float damage);
2714 void Killed(GameObject *obj,GameObject *killer);
2725 void Created(GameObject *obj);
2726 void Timer_Expired(GameObject *obj,
int number);
2735 void Created(GameObject *obj);
2750 void Created(GameObject *obj);
2751 void Entered(GameObject *obj,GameObject *enter);
2752 void Exited(GameObject *obj,GameObject *exiter);
2754 struct PlayerWaterNode
2757 float waterColorOpacity;
2758 float waterMinViewDistance;
2759 float waterMaxViewDistance;
2762 this->waterColor = Vector3(0.28f,0.43f,0.55f);
2763 this->waterColorOpacity = 0.5f;
2764 this->waterMinViewDistance = 5.0f;
2765 this->waterMaxViewDistance = 15.0f;
2767 PlayerWaterNode(Vector3 waterColor,
float waterColorOpacity,
float waterMinViewDistance,
float waterMaxViewDistance)
2769 this->waterColor = waterColor;
2770 this->waterColorOpacity = waterColorOpacity;
2771 this->waterMinViewDistance = waterMinViewDistance;
2772 this->waterMaxViewDistance = waterMaxViewDistance;
2775 static JMG_Utility_Swimming_Zone::PlayerWaterNode waterNode[128];
2776 static float fogMinDistance;
2777 static float fogMaxDistance;
2778 SCRIPTS_API
static void Update_Fog_Settings(
float minFog,
float maxFog);
2807 int heartBeatSoundId;
2809 char enterWeapon[256];
2811 bool startedFadeRed;
2815 int lastWaterZoneId;
2816 time_t lastDisplayTime;
2818 int waterDamageDelayTime;
2819 int waterDamageDelayTimeRecover;
2820 int remainingWaterDamageDelay;
2821 char originalSkin[128];
2822 char originalArmor[128];
2823 char originalModel[128];
2824 void Created(GameObject *obj);
2825 void Timer_Expired(GameObject *obj,
int number);
2826 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2827 void Killed(GameObject *obj,GameObject *killer);
2828 void Destroyed(GameObject *obj);
2829 void Detach(GameObject *obj);
2830 void CreateSoundEmitter(GameObject *obj,
const char *model,
int *soundId);
2831 void DestroySoundEmitter(
int *soundId);
2832 void HideSoundEmitter(
int *soundId);
2834 static bool isUnderwater[128];
2835 static bool isInWater[128];
2836 static bool getInWater(
int playerId){
return isUnderwater[playerId];}
2837 static bool getIsUnderwater(
int playerId){
return isInWater[playerId];}
2851 void Entered(GameObject *obj,GameObject *enterer);
2866 bool hasShownMessage[128];
2867 void Created(GameObject *obj);
2868 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2883 void Entered(GameObject *obj,GameObject *enter);
2900 int EnemyTimeOutTime;
2902 int stealthModeOverride;
2905 void Created(GameObject *obj);
2906 void Timer_Expired(GameObject *obj,
int number);
2907 void Enemy_Seen(GameObject *obj,GameObject *seen);
2908 void Damaged(GameObject *obj,GameObject *damager,
float damage);
2909 void Goto_Location(GameObject *obj);
2910 bool Get_A_Defense_Point(Vector3 *position);
2930 void Created(GameObject *obj);
2931 void Timer_Expired(GameObject *obj,
int number);
2948 void Created(GameObject *obj);
2949 void Timer_Expired(GameObject *obj,
int number);
2958 void Created(GameObject *obj);
2961class JMG_Utility_Reset_Screen_Fade_And_Fog_On_Destroy :
public ScriptImpClass {
2962 void Destroyed(GameObject *obj);
2963 void Detach(GameObject *obj);
2997 enum aiState{IDLE,HUNTING_STAR,ATTACKING_TARGET,RETURNING_HOME,WANDERING_GROUP,ACTION_BADPATH};
3005 bool overrideLocation;
3009 LastAction(
int targetId,Vector3 location,
float speed,
float distance,
bool attack,
bool overrideLocation)
3011 this->targetId = targetId;
3012 this->location = location;
3013 this->speed = speed;
3014 this->distance = distance;
3015 this->attack = attack;
3016 this->overrideLocation = overrideLocation;
3019 struct ValidLastLocation
3023 ValidLastLocation(
bool valid)
3025 this->valid = valid;
3027 ValidLastLocation(
int enemyId);
3029 float maxSightFromHomeLocation;
3030 LastAction lastAction;
3032 Vector3 homeLocation;
3037 float weaponEffectiveRange;
3039 int ignoreStarsTime[128];
3040 float huntSearchDistance;
3041 float huntArriveDistance;
3042 float attackArriveDistance;
3045 Vector3 lastPosition;
3047 float wanderDistanceOverride;
3048 int wanderingAiGroupId;
3052 float returnHomeSpeed;
3053 int changeWanderGroupCustom;
3054 int changeWanderSpeedCustom;
3055 int changeHuntDistanceCustom;
3056 int changeReturnHomeSpeedCustom;
3057 int changeHuntSpeedCustom;
3058 int changeMaxSightFromHomeLocationCustom;
3059 int changeAttackSpeedCustom;
3060 void Created(GameObject *obj);
3061 void Enemy_Seen(GameObject *obj,GameObject *seen);
3062 void Timer_Expired(GameObject *obj,
int number);
3063 void Action_Complete(GameObject *obj,
int action_id,ActionCompleteReason reason);
3064 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
3065 void Damaged(GameObject *obj,GameObject *damager,
float damage);
3066 void Attack_Move(GameObject *obj,GameObject *target,Vector3 location,
float speed,
float distance,
bool attack,
bool overrideLocation);
3067 GameObject *findClosestStar(GameObject *obj);
3068 void Return_Home(GameObject *obj,ValidLastLocation goNearLastWanderPoint);
3069 void Stuck_Check(GameObject *obj,Vector3 targetPos);
3070 void Cant_Get_To_target(GameObject *obj);
3071 bool GetRandomPosition(Vector3 *position);
3072 bool Choose_Target(GameObject *obj,GameObject *target);
3075class AggressiveAttackSpotSystem
3078 struct AggressiveAttackSpotNode
3082 Vector3 attackOffset;
3085 struct AggressiveAttackSpotNode *next;
3086 AggressiveAttackSpotNode(GameObject *obj,
int groupId,Vector3 attackOffset)
3088 this->
id = Commands->Get_ID(obj);
3089 this->position = Commands->Get_Position(obj);
3090 this->attackOffset = attackOffset;
3092 this->groupId = groupId;
3098 AggressiveAttackSpotNode *aggressiveAttackSpotNodeList;
3100 AggressiveAttackSpotSystem()
3103 aggressiveAttackSpotNodeList = NULL;
3105 AggressiveAttackSpotNode *addNode(GameObject *obj,
int groupId,Vector3 attackOffset)
3107 int id = Commands->Get_ID(obj);
3108 AggressiveAttackSpotNode *current = aggressiveAttackSpotNodeList;
3110 if (!aggressiveAttackSpotNodeList)
3111 return aggressiveAttackSpotNodeList =
new AggressiveAttackSpotNode(obj,groupId,attackOffset);
3114 if (current->id ==
id)
3121 current->next =
new AggressiveAttackSpotNode(obj,groupId,attackOffset);
3122 return current->next;
3124 current = current->next;
3128 void killNode(GameObject *obj)
3130 int id = Commands->Get_ID(obj);
3131 AggressiveAttackSpotNode *current = aggressiveAttackSpotNodeList;
3134 if (current->id ==
id)
3135 current->alive =
false;
3136 current = current->next;
3139 AggressiveAttackSpotNode *GetRandomNode(
int groupId)
3141 if (The_Game()->Is_Game_Over())
3144 int random = nodeCount > 0 ? Commands->Get_Random_Int(0,nodeCount*2) : 0;
3145 AggressiveAttackSpotNode *current = aggressiveAttackSpotNodeList;
3148 if (current->alive && (groupId == -1 || current->groupId == groupId))
3155 current = current->next;
3156 if (!current && lastCount != random)
3159 current = aggressiveAttackSpotNodeList;
3167 AggressiveAttackSpotNode *temp = aggressiveAttackSpotNodeList,*die;
3174 aggressiveAttackSpotNodeList = NULL;
3185 void Created(GameObject *obj);
3186 void Destroyed(GameObject *obj);
3198 AggressiveAttackSpotSystem::AggressiveAttackSpotNode *node;
3199 void Created(GameObject *obj);
3200 void Timer_Expired(GameObject *obj,
int number);
3201 void Killed(GameObject *obj,GameObject *killer);
3202 void Destroyed(GameObject *obj);
3220 AggressiveAttackSpotSystem::AggressiveAttackSpotNode *node;
3221 void Created(GameObject *obj);
3222 void Timer_Expired(GameObject *obj,
int number);
3223 void Destroyed(GameObject *obj);
3252 enum aiState{IDLE,ATTACKING_POINT,RETURNING_HOME,ATTACKING_ATTACKER,ACTION_BADPATH};
3260 bool overrideLocation;
3261 bool attackingPoint;
3265 LastAction(
int targetId,Vector3 location,
float speed,
float distance,
bool attack,
bool overrideLocation,
bool attackingPoint)
3267 this->targetId = targetId;
3268 this->location = location;
3269 this->speed = speed;
3270 this->distance = distance;
3271 this->attack = attack;
3272 this->overrideLocation = overrideLocation;
3273 this->attackingPoint = attackingPoint;
3276 AggressiveAttackSpotSystem::AggressiveAttackSpotNode *attackNode;
3277 LastAction lastAction;
3279 Vector3 homeLocation;
3283 float weaponEffectiveRange;
3284 float attackArriveDistance;
3285 float attackPointArriveDistance;
3288 bool reactToAttackChance;
3289 Vector3 lastPosition;
3291 bool usePrimaryFire;
3292 void Created(GameObject *obj);
3293 void Enemy_Seen(GameObject *obj,GameObject *seen);
3294 void Timer_Expired(GameObject *obj,
int number);
3295 void Action_Complete(GameObject *obj,
int action_id,ActionCompleteReason reason);
3296 void Damaged(GameObject *obj,GameObject *damager,
float damage);
3297 void Attack_Move(GameObject *obj,GameObject *target,Vector3 location,
float speed,
float distance,
bool attack,
bool overrideLocation,
bool attackingPoint);
3298 void Stuck_Check(GameObject *obj,Vector3 targetPos);
3299 void IdleChoice(GameObject *obj,
bool allowAttackPoint);
3300 bool Choose_Target(GameObject *obj,GameObject *target);
3308class JMG_Utility_Destroy_Objects_In_ID_Range_On_Death :
public ScriptImpClass
3310 void Destroyed(GameObject *obj);
3323 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
3345 bool supressMatchSpam;
3347 int playerCountParam;
3349 bool conditionMatching;
3350 bool destroyAfterTrigger;
3351 void Created(GameObject *obj);
3352 void Timer_Expired(GameObject *obj,
int number);
3353 void Send_The_Message(GameObject *obj,
int tempCount);
3367 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
3383 void Created(GameObject *obj);
3384 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
3398 void Entered(GameObject *obj,GameObject *enter);
3409 void Created(GameObject *obj);
3410 void Destroyed(GameObject *obj);
3423 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
3439 void Entered(GameObject *obj,GameObject *enter);
3450 void Created(GameObject *obj);
3461 void Created(GameObject *obj);
3462 void Timer_Expired(GameObject *obj,
int number);
3473 void Created(GameObject *obj);
3487 void Entered(GameObject *obj,GameObject *enter);
3499 void Killed(GameObject *obj,GameObject *killer);
3544 char playerNames[128][256];
3545 void Created(GameObject *obj);
3546 void Timer_Expired(GameObject *obj,
int number);
3547 void Destroyed(GameObject *obj);
3548 void Detach(GameObject *obj);
3550 static bool controllerPlaced;
3566 void Entered(GameObject *obj,GameObject *enter);
3567 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
3587 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
3602 void Killed(GameObject *obj, GameObject *damager);
3618 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
3630 void Destroyed(GameObject *obj);
3643 int maxPlayersToScaleFor;
3644 float maxScaleFactor;
3647 void Created(GameObject *obj);
3648 void Timer_Expired(GameObject *obj,
int number);
3649 void Damaged(GameObject *obj,GameObject *damager,
float damage);
3662 int maxPlayersToScaleFor;
3663 float maxScaleFactor;
3666 void Created(GameObject *obj);
3667 void Timer_Expired(GameObject *obj,
int number);
3668 void Damaged(GameObject *obj,GameObject *damager,
float damage);
3693 float healthPerPlayer;
3694 float armorPerPlayer;
3698 float scaleHealthPerHeal;
3699 float scaleArmorPerHeal;
3700 void Created(GameObject *obj);
3701 void Timer_Expired(GameObject *obj,
int number);
3702 void Damaged(GameObject *obj,GameObject *damager,
float damage);
3703 float ScaleValue(
float value,
float scale);
3714 void Created(GameObject *obj);
3715 void Timer_Expired(GameObject *obj,
int number);
3736 char faintAnimation[32];
3737 char layAnimation[32];
3738 char standAnimation[32];
3739 char faintSound[256];
3740 char standSound[256];
3741 bool changeArmorTypeWhenKnockedOut;
3742 char armorTypeWhileKnockedOut[256];
3743 char armorType[256];
3745 int teamWhileKnockedOut;
3746 void Created(GameObject *obj);
3747 void Timer_Expired(GameObject *obj,
int number);
3748 void Animation_Complete(GameObject *obj,
const char *animation);
3749 void Destroyed(GameObject *obj);
3766 int EnemyTimeOutTime;
3768 int stealthModeOverride;
3769 void Created(GameObject *obj);
3770 void Timer_Expired(GameObject *obj,
int number);
3771 void Enemy_Seen(GameObject *obj,GameObject *seen);
3772 void Damaged(GameObject *obj,GameObject *damager,
float damage);
3773 void Goto_Location(GameObject *obj);
3774 bool Get_A_Defense_Point(Vector3 *position);
3785 void Created(GameObject *obj);
3797 char weaponName[256];
3798 void Created(GameObject *obj);
3799 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
3813 void Created(GameObject *obj);
3814 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
3830 void Entered(GameObject *obj,GameObject *enterer);
3845 void Entered(GameObject *obj,GameObject *enterer);
3860 void Created(GameObject *obj);
3861 void Timer_Expired(GameObject *obj,
int number);
3877 void Created(GameObject *obj);
3878 void Timer_Expired(GameObject *obj,
int number);
3879 void Killed(GameObject *obj,GameObject *killer);
3880 void Destroyed(GameObject *obj);
3895 void Created(GameObject *obj);
3896 void Timer_Expired(GameObject *obj,
int number);
3913 void Created(GameObject *obj);
3914 void Timer_Expired(GameObject *obj,
int number);
3915 void Killed(GameObject *obj,GameObject *killer);
3916 void Destroyed(GameObject *obj);
3934 void Created(GameObject *obj);
3935 void Timer_Expired(GameObject *obj,
int number);
3949 void Created(GameObject *obj);
3950 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
3964 void Created(GameObject *obj);
3965 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
3980 void Created(GameObject *obj);
3981 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
3998 void Created(GameObject *obj);
3999 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4016 void Created(GameObject *obj);
4017 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4031 void Created(GameObject *obj);
4032 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4047 void Created(GameObject *obj);
4048 void Timer_Expired(GameObject *obj,
int number);
4049 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4066 void Entered(GameObject *obj,GameObject *enterer);
4085 bool receivedCustoms[10];
4086 void Created(GameObject *obj);
4087 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4102 bool retryOnFailure;
4104 float safeTeleportDistance;
4105 int wanderPointGroup;
4106 int changeGroupIDCustom;
4108 void Created(GameObject *obj);
4109 void Entered(GameObject *obj,GameObject *enterer);
4110 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4111 bool Get_A_Defense_Point(Vector3 *position,
float *facing);
4112 bool Grab_Teleport_Spot(GameObject *enter,
int attempts);
4121 float safeTeleportDistance;
4122 int wanderPointGroup;
4123 void Created(GameObject *obj);
4124 void Timer_Expired(GameObject *obj,
int number);
4125 bool Get_A_Defense_Point(Vector3 *position,
float *facing);
4136 int requiredPlayerType;
4138 void Created(GameObject *obj);
4139 void Entered(GameObject *obj,GameObject *enterer);
4160 void Created(GameObject *obj);
4161 void Entered(GameObject *obj,GameObject *enterer);
4176 void Created(GameObject *obj);
4177 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4190 void Entered(GameObject *obj,GameObject *enterer);
4202 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4211 void Created(GameObject *obj);
4212 void Timer_Expired(GameObject *obj,
int number);
4222 char weaponName[256];
4223 void Created(GameObject *obj);
4224 void Timer_Expired(GameObject *obj,
int number);
4225 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4226 void Destroyed(GameObject *obj);
4240 Vector3 scanTeleportSpot;
4242 float safeTeleportDistance;
4243 float teleportIgnoreDistance;
4244 int wanderPointGroup;
4246 void Created(GameObject *obj);
4247 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4248 bool Get_A_Defense_Point(Vector3 *position,
float *facing);
4249 bool Grab_Teleport_Spot(GameObject *enter,
int attempts);
4264 void Created(GameObject *obj);
4265 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4281 void Entered(GameObject *obj,GameObject *enterer);
4308 struct BriefingTextNode
4312 BriefingTextNode *next;
4313 BriefingTextNode(
const char *text)
4316 sprintf(Text,
"%s",text);
4319 BriefingTextNode(
const char *text,
float delay)
4322 sprintf(Text,
"%s",text);
4330 BriefingTextNode *BriefingText;
4331 BriefingTextNode *CurrentNode;
4333 void Created(GameObject *obj);
4334 void Timer_Expired(GameObject *obj,
int number);
4335 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4336 void Destroyed(GameObject *obj);
4337 void AddNewTextNode();
4338 void RemoveTextNodes();
4351 int requiredPlayerTeam;
4353 void Created(GameObject *obj);
4354 void Entered(GameObject *obj,GameObject *enterer);
4369 void Created(GameObject *obj);
4370 void Timer_Expired(GameObject *obj,
int number);
4388 void Created(GameObject *obj);
4389 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4401 void Created(GameObject *obj);
4402 void Timer_Expired(GameObject *obj,
int number);
4419 void Created(GameObject *obj);
4420 void Timer_Expired(GameObject *obj,
int number);
4433 void Created(GameObject *obj);
4434 void Timer_Expired(GameObject *obj,
int number);
4453 void Created(GameObject *obj);
4454 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4465 void Created(GameObject *obj);
4466 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4476 int requiredPlayerTeam;
4478 void Created(GameObject *obj);
4479 void Entered(GameObject *obj,GameObject *enterer);
4493 void Created(GameObject *obj);
4494 void Poked(GameObject *obj, GameObject *poker);
4504 void Created(GameObject *obj);
4519 void Created(GameObject *obj);
4520 void Timer_Expired(GameObject *obj,
int number);
4521 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4536 void Created(GameObject *obj);
4537 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4571 enum aiState{IDLE,HUNTING_STAR,ATTACKING_TARGET,RETURNING_HOME,WANDERING_GROUP,ACTION_BADPATH};
4579 bool overrideLocation;
4583 LastAction(
int targetId,Vector3 location,
float speed,
float distance,
bool attack,
bool overrideLocation)
4585 this->targetId = targetId;
4586 this->location = location;
4587 this->speed = speed;
4588 this->distance = distance;
4589 this->attack = attack;
4590 this->overrideLocation = overrideLocation;
4592 bool operator == (LastAction l)
4594 return (targetId == l.targetId && JmgUtility::SimpleDistance(location,l.location) <= 0.0f && speed == l.speed && distance == l.distance && attack == l.attack && overrideLocation == l.overrideLocation);
4597 struct ValidLastLocation
4601 ValidLastLocation(
bool valid)
4603 this->valid = valid;
4605 ValidLastLocation(
int enemyId);
4607 LastAction lastAction;
4609 Vector3 homeLocation;
4610 float maxSightFromHomeLocation;
4615 float weaponEffectiveRange;
4617 int removeIgnoreTime;
4619 float huntSearchDistance;
4620 float huntArriveDistance;
4621 float attackArriveDistance;
4624 Vector3 lastPosition;
4626 float wanderDistanceOverride;
4627 int wanderingAiGroupId;
4631 float returnHomeSpeed;
4632 int changeWanderGroupCustom;
4633 int changeWanderSpeedCustom;
4634 int changeHuntDistanceCustom;
4635 int changeReturnHomeSpeedCustom;
4636 int changeHuntSpeedCustom;
4637 int changeMaxSightFromHomeLocationCustom;
4638 int changeAttackSpeedCustom;
4639 void Created(GameObject *obj);
4640 void Enemy_Seen(GameObject *obj,GameObject *seen);
4641 void Timer_Expired(GameObject *obj,
int number);
4642 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4643 void Action_Complete(GameObject *obj,
int action_id,ActionCompleteReason reason);
4644 void Damaged(GameObject *obj,GameObject *damager,
float damage);
4645 void Attack_Move(GameObject *obj,GameObject *target,Vector3 location,
float speed,
float distance,
bool attack,
bool overrideLocation);
4646 GameObject *findClosestStar(GameObject *obj);
4647 void Return_Home(GameObject *obj,ValidLastLocation goNearLastWanderPoint);
4648 void Stuck_Check(GameObject *obj,Vector3 targetPos);
4649 void Cant_Get_To_target(GameObject *obj);
4650 bool GetRandomPosition(Vector3 *position);
4651 bool Choose_Target(GameObject *obj,GameObject *target);
4685 enum aiState{IDLE,HUNTING_STAR,ATTACKING_TARGET,RETURNING_HOME,WANDERING_GROUP,ACTION_BADPATH};
4693 bool overrideLocation;
4697 LastAction(
int targetId,Vector3 location,
float speed,
float distance,
bool attack,
bool overrideLocation)
4699 this->targetId = targetId;
4700 this->location = location;
4701 this->speed = speed;
4702 this->distance = distance;
4703 this->attack = attack;
4704 this->overrideLocation = overrideLocation;
4707 struct ValidLastLocation
4711 ValidLastLocation(
bool valid)
4713 this->valid = valid;
4715 ValidLastLocation(
int enemyId);
4717 float maxSightFromHomeLocation;
4718 LastAction lastAction;
4720 Vector3 homeLocation;
4725 float weaponEffectiveRange;
4727 int removeIgnoreTime;
4729 float huntSearchDistance;
4730 float huntArriveDistance;
4731 float attackArriveDistance;
4734 Vector3 lastPosition;
4736 float wanderDistanceOverride;
4737 int wanderingAiGroupId;
4741 float returnHomeSpeed;
4742 int changeWanderGroupCustom;
4743 int changeWanderSpeedCustom;
4744 int changeHuntDistanceCustom;
4745 int changeReturnHomeSpeedCustom;
4746 int changeHuntSpeedCustom;
4747 int changeMaxSightFromHomeLocationCustom;
4748 int changeAttackSpeedCustom;
4749 void Created(GameObject *obj);
4750 void Enemy_Seen(GameObject *obj,GameObject *seen);
4751 void Timer_Expired(GameObject *obj,
int number);
4752 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4753 void Action_Complete(GameObject *obj,
int action_id,ActionCompleteReason reason);
4754 void Damaged(GameObject *obj,GameObject *damager,
float damage);
4755 void Attack_Move(GameObject *obj,GameObject *target,Vector3 location,
float speed,
float distance,
bool attack,
bool overrideLocation);
4756 GameObject *findClosestStar(GameObject *obj);
4757 void Return_Home(GameObject *obj,ValidLastLocation goNearLastWanderPoint);
4758 void Stuck_Check(GameObject *obj,Vector3 targetPos);
4759 void Cant_Get_To_target(GameObject *obj);
4760 bool GetRandomPosition(Vector3 *position);
4761 bool Choose_Target(GameObject *obj,GameObject *target);
4773 AggressiveAttackSpotSystem::AggressiveAttackSpotNode *node;
4774 void Created(GameObject *obj);
4797 void Created(GameObject *obj);
4798 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4813 bool hasBeenOccupied;
4821 void Created(GameObject *obj);
4822 void Timer_Expired(GameObject *obj,
int number);
4823 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4840 void Created(GameObject *obj);
4841 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4861 int EnemyTimeOutTime;
4865 int stealthModeOverride;
4866 void Created(GameObject *obj);
4867 void Timer_Expired(GameObject *obj,
int number);
4868 void Enemy_Seen(GameObject *obj,GameObject *seen);
4869 void Damaged(GameObject *obj,GameObject *damager,
float damage);
4870 void Goto_Location(GameObject *obj);
4871 bool Get_A_Defense_Point(Vector3 *position);
4885 void Created(GameObject *obj);
4886 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4918 bool requiresADeathToStartNoPlayerAdd;
4919 float addDeathsWhenNoPlayers;
4920 int noPlayersAddDeathSaftyTime;
4921 int currentNoPlayersAddDeathSaftyTime;
4922 void Created(GameObject *obj);
4923 void Timer_Expired(GameObject *obj,
int number);
4924 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
4925 void Destroyed(GameObject *obj);
4926 void Detach(GameObject *obj);
4927 static char *formatReminderString(
const char *format,...);
4929 static void ReportLogic(GameObject *obj);
4930 static int deathCount;
4931 static int maxDeaths;
4932 static int deathReminder;
4933 static int urgentDeathReminder;
4934 static int stringId;
4936 static Vector3 reminderColor;
4937 static char reminderMessage[220];
4938 static char deathSingular[220];
4939 static char deathPlural[220];
4940 static char remainingSingular[220];
4941 static char remainingPlural[220];
4942 static int reminderMessageOrder;
4943 static bool controllerPlaced;
4944 static bool announceOnFirstDeath;
4945 static bool onlyTrackPlayerDeaths;
4946 static bool recordAIDeaths;
4956 void Killed(GameObject *obj,GameObject *killer);
4965 void Created(GameObject *obj);
4975 void Created(GameObject *obj);
4985 void Created(GameObject *obj);
4999 void Created(GameObject *obj);
5000 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
5012 unsigned int lastDamageWarhead;
5013 void Created(GameObject *obj);
5014 void Damaged(GameObject *obj,GameObject *damager,
float damage);
5015 void Killed(GameObject *obj,GameObject *killer);
5028 char entererPreset[256];
5029 void Created(GameObject *obj);
5030 void Entered(GameObject *obj,GameObject *enterer);
5043 void Created(GameObject *obj);
5044 void Timer_Expired(GameObject *obj,
int number);
5055 bool syncedScreen[128];
5056 void Created(GameObject *obj);
5057 void Timer_Expired(GameObject *obj,
int number);
5058 void Destroyed(GameObject *obj);
5059 void Detach(GameObject *obj);
5060 static Vector3 controllerDefaultColor;
5061 static float controllerDefaultOpacity;
5065 controllerPlaced =
true;
5067 static bool controllerPlaced;
5068 static Vector3 color[128];
5069 static float opacity[128];
5070 SCRIPTS_API
static void Update_Colors(Vector3 Color,
float Opacity);
5071 SCRIPTS_API
static void Update_Player_Colors(GameObject *player,Vector3 Color,
float Opacity);
5072 SCRIPTS_API
static void Reset_To_Default(GameObject *player);
5073 SCRIPTS_API
static void Update_Player(GameObject *player,
float transition);
5074 SCRIPTS_API
static void Update_All_Players(
float transition);
5089 void Created(GameObject *obj);
5090 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
5100 void Created(GameObject *obj);
5111 void Entered(GameObject *obj,GameObject *enter);
5126 enum mvmtDir{IDLE,FORWARD,BACKWARD,LEFT,RIGHT};
5127 char idleAnimation[32];
5128 char forwardAnimation[32];
5129 char backwardAnimation[32];
5130 char turnLeftAnimation[32];
5131 char turnRightAnimation[32];
5134 bool hasIdleAnimation;
5135 mvmtDir currentDirection;
5136 mvmtDir lastMovementDirection;
5137 void Created(GameObject *obj);
5138 void Timer_Expired(GameObject *obj,
int number);
5139 void Animation_Complete(GameObject *obj,
const char *animation_name);
5140 void PlayAnimation(GameObject *obj,mvmtDir direction,
float startFrame,
float endFrame,
bool looped);
5160 void Created(GameObject *obj);
5161 void Timer_Expired(GameObject *obj,
int number);
5173 void Killed(GameObject *obj,GameObject *killer);
5182 void Created(GameObject *obj);
5194 void Created(GameObject *obj);
5195 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
5219 struct CountdownScreenCharacterNode
5224 char baseModelName[15];
5225 struct CountdownScreenCharacterNode *next;
5226 CountdownScreenCharacterNode(
int id,
int charPos,
const char *baseModelName)
5229 this->charPos = charPos;
5230 this->currentChar =
'\0';
5231 sprintf(this->baseModelName,
"%s",baseModelName);
5235 static int highestCharPos;
5236 static CountdownScreenCharacterNode *countdownScreenCharacterController;
5237 static void AddVisualCountdownNode(
int id,
int charPos,
const char *baseModelName)
5241 Console_Input(
"msg AddVisualCountdownNode::ERROR charPos can be at most 5!");
5244 if (strlen(baseModelName) > 15)
5246 Console_Input(
"msg AddVisualCountdownNode::ERROR baseModelName can be at most 15 characters (remember a number is added to the end)!");
5249 if (highestCharPos < charPos)
5250 highestCharPos = charPos;
5251 CountdownScreenCharacterNode *current = countdownScreenCharacterController;
5252 if (!countdownScreenCharacterController)
5253 countdownScreenCharacterController =
new CountdownScreenCharacterNode(
id,charPos,baseModelName);
5256 if (current->id ==
id)
5258 Console_Input(
"msg AddVisualCountdownNode::ERROR: id has already been added once!");
5263 current->next =
new CountdownScreenCharacterNode(
id,charPos,baseModelName);
5266 current = current->next;
5269 struct SendCustomOnSecondNode
5277 struct SendCustomOnSecondNode *next;
5278 SendCustomOnSecondNode(
int triggerSecond,
int id,
int custom,
int param,
float delay)
5280 this->hasTriggered =
false;
5281 this->triggerSecond = triggerSecond;
5283 this->custom = custom;
5284 this->param = param;
5285 this->delay = delay;
5289 static SendCustomOnSecondNode *sendCustomOnSecondController;
5290 static void AddSecondNode(
int triggerSecond,
int id,
int custom,
int param,
float delay)
5292 SendCustomOnSecondNode *current = sendCustomOnSecondController;
5293 if (!sendCustomOnSecondController)
5294 sendCustomOnSecondController =
new SendCustomOnSecondNode(triggerSecond,
id,custom,param,delay);
5297 if (triggerSecond == current->triggerSecond &&
id == current->id && custom == current->custom && param == current->param)
5299 Console_Input(
"msg ERROR: A custom for this trigger second already exists!");
5304 current->next =
new SendCustomOnSecondNode(triggerSecond,
id,custom,param,delay);
5307 current = current->next;
5310 static bool controllerPlaced;
5314 char warningMessage[220];
5315 char hourSingular[220];
5316 char hourPlural[220];
5317 char minuteSingular[220];
5318 char minutePlural[220];
5319 char secondSingular[220];
5320 char secondPlural[220];
5324 void Created(GameObject *obj);
5325 void Timer_Expired(GameObject *obj,
int number);
5326 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
5327 void Destroyed(GameObject *obj);
5328 void Detach(GameObject *obj);
5329 char *formatReminderString(
const char *format,...);
5331 void NodeSendCustom(GameObject *obj,
int second)
5333 if (!sendCustomOnSecondController)
5335 SendCustomOnSecondNode *current = sendCustomOnSecondController;
5338 if (current->triggerSecond == second && !current->hasTriggered)
5340 current->hasTriggered =
true;
5341 Commands->Send_Custom_Event(obj,Commands->Find_Object(current->id),current->custom,current->param,current->delay);
5343 current = current->next;
5346 void CleanupSecondNodes()
5348 controllerPlaced =
false;
5349 SendCustomOnSecondNode *temp = sendCustomOnSecondController,*die;
5356 sendCustomOnSecondController = NULL;
5357 CountdownScreenCharacterNode *temp2 = countdownScreenCharacterController,*die2;
5360 GameObject *kill = Commands->Find_Object(temp2->id);
5362 Commands->Destroy_Object(kill);
5364 temp2 = temp2->next;
5367 countdownScreenCharacterController = NULL;
5368 highestCharPos = -1;
5370 void UpdateCountdownHudNodes()
5372 if (highestCharPos <= 0)
5375 sprintf(hhmmss,
"%02d%02d%02d",seconds/3600,(seconds%3600)/60,(seconds%3600)%60);
5376 for (
int x = 0;x <= highestCharPos;x++)
5377 for (CountdownScreenCharacterNode *current = countdownScreenCharacterController;current;current = current->next)
5379 if (current->charPos == x && current->currentChar != hhmmss[5-x])
5381 GameObject *
object = Commands->Find_Object(current->id);
5385 sprintf(model,
"%s%c",current->baseModelName,hhmmss[5-x]);
5386 Commands->Set_Model(
object,model);
5404 void Created(GameObject *obj);
5405 void Timer_Expired(GameObject *obj,
int number);
5418 void Entered(GameObject *obj,GameObject *enter);
5430 void Created(GameObject *obj);
5431 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
5446 float lastInjuryRatio;
5447 float screenOpacity;
5448 float lastScreenOpacity;
5449 void Created(GameObject *obj);
5450 void Timer_Expired(GameObject *obj,
int number);
5451 void Damaged(GameObject *obj,GameObject *damager,
float damage);
5452 void ScreenFade(GameObject *obj);
5453 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
5471 Vector3 playerCount;
5472 Vector3 playerCount2;
5473 bool conditionMatching;
5474 void Created(GameObject *obj);
5475 void Timer_Expired(GameObject *obj,
int number);
5476 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
5477 void EnableSpawners(
bool enable);
5486 void Created(GameObject *obj);
5511 char weaponName[256];
5515 void Created(GameObject *obj);
5516 void Timer_Expired(GameObject *obj,
int number);
5517 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
5528 void Created(GameObject *obj);
5529 void Destroyed(GameObject *obj);
5530 void Detach(GameObject *obj);
5532 static bool controllerPlaced;
5533 static int maxFollowers;
5534 static int followingPlayer[128];
5537 controllerPlaced =
true;
5573 GameObject *lastFollow;
5574 GameObject *lastTarget;
5578 int currentFollowTime;
5579 int currentIdleTime;
5581 float followDistance;
5582 float followNearSpeed;
5583 float followFarSpeed;
5584 float followFarDistance;
5585 float followVeryFarSpeed;
5586 float followVeryFarDistance;
5590 float targetDistance;
5594 Vector3 homeLocation;
5595 Vector3 lastLocation;
5597 bool fallbackWithoutArmor;
5598 float healWhileAtHomeLocation;
5605 Vector3 messageColor;
5606 int messagePokeFollowerId;
5607 char messagePokeFollower[220];
5608 int messageFollowingYouId;
5609 int messageFollowingPlayerId;
5610 int messageMaxFollowersId;
5611 char messageMaxFollowers[220];
5612 int messageHealingRequiredId;
5613 int messageFollowerInjuredId;
5614 int messageFollowerKilledId;
5615 int messageFollowerLostId;
5617 void Created(GameObject *obj);
5618 void Enemy_Seen(GameObject *obj,GameObject *seen);
5619 void Timer_Expired(GameObject *obj,
int number);
5620 void Damaged(GameObject *obj,GameObject *damager,
float damage);
5621 void Poked(GameObject *obj, GameObject *poker);
5622 void Action_Complete(GameObject *obj,
int action_id,ActionCompleteReason reason);
5623 void Killed(GameObject *obj, GameObject *killer);
5624 void Destroyed(GameObject *obj);
5625 void Detach(GameObject *obj);
5626 void AttackTarget(GameObject *obj,GameObject *follow,GameObject *target,Vector3 location,
float speed,
float distance);
5627 void GiveUpOnPlayer(GameObject *obj,
bool pokeable);
5628 void ForgetEnemy(GameObject *obj);
5629 void SendCustom(GameObject *obj,
int custom);
5630 char *formatMaxFollowingString(
const char *format,...);
5631 void ShowPlayerMessage(GameObject *player,
int stringId,Vector3 color);
5652 void Created(GameObject *obj);
5653 void Timer_Expired(GameObject *obj,
int number);
5669 void Entered(GameObject *obj,GameObject *enterer);
5691 float damageDistance;
5692 float vehicleWarnDistance;
5693 float vehicleDamageDistance;
5694 float aircraftWarnDistance;
5695 float aircraftDamageDistance;
5696 float maxSurviveDistance;
5697 Vector3 errorMessageColor;
5698 Vector3 screenFadeColor;
5700 bool screenEffectOn[128];
5701 int leavingFieldStringId;
5702 char damageWarhead[128];
5703 char instantKillWarhead[128];
5704 void Created(GameObject *obj);
5705 void Timer_Expired(GameObject *obj,
int number);
5721 char presetName[128];
5724 void Created(GameObject *obj);
5725 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
5726 void Timer_Expired(GameObject *obj,
int number);
5753 void Created(GameObject *obj);
5754 void Timer_Expired(GameObject *obj,
int number);
5764 int originalPlayerType;
5765 void Created(GameObject *obj);
5766 void Timer_Expired(GameObject *obj,
int number);
5787 void Created(GameObject *obj);
5788 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
5789 void Timer_Expired(GameObject *obj,
int number);
5805 void Created(GameObject *obj);
5806 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
5828 void Created(GameObject *obj);
5829 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
5842 void Killed(GameObject *obj,GameObject *killer);
5851 void Created(GameObject *obj);
5860 void Created(GameObject *obj);
5874 void Killed(GameObject *obj,GameObject *killer);
5883 void Created(GameObject *obj);
5903 Vector3 hudStringColor;
5904 char hudMessage[220];
5908 void Created(GameObject *obj);
5909 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
5910 char *formatHUDMessage(
const char *format,...);
5931 void Entered(GameObject *obj,GameObject *enterer);
5943 char weaponName[128];
5944 void Created(GameObject *obj);
5945 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
5957 char presetName[128];
5958 void Created(GameObject *obj);
5959 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
5978 float damageThreshold;
5980 float timeRemaining;
5981 void Created(GameObject *obj);
5982 void Timer_Expired(GameObject *obj,
int number);
5983 void Damaged(GameObject *obj,GameObject *damager,
float damage);
6000 void Created(GameObject *obj);
6001 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6014 void Destroyed(GameObject *obj);
6027 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6040 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6052 void Created(GameObject *obj);
6053 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6064 void Created(GameObject *obj);
6065 void Timer_Expired(GameObject *obj,
int number);
6085 float arriveDistance;
6086 float arriveDistanceSq;
6089 int EnemyTimeOutTime;
6092 int stealthModeOverride;
6093 void Created(GameObject *obj);
6094 void Timer_Expired(GameObject *obj,
int number);
6095 void Enemy_Seen(GameObject *obj,GameObject *seen);
6096 void Damaged(GameObject *obj,GameObject *damager,
float damage);
6097 void Goto_Location(GameObject *obj);
6098 bool Get_A_Defense_Point(Vector3 *position);
6113 char presetName[128];
6117 void Created(GameObject *obj);
6118 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6128 void Created(GameObject *obj);
6145 void Created(GameObject *obj);
6146 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6161 void Created(GameObject *obj);
6162 void Timer_Expired(GameObject *obj,
int number);
6183 struct BriefingTextNode
6187 BriefingTextNode *next;
6188 BriefingTextNode(
const char *text)
6191 sprintf(Text,
"%s",text);
6194 BriefingTextNode(
const char *text,
float delay)
6197 sprintf(Text,
"%s",text);
6205 BriefingTextNode *BriefingText;
6206 BriefingTextNode *CurrentNode;
6208 void Created(GameObject *obj);
6209 void Timer_Expired(GameObject *obj,
int number);
6210 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6211 void Destroyed(GameObject *obj);
6212 void AddNewTextNode();
6213 void RemoveTextNodes();
6223 void Killed(GameObject *obj,GameObject *killer);
6244 void Created(GameObject *obj);
6245 void Timer_Expired(GameObject *obj,
int number);
6246 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6259 void Created(GameObject *obj);
6260 void Entered(GameObject *obj,GameObject *enterer);
6281 void Created(GameObject *obj);
6282 void Timer_Expired(GameObject *obj,
int number);
6283 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6308 void Created(GameObject *obj);
6309 void Timer_Expired(GameObject *obj,
int number);
6310 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6323 void Destroyed(GameObject *obj);
6333 bool attemptingCollidable;
6335 Collision_Group_Type myCollisionGroup;
6336 void Created(GameObject *obj);
6337 void Timer_Expired(GameObject *obj,
int number);
6338 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6350 char scriptName[256];
6352 void Created(GameObject *obj);
6353 void Timer_Expired(GameObject *obj,
int number);
6366 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6382 char setWeapon[128];
6385 int setBackpackBullets;
6386 bool triggerOnDamage;
6388 void Created(GameObject *obj);
6389 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6390 void Damaged(GameObject *obj,GameObject *damager,
float damage);
6391 void UpdateBullets(GameObject *obj);
6408 void Created(GameObject *obj);
6409 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6421 void Killed(GameObject *obj,GameObject *killer);
6446 void Created(GameObject *obj);
6447 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6448 void Timer_Expired(GameObject *obj,
int number);
6473 void Created(GameObject *obj);
6474 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6475 void Timer_Expired(GameObject *obj,
int number);
6496 enum SpecialCondition{DOES_NOT_MATTER,HORIZANTAL_IS_GREATER,VERTICAL_IS_GREATER,DOES_NOT_MEET_CONDITION};
6497 Vector3 velocityFBL;
6498 Vector3 velocityRUD;
6506 SpecialCondition onlyTriggerOn;
6507 Vector3 onlyTriggerOnMinHV;
6508 Vector3 onlyTriggerOnMaxHV;
6509 void Created(GameObject *obj);
6510 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6511 void Timer_Expired(GameObject *obj,
int number);
6512 void SendCustom(GameObject *obj,
int paramOverride);
6513 Vector3 SquareVectorSpecial(Vector3 in);
6514 bool OnlyTriggerOnTest(
float horizontalSpeed,
float verticalSpeed);
6530 void Created(GameObject *obj);
6531 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6547 void Created(GameObject *obj);
6548 void Entered(GameObject *obj,GameObject *enterer);
6549 void Exited(GameObject *obj,GameObject *exiter);
6566 void Created(GameObject *obj);
6567 void Timer_Expired(GameObject *obj,
int number);
6588 void Created(GameObject *obj);
6589 void Exited(GameObject *obj,GameObject *exiter);
6603 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6617 char explosion[256];
6622 void Created(GameObject *obj);
6623 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6645 time_t lastTriggerTime;
6649 void Created(GameObject *obj);
6650 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6677 void Created(GameObject *obj);
6678 void Damaged(GameObject *obj,GameObject *damager,
float damage);
6679 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6706 void Created(GameObject *obj);
6707 void Timer_Expired(GameObject *obj,
int number);
6723 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6732 void Created(GameObject *obj);
6733 void Destroyed(GameObject *obj);
6734 void Detach(GameObject *obj);
6739 StringNode(
const char *preset)
6741 sprintf(this->preset,
"%s",preset);
6744 static bool controllerPlaced;
6745 static char playerWeapons[128][256];
6746 static char playerNames[128][256];
6747 static SList<StringNode> ignoredWeapons;
6750 ignoredWeapons.Remove_All();
6763 void Created(GameObject *obj);
6764 void Timer_Expired(GameObject *obj,
int number);
6765 void Destroyed(GameObject *obj);
6766 void InitialSetup(GameObject *obj);
6767 void GrantPlayersWeapon(GameObject *obj);
6785 void Created(GameObject *obj);
6804 void Created(GameObject *obj);
6805 void Timer_Expired(GameObject *obj,
int number);
6806 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6828 Vector3 soldierVehicleOther;
6829 void Created(GameObject *obj);
6830 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6855 void Created(GameObject *obj);
6856 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6868 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6878 void Entered(GameObject *obj,GameObject *enterer);
6879 char *formatReminderString(
const char *format,...);
6890 void Killed(GameObject *obj,GameObject *killer);
6902 void Created(GameObject *obj);
6914 bool isTurning[128];
6916 bool isMovingTarget[128];
6917 Vector3 lastTargetPos[128];
6921 void Created(GameObject *obj);
6922 void Timer_Expired(GameObject *obj,
int number);
6923 void Destroyed(GameObject *obj);
6924 void Detach(GameObject *obj);
6926 static bool controllerPlaced;
6927 static bool isAFK[128];
6930 controllerPlaced =
false;
6950 void Created(GameObject *obj);
6951 void Timer_Expired(GameObject *obj,
int number);
6952 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
6962 void Killed(GameObject *obj,GameObject *killer);
6972 void Damaged(GameObject *obj,GameObject *damager,
float damage);
7011 struct SpawnObjectNode
7014 ReferencerClass obj;
7015 SpawnObjectNode(GameObject *obj,
int spawnGroupId)
7018 this->groupId = spawnGroupId;
7021 static SList<SpawnObjectNode> spawnObjectNodeList;
7024 float minDistanceBetweenObjects;
7026 int spawnedObjectScriptID;
7028 enum SpawnFailureTypes{SPAWN_BLOCKED, SUCCESS, LIMIT_REACHED, SPAWN_CODE_ERROR};
7029 Vector3 spawnLocation;
7031 int maxTotalSpawned;
7041 bool collisionCheck;
7043 float initialSpawnHeight;
7044 int changeSpawnCapCustom;
7045 bool pointMustBeInPathfind;
7047 bool ignoreRayCastFailure;
7048 Vector3 faceLocation;
7049 float faceDirection;
7050 int enableDisableCustom;
7052 Vector3 raycastRange;
7053 int attachScriptsGroupId;
7054 float playersAddToSpawnAtATime;
7055 int lastPlayerCount;
7056 void Created(GameObject *obj);
7057 void Timer_Expired(GameObject *obj,
int number);
7058 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
7059 SpawnFailureTypes AttemptSpawn(GameObject *obj);
7060 bool CheckIfObjectIsNearAnotherObject(Vector3 pos);
7061 void SetFacing(GameObject *obj,
float facing);
7062 void Initial_Spawn(GameObject *obj);
7063 int GetPlayerLimitModifier();
7064 JMG_Utility_Basic_Spawner_In_Radius::SpawnFailureTypes TryPlacement(GameObject *spawned,Vector3 bottomRay);
7077 bool sentCreateMessage;
7078 bool sentDeathMessage;
7079 void Created(GameObject *obj);
7080 void Destroyed(GameObject *obj);
7081 void AddSpawnedObjectToGroup(GameObject *spawned);
7085 sentCreateMessage =
false;
7086 sentDeathMessage =
false;
7101 bool subtractMinSpeed;
7102 char explosionPreset[128];
7103 char collisionSound[128];
7105 float minCollisionSpeed;
7106 float maxCollisionSpeed;
7107 void Created(GameObject *obj);
7108 void Timer_Expired(GameObject *obj,
int number);
7134 int notVisibleMessage;
7136 int notVisibleParam;
7138 bool repeatSendSeenCustom;
7139 Vector3 carTankBike;
7140 Vector3 flyingTurretBoat;
7141 Vector3 submarineInfantryUnused;
7142 void Created(GameObject *obj);
7143 void Timer_Expired(GameObject *obj,
int number);
7144 void Enemy_Seen(GameObject *obj,GameObject *seen);
7145 float GetPriority(GameObject *seen);
7146 void SendCustom(GameObject *obj,
int custom,
int param);
7163 void Created(GameObject *obj);
7164 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
7181 void Created(GameObject *obj);
7182 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
7191 void Destroyed(GameObject *obj);
7192 void Detach(GameObject *obj);
7205 void Created(GameObject *obj);
7206 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
7233 void Created(GameObject *obj);
7234 void Timer_Expired(GameObject *obj,
int number);
7250 void Created(GameObject *obj);
7251 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
7270 ReferencerClass lastSender;
7276 void Created(GameObject *obj);
7277 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
7278 void Timer_Expired(GameObject *obj,
int number);
7292 int lastPlayerCount;
7294 float originalHealth;
7295 float originalArmor;
7296 float healthMultiplier;
7297 float armorMultiplier;
7298 int updateScaleCustom;
7300 void Created(GameObject *obj);
7301 void Timer_Expired(GameObject *obj,
int number);
7302 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
7303 void RescaleHP(GameObject *obj);
7324 void Created(GameObject *obj);
7325 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
7334 void Created(GameObject *obj);
7355 int notVisibleMessage;
7357 int notVisibleParam;
7360 void Created(GameObject *obj);
7361 void Timer_Expired(GameObject *obj,
int number);
7362 bool Test_Line_Of_Sight(GameObject *obj,GameObject *seen);
7371 void Created(GameObject *obj);
7382 void Created(GameObject *obj);
7383 void Timer_Expired(GameObject *obj,
int number);
7396 bool retryOnFailure;
7398 float safeTeleportDistance;
7399 int wanderPointGroup;
7400 void Created(GameObject *obj);
7401 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
7402 bool Get_A_Defense_Point(Vector3 *position,
float *facing);
7403 bool Grab_Teleport_Spot(GameObject *enter,
int attempts);
7426 void Created(GameObject *obj);
7427 void Timer_Expired(GameObject *obj,
int number);
7450 class HerdAnimalPositionSystem
7454 struct HerdPositionNode
7459 struct HerdPositionNode *next;
7460 HerdPositionNode(GameObject *obj)
7462 this->
id = Commands->Get_ID(obj);
7463 this->pos = Commands->Get_Position(obj);
7468 Vector3 herdRetreatLocation;
7469 float herdRetreatTime;
7470 time_t herdRetreatStart;
7473 time_t lastPosCalcTime;
7474 float minUpdateDelay;
7475 bool hascalculatedPos;
7476 HerdPositionNode *HerdPositionNodeList;
7478 HerdAnimalPositionSystem()
7480 herdRetreatLocation = Vector3(0.0f,0.0f,0.0f);
7481 herdRetreatTime = 0.0f;
7482 herdRetreatStart = clock();
7483 minUpdateDelay = 10000.0f;
7484 hascalculatedPos =
false;
7486 centerPos = Vector3(0.0f,0.0f,0.0f);
7487 lastPosCalcTime = clock();
7488 HerdPositionNodeList = NULL;
7490 HerdPositionNode *AddNode(GameObject *obj)
7492 int id = Commands->Get_ID(obj);
7493 HerdPositionNode *Current = HerdPositionNodeList;
7496 if (Current->id ==
id)
7501 Current = Current->next;
7504 if (!HerdPositionNodeList)
7505 return (HerdPositionNodeList =
new HerdPositionNode(obj));
7506 Current = HerdPositionNodeList;
7509 if (!Current->alive)
7511 Current->id = Commands->Get_ID(obj);
7512 Current->pos = Commands->Get_Position(obj);
7513 Current->alive =
true;
7518 Current->next =
new HerdPositionNode(obj);
7519 return Current->next;
7521 Current = Current->next;
7525 HerdAnimalPositionSystem &operator -= (GameObject *obj)
7527 int id = Commands->Get_ID(obj);
7528 HerdPositionNode *Current = HerdPositionNodeList;
7531 if (Current->id ==
id)
7534 Current->alive =
false;
7537 Current = Current->next;
7541 Vector3 getCenterLocation(
bool allowWander,
int wanderPointGroup,
float minUpdateHerdCenter,
float maxUpdateHerdCenter);
7542 bool checkRetreatSuccessful()
7544 HerdPositionNode *Current = HerdPositionNodeList;
7545 int retreatedCount = 0;
7548 if (Current->alive && JmgUtility::SimpleDistance(Current->pos,herdRetreatLocation) < 2500)
7550 Current = Current->next;
7552 if (animalCount == retreatedCount)
7556 bool checkRetreatCloseEnough()
7558 HerdPositionNode *Current = HerdPositionNodeList;
7559 int retreatedCount = 0;
7562 if (Current->alive && JmgUtility::SimpleDistance(Current->pos,herdRetreatLocation) < 2500)
7564 Current = Current->next;
7566 if (animalCount*0.75 <= retreatedCount)
7572 HerdPositionNode *temp = HerdPositionNodeList,*die;
7579 HerdPositionNodeList = NULL;
7582 static HerdAnimalPositionSystem HerdAnimalPositionControl[128];
7585 HerdAnimalPositionSystem::HerdPositionNode *HerdPositionNode;
7586 int wanderPointGroup;
7587 char defaultWeapon[128];
7589 float minRetreatRange;
7590 float maxRetreatRange;
7591 float minRetreatTime;
7592 float maxRetreatTime;
7593 float minUpdateHerdCenter;
7594 float maxUpdateHerdCenter;
7595 float wanderRadiusAroundHerdCenter;
7596 float wanderRadiusAroundHerdCenterSq;
7597 float minWanderFrequency;
7598 float maxWanderFrequency;
7599 float runTowardThreatChance;
7600 float actionCrouched;
7601 void Created(GameObject *obj);
7602 void Enemy_Seen(GameObject *obj,GameObject *seen);
7603 void Timer_Expired(GameObject *obj,
int number);
7604 void Damaged(GameObject *obj,GameObject *damager,
float damage);
7605 void Destroyed(GameObject *obj);
7606 void GotoLocation(GameObject *obj,
const Vector3 &pos,GameObject *Enemy,
float speed = 0);
7607 void setRetreatLocation(GameObject *obj,GameObject *enemy);
7612 HerdPositionNode = NULL;
7614 static bool Get_A_Wander_Point(Vector3 *position,
int wanderPointGroup);
7622 void Created(GameObject *obj);
7634 for (
int x = 0;x < 128;x++)
7635 JMG_Utility_AI_Skittish_Herd_Animal::HerdAnimalPositionControl[x] = JMG_Utility_AI_Skittish_Herd_Animal::HerdAnimalPositionSystem();
7637 void Destroyed(GameObject *obj);
7638 void Detach(GameObject *obj);
7652 void Created(GameObject *obj);
7653 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
7678 void Created(GameObject *obj);
7679 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
7704 void Created(GameObject *obj);
7705 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
7720 void Created(GameObject *obj);
7721 void Poked(GameObject *obj, GameObject *poker);
7739 int lastPlayerCount;
7743 float scoreMultiplier;
7744 int updateScaleCustom;
7749 int stopUpdateCustom;
7750 void Created(GameObject *obj);
7751 void Timer_Expired(GameObject *obj,
int number);
7752 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
7753 void RescaleScore(GameObject *obj);
7766 void Created(GameObject *obj);
7767 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
7780 void Created(GameObject *obj);
7781 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
7794 void Created(GameObject *obj);
7795 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
7808 void Created(GameObject *obj);
7809 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
7821 char weaponName[128];
7822 unsigned int weaponId;
7828 WeaponNode(
const char *weaponName,
unsigned int weaponId,
float sortOrder,
int holdStyle,
float speed,WeaponNode *prev,WeaponNode *next)
7830 sprintf(this->weaponName,
"%s",weaponName);
7831 this->weaponId = weaponId;
7832 this->sortOrder = sortOrder;
7833 this->holdStyle = holdStyle;
7834 this->speed = speed;
7839 static WeaponNode *weaponNodeGroups[128];
7840 static WeaponNode *weaponNodeGroupsEnd[128];
7841 static WeaponNode *addNode(
int groupId,
const char *weaponName,
unsigned int weaponId,
float sortOrder,
int holdStyle,
float speed)
7843 if (!weaponNodeGroups[groupId])
7844 return weaponNodeGroups[groupId] = weaponNodeGroupsEnd[groupId] =
new WeaponNode(weaponName,weaponId,sortOrder,holdStyle,speed,NULL,NULL);
7845 if (sortOrder < weaponNodeGroups[groupId]->sortOrder)
7846 return weaponNodeGroups[groupId] = weaponNodeGroups[groupId]->prev =
new WeaponNode(weaponName,weaponId,sortOrder,holdStyle,speed,NULL,weaponNodeGroups[groupId]);
7847 WeaponNode *current = weaponNodeGroups[groupId],*prev = NULL;
7850 if (current->weaponId == weaponId)
7852 current->holdStyle = holdStyle;
7853 current->sortOrder = sortOrder;
7854 current->speed = speed;
7857 if (prev && prev->sortOrder <= sortOrder && current->sortOrder > sortOrder)
7858 return prev->next = current->prev =
new WeaponNode(weaponName,weaponId,sortOrder,holdStyle,speed,prev,current);
7860 return current->next = weaponNodeGroupsEnd[groupId] =
new WeaponNode(weaponName,weaponId,sortOrder,holdStyle,speed,current,NULL);
7862 current = current->next;
7866 static WeaponNode *getNode(
int groupId,
const char *weaponName)
7868 WeaponNode *current = weaponNodeGroups[groupId];
7871 if (!_stricmp(weaponName,current->weaponName))
7873 current = current->next;
7877 static WeaponNode *getWeapon(
int groupId,
unsigned int weaponId)
7879 WeaponNode *current = weaponNodeGroups[groupId];
7882 if (weaponId == current->weaponId)
7884 current = current->next;
7888 static WeaponNode *getNext(GameObject *obj,
int groupId,WeaponNode *current)
7891 current = current->next;
7893 current = weaponNodeGroups[groupId];
7894 for (
int x = 0;x < 2;x++)
7898 if (Has_Weapon(obj,current->weaponName))
7900 current = current->next;
7902 current = weaponNodeGroups[groupId];
7906 static WeaponNode *getPrev(GameObject *obj,
int groupId,WeaponNode *current)
7909 current = current->prev;
7911 current = weaponNodeGroupsEnd[groupId];
7912 for (
int x = 0;x < 2;x++)
7916 if (Has_Weapon(obj,current->weaponName))
7918 current = current->prev;
7920 current = weaponNodeGroupsEnd[groupId];
7924 static void Empty_List()
7926 for (
int x = 0;x < 128;x++)
7928 WeaponNode *temp = weaponNodeGroups[x],*die;
7929 weaponNodeGroups[x] = NULL;
7930 weaponNodeGroupsEnd[x] = NULL;
7940 void Destroyed(GameObject *obj);
7941 void Detach(GameObject *obj);
7947 for (
int x = 0;x < 128;x++)
7948 weaponNodeGroups[x] = NULL;
7984 int heartBeatSoundId;
7986 char enterWeapon[256];
7988 bool startedFadeRed;
7992 int lastWaterZoneId;
7993 time_t lastDisplayTime;
7995 int waterDamageDelayTime;
7996 int waterDamageDelayTimeRecover;
7997 int remainingWaterDamageDelay;
7998 char originalSkin[128];
7999 char originalArmor[128];
8000 char originalModel[128];
8002 unsigned int currentWeaponId;
8003 int defaultHoldStyle;
8004 float defaultSwimSpeedMultiplier;
8005 float waterSpeedMultiplier;
8006 char defaultWeaponPreset[128];
8007 float defaultDrownTime;
8008 float startDrownSequence;
8009 float waterDamageAmount;
8010 char waterDamageWarhead[128];
8011 float drownDamageRate;
8012 char swimmingSkin[128];
8013 char swimmingArmor[128];
8014 char swimmingModel[128];
8015 float swimmingHeightScale;
8016 float swimmingWidthScale;
8017 float originalHeightScale;
8018 float originalWidthScale;
8019 int enterWaterMessageStringId;
8020 Vector3 waterEnterMessageColorRGB;
8021 char heartBeatSoundEmitterModel[16];
8022 char pantingSoundEmitterModel[16];
8023 char gaspForBreath[128];
8024 float catchBreathRate;
8025 bool forceDefinedWeapons;
8026 int weaponSwitchForward;
8027 JMG_Utility_Swimming_Infantry_Advanced_Controller::WeaponNode *currentWeapon;
8028 void Created(GameObject *obj);
8029 void Timer_Expired(GameObject *obj,
int number);
8030 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
8031 void Killed(GameObject *obj,GameObject *killer);
8032 void Destroyed(GameObject *obj);
8033 void Detach(GameObject *obj);
8034 void CreateSoundEmitter(GameObject *obj,
const char *model,
int *soundId);
8035 void DestroySoundEmitter(
int *soundId);
8036 void HideSoundEmitter(
int *soundId);
8037 void SwitchWeapon(GameObject *obj);
8038 void UpdateWeaponSwimming(GameObject *obj,
const WeaponDefinitionClass *weaponDef);
8039 void GetWeaponId(
const WeaponDefinitionClass *weaponDef);
8040 int GetWeaponPosition(GameObject *obj,
int weaponId);
8045 currentWeaponId = 0;
8046 currentWeapon = NULL;
8061 void Created(GameObject *obj);
8062 void Timer_Expired(GameObject *obj,
int number);
8076 void Created(GameObject *obj);
8077 void Timer_Expired(GameObject *obj,
int number);
8128 void Created(GameObject *obj);
8129 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
8142 void Killed(GameObject *obj,GameObject *killer);
8159 enum FireWeaponReturn{NONE,INFANTRY_FIRE,VEHICLE_FIRE};
8160 bool infiniteBullets;
8161 char weaponName[256];
8163 int GetWeaponBullets(GameObject *obj)
8165 return infiniteBullets ? Get_Current_Bullets(obj) : Get_Current_Total_Bullets(obj);
8167 WeaponNode(GameObject *obj)
8169 sprintf(weaponName,
"%s",Get_Current_Weapon(obj));
8170 infiniteBullets = Get_Current_Total_Bullets(obj) == -1 ? true :
false;
8171 totalBullets = GetWeaponBullets(obj);
8175 sprintf(weaponName,
"");
8176 infiniteBullets =
false;
8184 WeaponNode currentWeapon;
8185 WeaponNode vehicleWeapon;
8186 void Created(GameObject *obj);
8187 void Timer_Expired(GameObject *obj,
int number);
8188 WeaponNode::FireWeaponReturn FiredWeapon(GameObject *obj);
8208 enum sBool{sNULL=-1,sFALSE,sTRUE};
8210 sBool teamHoldingZone;
8220 bool sendCustomEveryTick;
8221 void Created(GameObject *obj);
8222 void Timer_Expired(GameObject *obj,
int number);
8223 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
8243 enum sBool{sNULL=-1,sFALSE,sTRUE};
8255 bool sendCustomEveryTick;
8256 void Created(GameObject *obj);
8257 void Timer_Expired(GameObject *obj,
int number);
8258 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
8272 void Created(GameObject *obj);
8273 void Timer_Expired(GameObject *obj,
int number);
8299 bool onceMatchedContinue;
8300 void Created(GameObject *obj);
8301 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
8321 enum sBool{sNULL=-1,sFALSE,sTRUE};
8333 bool sendCustomEveryTick;
8334 void Created(GameObject *obj);
8335 void Timer_Expired(GameObject *obj,
int number);
8336 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
8345 void Created(GameObject *obj);
8354 void Created(GameObject *obj);
8363 void Created(GameObject *obj);
8385 void Created(GameObject *obj);
8386 void Timer_Expired(GameObject *obj,
int number);
8406 int userSetResetTime;
8407 Vector3 carTankBike;
8408 Vector3 flyingTurretBoat;
8409 Vector3 submarineInfantryUnused;
8410 void Created(GameObject *obj);
8411 void Enemy_Seen(GameObject *obj,GameObject *seen);
8412 void Timer_Expired(GameObject *obj,
int number);
8413 void Damaged(GameObject *obj,GameObject *damager,
float damage);
8414 float GetPriority(GameObject *seen);
8415 void AttackTarget(GameObject *obj,
int seenId,GameObject *seen);
8429 int catchCustom[10];
8436 bool supressingSpam;
8437 bool sendDuplicates;
8439 void Created(GameObject *obj);
8440 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
8441 void Timer_Expired(GameObject *obj,
int number);
8442 bool SendCustom(GameObject *obj);
8470 void Created(GameObject *obj);
8471 void Timer_Expired(GameObject *obj,
int number);
8491 struct BriefingTextNode
8495 BriefingTextNode *prev;
8496 BriefingTextNode *next;
8497 BriefingTextNode(
const char *text)
8500 sprintf(Text,
"%s",text);
8504 BriefingTextNode(
const char *text,
float delay)
8507 sprintf(Text,
"%s",text);
8517 BriefingTextNode *BriefingText;
8518 BriefingTextNode *lastNode;
8519 void Created(GameObject *obj);
8520 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
8521 void Destroyed(GameObject *obj);
8522 void AddNewTextNode();
8523 void RemoveTextNodes();
8536 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
8557 void Created(GameObject *obj);
8558 void Entered(GameObject *obj,GameObject *enterer);
8590 float minDistanceSquared;
8591 float lowAngleMaxDistance;
8592 bool useLowAngleWhenAboveMinDistance;
8593 float useLowAngleTargetAboveHeight;
8597 float velocitySquared;
8598 char fireSound[128];
8599 char vehicleProjectilePreset[128];
8600 char muzzleFlashExplosion[128];
8601 char projectileExplosion[128];
8602 char reloadSound[128];
8607 int currentClipCount;
8608 float missAmountPerMeter;
8609 float baseMissAmount;
8611 bool reloadComplete;
8617 float projectedShotsChance;
8619 void Created(GameObject *obj);
8620 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
8621 void Timer_Expired(GameObject *obj,
int number);
8622 bool CalculateAngle(
double *returnAngle,
double distance,
double height,
bool highAngle);
8623 void FireProjectile(GameObject *obj,
double zAngle,
double aimAngle);
8644 void Created(GameObject *obj);
8645 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
8664 void Created(GameObject *obj);
8665 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
8684 void Created(GameObject *obj);
8685 void Timer_Expired(GameObject *obj,
int number);
8700 char attachedModel[16];
8701 char attachedAnimation[32];
8702 char presetName[128];
8707 void Created(GameObject *obj);
8708 void Entered(GameObject *obj,GameObject *enterer);
8719 void Created(GameObject *obj);
8720 void Animation_Complete(GameObject *obj,
const char *anim);
8721 void Destroyed(GameObject *obj);
8735 void Created(GameObject *obj);
8736 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
8752 void Created(GameObject *obj);
8753 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
8769 void Created(GameObject *obj);
8770 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
8791 void Created(GameObject *obj);
8792 void Timer_Expired(GameObject *obj,
int number);
8795class DynamicAttachScript
8798 class DynamicAttachScriptParams
8801 struct DynamicAttachScriptParamNode
8805 struct DynamicAttachScriptParamNode *next;
8806 DynamicAttachScriptParamNode(
int index,
const char *param)
8808 this->index = index;
8809 sprintf(this->param,
"%s",param);
8814 DynamicAttachScriptParamNode *DynamicAttachScriptParamNodeList;
8817 DynamicAttachScriptParams()
8820 DynamicAttachScriptParamNodeList = NULL;
8822 DynamicAttachScriptParamNode *AddOrUpdateParam(
int index,
const char *param)
8824 DynamicAttachScriptParamNode *current = DynamicAttachScriptParamNodeList;
8825 if (!DynamicAttachScriptParamNodeList)
8828 return (DynamicAttachScriptParamNodeList =
new DynamicAttachScriptParamNode(index,param));
8832 if (current->index == index)
8834 sprintf(current->param,
"%s",param);
8840 return (current->next =
new DynamicAttachScriptParamNode(index,param));
8842 current = current->next;
8846 DynamicAttachScriptParamNode *FindParam(
int index)
8848 DynamicAttachScriptParamNode *current = DynamicAttachScriptParamNodeList;
8851 if (current->index == index)
8853 current = current->next;
8860 DynamicAttachScriptParamNode *temp = DynamicAttachScriptParamNodeList,*die;
8867 DynamicAttachScriptParamNodeList = NULL;
8870 struct DynamicAttachScriptNode
8873 char scriptName[512];
8874 DynamicAttachScriptParams dynamicAttachScriptParams;
8875 struct DynamicAttachScriptNode *next;
8876 DynamicAttachScriptNode(
int scriptId,
const char *scriptName)
8878 this->scriptId = scriptId;
8879 sprintf(this->scriptName,
"%s",scriptName);
8884 DynamicAttachScriptNode *DynamicAttachScriptNodeList;
8886 DynamicAttachScript()
8888 DynamicAttachScriptNodeList = NULL;
8890 DynamicAttachScriptNode *AddDynamicScript(
int scriptId,
const char *scriptName)
8892 DynamicAttachScriptNode *current = DynamicAttachScriptNodeList;
8893 if (!DynamicAttachScriptNodeList)
8895 DynamicAttachScriptNodeList =
new DynamicAttachScriptNode(scriptId,scriptName);
8896 return DynamicAttachScriptNodeList;
8900 if (current->scriptId == scriptId)
8903 sprintf(errorMsg,
"msg JMG_Utility_Dynamic_Script_Add_Parameter ERROR: ScriptID %d already exists!",scriptId);
8904 Console_Input(errorMsg);
8909 current->next =
new DynamicAttachScriptNode(scriptId,scriptName);
8910 return current->next;
8912 current = current->next;
8916 DynamicAttachScriptNode *FindDynamicScript(
int scriptId)
8918 DynamicAttachScriptNode *current = DynamicAttachScriptNodeList;
8921 if (current->scriptId == scriptId)
8923 current = current->next;
8926 sprintf(errorMsg,
"msg JMG_Utility_Dynamic_Script_Add_Parameter ERROR: ScriptID %d doesn't exist!",scriptId);
8927 Console_Input(errorMsg);
8930 void AddParamToScript(
int scriptId,
int index,
const char *param)
8932 DynamicAttachScriptNode *current = DynamicAttachScriptNodeList;
8935 if (current->scriptId == scriptId)
8937 current->dynamicAttachScriptParams.AddOrUpdateParam(index,param);
8942 sprintf(errorMsg,
"msg JMG_Utility_Dynamic_Script_Add_Parameter ERROR: ScriptID %d doesn't exist!",scriptId);
8943 Console_Input(errorMsg);
8947 DynamicAttachScriptNode *temp = DynamicAttachScriptNodeList,*die;
8952 die->dynamicAttachScriptParams.EmptyList();
8955 DynamicAttachScriptNodeList = NULL;
8965 void Destroyed(GameObject *obj);
8967 static DynamicAttachScript dynamicAttachScript;
8978 void Created(GameObject *obj);
8991 void Created(GameObject *obj);
8992 void Timer_Expired(GameObject *obj,
int number);
9007 void Created(GameObject *obj);
9008 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
9020 void Created(GameObject *obj);
9021 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
9042 void Created(GameObject *obj);
9043 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
9066 void Created(GameObject *obj);
9067 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
9088 void Created(GameObject *obj);
9089 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
9103 int objectiveId[10];
9108 void Created(GameObject *obj);
9109 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
9132 void Created(GameObject *obj);
9133 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
9136class GlobalKeycardSystem
9139 struct GlobalKeycardNode
9143 struct GlobalKeycardNode *next;
9144 GlobalKeycardNode(
int keycardId,
int groupId)
9146 this->keycardId = keycardId;
9147 this->groupId = groupId;
9151 GlobalKeycardNode *globalKeycardNodeList;
9152 void AddKeycardToPlayerObjects(
int keycardId,
int groupId);
9153 void RemoveKeycardFromPlayerObjects(
int keycardId,
int groupId);
9155 GlobalKeycardSystem()
9157 globalKeycardNodeList = NULL;
9159 GlobalKeycardNode *AddKeycard(
int keycardId,
int groupId)
9161 GlobalKeycardNode *current = globalKeycardNodeList;
9162 if (!globalKeycardNodeList)
9164 AddKeycardToPlayerObjects(keycardId,groupId);
9165 return (globalKeycardNodeList =
new GlobalKeycardNode(keycardId,groupId));
9169 if (current->keycardId == keycardId && current->groupId == groupId)
9171 if (!current->keycardId)
9173 AddKeycardToPlayerObjects(keycardId,groupId);
9174 current->keycardId = keycardId;
9179 AddKeycardToPlayerObjects(keycardId,groupId);
9180 current->next =
new GlobalKeycardNode(keycardId,groupId);
9183 current = current->next;
9187 void RemoveKeycard(
int keycardId,
int groupId)
9189 if (!globalKeycardNodeList)
9191 GlobalKeycardNode *current = globalKeycardNodeList;
9194 if (current->keycardId == keycardId && current->groupId == groupId)
9196 RemoveKeycardFromPlayerObjects(keycardId,groupId);
9197 current->keycardId = 0;
9200 current = current->next;
9205 GlobalKeycardNode *temp = globalKeycardNodeList,*die;
9208 RemoveKeycardFromPlayerObjects(temp->keycardId,temp->groupId);
9213 globalKeycardNodeList = NULL;
9215 void GrantKeycards(GameObject *obj,
int groupId)
9217 GlobalKeycardNode *current = globalKeycardNodeList;
9220 if (current->keycardId && current->groupId == groupId)
9221 Commands->Grant_Key(obj,current->keycardId,
true);
9222 current = current->next;
9233 void Destroyed(GameObject *obj);
9244 void Created(GameObject *obj);
9257 void Created(GameObject *obj);
9258 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
9271 void Created(GameObject *obj);
9272 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
9282 void Created(GameObject *obj);
9304 float occupiedDelay;
9311 void Created(GameObject *obj);
9312 void Entered(GameObject *obj,GameObject *enterer);
9316 for (
int x = 0;x < 128;x++)
9320 void Exited(GameObject *obj,GameObject *exiter);
9329 void Destroyed(GameObject *obj);
9339 struct SendCustomOnSecondNode
9346 struct SendCustomOnSecondNode *next;
9347 SendCustomOnSecondNode(
int triggerSecond,
int id,
int custom,
int param,
float delay)
9349 this->triggerSecond = triggerSecond;
9351 this->custom = custom;
9352 this->param = param;
9353 this->delay = delay;
9357 struct SendCustomIdNode
9360 struct SendCustomOnSecondNode *nodes;
9361 struct SendCustomIdNode *next;
9362 SendCustomIdNode(
int countdownId)
9364 this->countdownId = countdownId;
9370 SendCustomOnSecondNode *temp = nodes,*die;
9380 static SendCustomIdNode *sendCustomIdNodeList;
9381 static SendCustomIdNode *FindOrCreateCountdownId(
int countdownId)
9383 SendCustomIdNode *current = sendCustomIdNodeList;
9384 if (!sendCustomIdNodeList)
9385 return (sendCustomIdNodeList =
new SendCustomIdNode(countdownId));
9388 if (current->countdownId == countdownId)
9391 return (current->next =
new SendCustomIdNode(countdownId));
9392 current = current->next;
9397 void Created(GameObject *obj);
9398 void Destroyed(GameObject *obj);
9400 static bool controllerPlaced;
9403 controllerPlaced =
false;
9405 static void AddSecondNode(
int countdownId,
int triggerSecond,
int id,
int custom,
int param,
float delay)
9407 SendCustomIdNode *baseNode = FindOrCreateCountdownId(countdownId);
9408 SendCustomOnSecondNode *current = baseNode->nodes;
9409 if (!baseNode->nodes)
9410 baseNode->nodes =
new SendCustomOnSecondNode(triggerSecond,
id,custom,param,delay);
9413 if (triggerSecond == current->triggerSecond &&
id == current->id && custom == current->custom && param == current->param)
9415 Console_Input(
"msg ERROR: A custom for this trigger second already exists!");
9420 current->next =
new SendCustomOnSecondNode(triggerSecond,
id,custom,param,delay);
9423 current = current->next;
9426 static void NodeSendCustom(GameObject *obj,SendCustomIdNode *countdownNode,
int second)
9430 SendCustomOnSecondNode *current = countdownNode->nodes;
9433 if (current->triggerSecond == second)
9434 Commands->Send_Custom_Event(obj,Commands->Find_Object(current->id),current->custom,current->param,current->delay);
9435 current = current->next;
9440 controllerPlaced =
false;
9441 SendCustomIdNode *temp = sendCustomIdNodeList,*die;
9449 sendCustomIdNodeList = NULL;
9468 JMG_Utility_Silent_Countdown_Controller::SendCustomIdNode *sendCustomIdNode;
9469 void Created(GameObject *obj);
9470 void Timer_Expired(GameObject *obj,
int number);
9471 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
9486 void Created(GameObject *obj);
9503 bool retryOnFailure;
9505 float safeTeleportDistance;
9506 int wanderPointGroup;
9507 int changeGroupIDCustom;
9509 void Created(GameObject *obj);
9510 void Entered(GameObject *obj,GameObject *enterer);
9511 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
9512 bool Get_A_Defense_Point(Vector3 *position,
float *facing,GameObject *boss);
9513 bool Grab_Teleport_Spot(GameObject *enter,
int attempts);
9515 static int BossObjectId;
9524 void Created(GameObject *obj);
9536 void Created(GameObject *obj);
9537 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
9567 struct ControlPointTeamData
9573 char pointModel[16];
9574 char defaultAnimation[32];
9575 float animationLength;
9576 int defenseMultiplier;
9577 int captureMultiplier;
9578 int unoccupiedMultiplier;
9579 char lostSound[128];
9580 char captureSound[128];
9581 char lockedModel[16];
9582 char lockedAnim[32];
9583 float lockedAnimLen;
9585 int teamMemberCaptureCustom;
9586 int teamMembmerLostCustom;
9587 int teamCaptureCustom;
9589 int teamMemberNeutralize;
9590 ControlPointTeamData(
int teamId,
const char *teamName,
int playerType,
int radarBlipColor,
const char *pointModel,
const char *defaultAnimation,
float animationLength,
const char *captureSound,
const char *lostSound,
const char *lockedModel,
const char *lockedAnim,
float lockedAnimLen,
int defenseMultiplier,
int captureMultiplier,
int unoccupiedMultiplier,
int customId,
int teamMemberCaptureCustom,
int teamMembmerLostCustom,
int teamCaptureCustom,
int teamLostCustom,
int teamMemberNeutralize)
9592 this->teamId = teamId;
9593 sprintf(this->teamName,
"%s",teamName);
9594 this->playerType = playerType;
9595 this->radarBlipColor = radarBlipColor;
9596 sprintf(this->pointModel,
"%s",pointModel);
9597 sprintf(this->defaultAnimation,
"%s",defaultAnimation);
9598 this->animationLength = animationLength;
9599 this->defenseMultiplier = defenseMultiplier;
9600 this->captureMultiplier = captureMultiplier;
9601 this->unoccupiedMultiplier = unoccupiedMultiplier;
9602 sprintf(this->captureSound,
"%s",captureSound);
9603 sprintf(this->lostSound,
"%s",lostSound);
9604 sprintf(this->lockedModel,
"%s",lockedModel);
9605 sprintf(this->lockedAnim,
"%s",lockedAnim);
9606 this->lockedAnimLen = lockedAnimLen;
9607 this->customId = customId;
9608 this->teamMemberCaptureCustom = teamMemberCaptureCustom;
9609 this->teamMembmerLostCustom = teamMembmerLostCustom;
9610 this->teamCaptureCustom = teamCaptureCustom;
9611 this->teamLostCustom = teamLostCustom;
9612 this->teamMemberNeutralize = teamMemberNeutralize;
9615 static SList<ControlPointTeamData> controlPointTeamData;
9616 static bool controllerPlaced;
9618 void Created(GameObject *obj);
9619 void Timer_Expired(GameObject *obj,
int number);
9620 void Destroyed(GameObject *obj);
9624 controllerPlaced =
true;
9625 allSetupComplete =
false;
9627 static SList<GameObject> controlPoints;
9628 static SList<GameObject> wanderPoints;
9629 static bool allSetupComplete;
9659 void Created(GameObject *obj);
9680 struct ControlPointSettingOverride
9686 char pointModelOverride[16];
9687 char animOverride[32];
9688 float animationLength;
9689 char lockedPointModelOverride[16];
9690 char lockedAnimOverride[32];
9691 float lockedAnimationLength;
9692 ControlPointSettingOverride(
int teamId,
int id,
int captureCustom,
int lostCustom,
const char *pointModelOverride,
const char *animOverride,
float animationLength,
const char *lockedPointModelOverride,
const char *lockedAnimOverride,
float lockedAnimationLength)
9694 this->teamId = teamId;
9696 this->captureCustom = captureCustom;
9697 this->lostCustom = lostCustom;
9698 sprintf(this->pointModelOverride,
"%s",pointModelOverride);
9699 sprintf(this->animOverride,
"%s",animOverride);
9700 this->animationLength = animationLength;
9701 sprintf(this->lockedPointModelOverride,
"%s",lockedPointModelOverride);
9702 sprintf(this->lockedAnimOverride,
"%s",lockedAnimOverride);
9703 this->lockedAnimationLength = lockedAnimationLength;
9706 SList<ControlPointSettingOverride> controlPointSettingOverride;
9709 float neutralizeScore;
9710 int currerntCapturePoints;
9711 int maxCapturePoints;
9713 float controlDistance;
9719 Vector3 controlHeightMinMax;
9721 ControlPointSettingOverride *controllingTeamOverride;
9722 ControlPointSettingOverride *lastTeamOverride;
9723 JMG_Utility_Control_Point_Controller::ControlPointTeamData *controllingTeam;
9724 JMG_Utility_Control_Point_Controller::ControlPointTeamData *neutralTeam;
9725 JMG_Utility_Control_Point_Controller::ControlPointTeamData *lastTeam;
9726 void Created(GameObject *obj);
9727 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
9728 void Timer_Expired(GameObject *obj,
int number);
9729 void Destroyed(GameObject *obj);
9730 void SetAnimation(GameObject *obj,
const char *anim,
float length);
9731 void AddUpCpPoints(GameObject *obj,JMG_Utility_Control_Point_Controller::ControlPointTeamData *unitTeamData,
int multiplier);
9732 void JMG_Utility_Control_Point::Final_CP_Calculation(GameObject *obj);
9733 void LostControlPoint(GameObject *obj);
9734 void CaptureControlPoint(GameObject *obj);
9735 void GrantPointsToTeamMembersInRange(GameObject *obj,
float points,
bool matchTeam);
9736 void UpdateTeamOverride(
int teamId);
9737 void UpdateTeam(
int teamId);
9738 void TriggerAssaultLinesUpdate();
9739 void UpdateControllerWanderPoints();
9740 void SendCustomToAllInRange(GameObject *obj,
int id,
int teamId,
int custom);
9741 void SendNeutralizeToAllInRange(GameObject *obj,
int teamId);
9743 char controlPointName[128];
9748 int controllingTeamId;
9749 void ChangeModelAndTeam(GameObject *obj);
9750 void UpdateAnimation(GameObject *obj);
9751 SList<GameObject> controlPointWanderPoints;
9754 setupComplete =
false;
9774 void Created(GameObject *obj);
9785 void Created(GameObject *obj);
9786 void Timer_Expired(GameObject *obj,
int number);
9787 void Killed(GameObject *obj,GameObject *killer);
9790 JMG_Utility_Control_Point_Controller::ControlPointTeamData *teamData;
9796 setupComplete =
false;
9815 int pushedBackCustom;
9816 int controlAllCustom;
9818 void Created(GameObject *obj);
9819 void Timer_Expired(GameObject *obj,
int number);
9820 void Destroyed(GameObject *obj);
9821 void SendCustom(GameObject* obj,
int custom,
int thisFrontLineGroup);
9824 static int frontLineGroup;
9825 static int controllerId;
9826 static int spawnGroup;
9827 static int enemySpawnGroup;
9828 void UpdateAssaultLine(GameObject *obj,
bool initialSetup);
9841 int spawnableGroupId;
9842 int unspawnableGroupId;
9844 Rp2SimplePositionSystem::SimplePositionNode *wanderPoint;
9845 void Created(GameObject *obj);
9846 void Timer_Expired(GameObject *obj,
int number);
9847 Rp2SimplePositionSystem::SimplePositionNode *AddAndReturnWanderpoint(GameObject *obj);
9855 void ControlPointChanged();
9856 void UpdateWanderpointSettings();
9877 int ungroupedControlPointId;
9879 int groupChangeCustom;
9880 int ungroupedChangeCustom;
9882 float safeTeleportDistance;
9886 float maxWanderRange;
9887 float startFadeRange;
9888 void Created(GameObject *obj);
9889 void Timer_Expired(GameObject *obj,
int number);
9890 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
9891 int SelectCpToSpawnFrom(GameObject *obj,
int cpId,
bool assaultLines);
9892 bool MoveToControlledWanderPointForCp(GameObject *obj,
int cpId);
9893 void DisplaySpawnTime(GameObject *obj);
9918 void Created(GameObject *obj);
9919 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
9928 void Created(GameObject *obj);
9943 char weaponName[128];
9948 void Created(GameObject *obj);
9949 void Timer_Expired(GameObject *obj,
int number);
9964 void Killed(GameObject *obj,GameObject *killer);
9974 void Created(GameObject *obj);
9975 void Timer_Expired(GameObject *obj,
int number);
9977 void Register_Auto_Save_Variables();
9980 setupComplete =
false;
9994 struct TimedOrderedCustom
10001 TimedOrderedCustom(
int senderid,
int custom,
int param,
float time)
10003 this->senderId = senderId;
10004 this->custom = custom;
10005 this->param = param;
10009 SList<TimedOrderedCustom> timedOrderedCustom;
10014 void Created(GameObject *obj);
10015 void Timer_Expired(GameObject *obj,
int number);
10016 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
10017 void Destroyed(GameObject *obj);
10018 void Detach(GameObject *obj);
10022 timedOrderedCustom.Remove_All();
10038 int recieveMessage;
10044 void Created(GameObject *obj);
10045 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
10057 void Created(GameObject *obj);
10058 void Poked(GameObject *obj, GameObject *poker);
10072 void Killed(GameObject *obj,GameObject *killer);
10073 void Destroyed(GameObject *obj);
10074 void Detach(GameObject *obj);
10106 void Created(GameObject *obj);
10107 void Poked(GameObject *obj, GameObject *poker);
10136 void Created(GameObject *obj);
10137 void Timer_Expired(GameObject *obj,
int number);
10150 void Created(GameObject *obj);
10151 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
10164 void Created(GameObject *obj);
10165 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
10179 int wanderPointGroup;
10180 void Created(GameObject *obj);
10181 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
10182 bool Get_A_Defense_Point(Vector3 *position,
float *facing);
10197 bool retryOnFailure;
10199 float safeTeleportDistance;
10200 int wanderPointGroup;
10201 int changeGroupIDCustom;
10203 void Created(GameObject *obj);
10204 void Entered(GameObject *obj,GameObject *enterer);
10205 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
10206 bool Get_A_Defense_Point(Vector3 *position,
float *facing);
10207 bool Grab_Teleport_Spot(GameObject *enter,
int attempts);
10216 float safeTeleportDistance;
10217 int wanderPointGroup;
10218 void Created(GameObject *obj);
10219 void Timer_Expired(GameObject *obj,
int number);
10220 bool Get_A_Defense_Point(Vector3 *position,
float *facing);
10242 void Created(GameObject *obj);
10243 void Destroyed(GameObject *obj);
10245 char combination[25];
10269 char inputCode[128];
10270 unsigned int depth;
10277 char combination[25];
10281 int partialFailCustom;
10283 bool disableOnFailure;
10284 bool disableOnSuccess;
10286 char soundNameBase[128];
10287 void Created(GameObject *obj);
10288 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
10289 void Send_Custom(GameObject *obj,
int custom,
int param);
10290 void Enable(
bool enableLock);
10291 void ClearUserEntry();
10302 bool useAltAnimation;
10303 char animation[32];
10304 char animation2[32];
10305 char soundName[128];
10306 void Created(GameObject *obj);
10307 void Poked(GameObject *obj,GameObject *poker);
10320 void Created(GameObject *obj);
10321 void Timer_Expired(GameObject *obj,
int number);
10332 char animation[32];
10333 char subobject[16];
10334 bool animating[128];
10335 void Created(GameObject *obj);
10336 void Timer_Expired(GameObject *obj,
int number);
10337 void TriggerAnimationForThePlayer(GameObject *obj,
int playerId);
10354 int receivedCustom;
10359 char animation[32];
10362 void Created(GameObject *obj);
10363 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
10364 void Animation_Complete(GameObject *obj,
const char *anim);
10374 void Created(GameObject *obj);
10388 int receivedCustom;
10393 void Created(GameObject *obj);
10394 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
10409 char soundName[128];
10410 void Created(GameObject *obj);
10411 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
10412 void Killed(GameObject *obj,GameObject *killer);
10435 void Created(GameObject *obj);
10436 void Entered(GameObject *obj,GameObject *enterer);
10447 void Created(GameObject *obj);
10449 static float maxArmor;
10450 static float armor;
10466 bool updateAllObjects;
10467 void Created(GameObject *obj);
10468 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
10477 void Created(GameObject *obj);
10488 void Created(GameObject *obj);
10490 static float maxHealth;
10491 static float health;
10507 bool updateAllObjects;
10508 void Created(GameObject *obj);
10509 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
10518 void Created(GameObject *obj);
10536 char explosionPreset[256];
10537 void Created(GameObject *obj);
10538 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
10555 void Created(GameObject *obj);
10556 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
10570 int nonTargetGroupId;
10572 Rp2SimplePositionSystem::SimplePositionNode *wanderPoint;
10573 void Created(GameObject *obj);
10574 void Timer_Expired(GameObject *obj,
int number);
10575 Rp2SimplePositionSystem::SimplePositionNode *AddAndReturnWanderpoint(GameObject *obj);
10582 int controlPointId;
10583 void ControlPointChanged();
10584 void UpdateWanderpointSettings();
10614 enum aiState{IDLE,CONTROL_POINT_ATTACK,CONTROL_POINT_DEFENSE,ATTACKING_TARGET,CHECKING_LOCATION,ACTION_BADPATH};
10622 bool overrideLocation;
10626 LastAction(
int targetId,Vector3 location,
float speed,
float distance,
bool attack,
bool overrideLocation)
10628 this->targetId = targetId;
10629 this->location = location;
10630 this->speed = speed;
10631 this->distance = distance;
10632 this->attack = attack;
10633 this->overrideLocation = overrideLocation;
10636 struct ValidLastLocation
10640 ValidLastLocation(
bool valid)
10642 this->valid = valid;
10644 ValidLastLocation(
int enemyId);
10646 LastAction lastAction;
10648 Rp2SimplePositionSystem::SimplePositionNode *lastWanderPoint;
10652 float weaponEffectiveRange;
10653 float attackArriveDistance;
10656 Vector3 lastPosition;
10658 float captureDistanceSquared;
10659 float defendDistanceSquared;
10660 bool allowCaptureAttackDistract;
10662 int captureCpGroupId;
10663 float captureCpChance;
10664 float captureSpeed;
10665 float captureDistance;
10666 int defendCpGroupId;
10668 float defendDistance;
10669 float closeDefendDistanceSquared;
10670 float chooseFarDefendChance;
10672 float attackDistance;
10673 float randomAttackDistance;
10674 float attackDistractFromCaptureChance;
10675 float chanceToInvestigateLastSeenLocation;
10676 bool attackCheckBlocked;
10678 bool shutdownEngineOnArrival;
10679 int changeDefendSpeedCustom;
10680 int changeCaptureSpeedCustom;
10681 int changeAttackSpeedCustom;
10682 void Created(GameObject *obj);
10683 void Enemy_Seen(GameObject *obj,GameObject *seen);
10684 void Timer_Expired(GameObject *obj,
int number);
10685 void Action_Complete(GameObject *obj,
int action_id,ActionCompleteReason reason);
10686 void Damaged(GameObject *obj,GameObject *damager,
float damage);
10687 void Attack_Move(GameObject *obj,GameObject *target,Vector3 location,
float speed,
float distance,
bool attack,
bool overrideLocation);
10688 void SelectNextMission(GameObject *obj,ValidLastLocation goNearLastWanderPoint);
10689 void Stuck_Check(GameObject *obj,Vector3 targetPos);
10690 bool Choose_Target(GameObject *obj,GameObject *target);
10691 Rp2SimplePositionSystem::SimplePositionNode *Get_Capture_Point();
10692 Rp2SimplePositionSystem::SimplePositionNode *Get_Defense_Point(GameObject *obj);
10693 void TriggerAttack(GameObject *obj,GameObject *target);
10694 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
10698 lastWanderPoint = NULL;
10711 void Created(GameObject *obj);
10712 void Timer_Expired(GameObject *obj,
int number);
10734 void Created(GameObject *obj);
10735 void Destroyed(GameObject *obj);
10749 bool retryOnFailure;
10750 float safeTeleportDistance;
10751 int wanderPointGroup;
10752 void Created(GameObject *obj);
10753 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
10754 bool Get_A_Defense_Point(Vector3 *position,
float *facing);
10755 bool Grab_Teleport_Spot(GameObject *enter,
int attempts);
10766 void Created(GameObject *obj);
10777 void Created(GameObject *obj);
10778 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
10792 char fullAmmoString[128];
10793 void Created(GameObject *obj);
10794 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
10809 char weaponName[128];
10813 void Created(GameObject *obj);
10814 void Timer_Expired(GameObject *obj,
int number);
10823 int heartBeatSoundId;
10825 char enterWeapon[256];
10826 bool startedFadeRed;
10829 int waterZoneCount;
10830 int lastWaterZoneId;
10831 float defaultSpeed;
10832 int waterDamageDelayTime;
10833 int waterDamageDelayTimeRecover;
10834 int remainingWaterDamageDelay;
10835 char originalSkin[128];
10836 char originalArmor[128];
10837 char originalModel[128];
10839 void Created(GameObject *obj);
10840 void Timer_Expired(GameObject *obj,
int number);
10841 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
10842 void Killed(GameObject *obj,GameObject *killer);
10843 void Destroyed(GameObject *obj);
10844 void Detach(GameObject *obj);
10845 void CreateSoundEmitter(GameObject *obj,
const char *model,
int *soundId);
10846 void DestroySoundEmitter(
int *soundId);
10847 void HideSoundEmitter(
int *soundId);
10857 WarheadType warhead;
10858 void Created(GameObject *obj);
10859 void Damaged(GameObject *obj,GameObject *damager,
float damage);
10876 void Created(GameObject *obj);
10877 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
10881 AllowAttach =
true;
10883 static bool AllowAttach;
10897 void Created(GameObject *obj);
10898 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
10899 void Killed(GameObject *obj,GameObject *killer);
10900 void Destroyed(GameObject *obj);
10901 void Detach(GameObject *obj);
10917 void Created(GameObject *obj);
10918 void Timer_Expired(GameObject *obj,
int number);
10919 void Damaged(GameObject *obj,GameObject *damager,
float damage);
10930 void Created(GameObject *obj);
10936 static int globalFlag;
10950 void Created(GameObject *obj);
10951 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
10964 void Created(GameObject *obj);
10979 void Created(GameObject *obj);
10980 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
10993 char animation[32];
10996 float lastCalculation;
10997 void Created(GameObject *obj);
10998 void Timer_Expired(GameObject *obj,
int number);
11007 void Created(GameObject *obj);
11022 void Created(GameObject *obj);
11023 void Timer_Expired(GameObject *obj,
int number);
11034 void Created(GameObject *obj);
11038 sprintf(extension,
"");
11040 static char extension[16];
11053 char extension[16];
11054 void Created(GameObject *obj);
11055 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
11068 void Created(GameObject *obj);
11070 void UpdateModel(GameObject *obj);
11079 int heartBeatSoundId;
11081 char enterWeapon[256];
11082 bool startedFadeRed;
11085 int waterZoneCount;
11086 int lastWaterZoneId;
11087 float defaultSpeed;
11088 int waterDamageDelayTime;
11089 int waterDamageDelayTimeRecover;
11090 int remainingWaterDamageDelay;
11091 char originalSkin[128];
11092 char originalArmor[128];
11093 char originalModel[128];
11095 unsigned int currentWeaponId;
11096 int defaultHoldStyle;
11097 float defaultSwimSpeedMultiplier;
11098 float waterSpeedMultiplier;
11099 char defaultWeaponPreset[128];
11100 float defaultDrownTime;
11101 float startDrownSequence;
11102 float waterDamageAmount;
11103 char waterDamageWarhead[128];
11104 float drownDamageRate;
11105 char swimmingSkin[128];
11106 char swimmingArmor[128];
11107 char swimmingModel[128];
11108 float swimmingHeightScale;
11109 float swimmingWidthScale;
11110 float originalHeightScale;
11111 float originalWidthScale;
11112 char heartBeatSoundEmitterModel[16];
11113 char pantingSoundEmitterModel[16];
11114 char gaspForBreath[128];
11115 float catchBreathRate;
11116 bool forceDefinedWeapons;
11117 int weaponSwitchForward;
11118 JMG_Utility_Swimming_Infantry_Advanced_Controller::WeaponNode *currentWeapon;
11119 void Created(GameObject *obj);
11120 void Timer_Expired(GameObject *obj,
int number);
11121 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
11122 void Killed(GameObject *obj,GameObject *killer);
11123 void Destroyed(GameObject *obj);
11124 void Detach(GameObject *obj);
11125 void CreateSoundEmitter(GameObject *obj,
const char *model,
int *soundId);
11126 void DestroySoundEmitter(
int *soundId);
11127 void HideSoundEmitter(
int *soundId);
11128 void SwitchWeapon(GameObject *obj);
11129 void UpdateWeaponSwimming(GameObject *obj,
const WeaponDefinitionClass *weaponDef);
11130 void GetWeaponId(
const WeaponDefinitionClass *weaponDef);
11131 int GetWeaponPosition(GameObject *obj,
int weaponId);
11136 currentWeaponId = 0;
11137 currentWeapon = NULL;
11149 void Created(GameObject *obj);
11155 static int globalFlag;
11169 void Created(GameObject *obj);
11170 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
11189 int recieveMessage;
11195 float randomChance;
11196 void Created(GameObject *obj);
11197 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
11218 struct JMGVehicleAmmo
11225 allowError =
false;
11230 Vector3 gotoLocation;
11232 float maxPlayerDistance;
11233 JMGVehicleAmmo primary;
11234 JMGVehicleAmmo secondary;
11235 JMGVehicleAction currentAction;
11236 JMGVehicleAction lastAction;
11237 bool overrideFireMode;
11238 bool overridePrimary;
11243 int doNotUsePathfind;
11245 float minDistanceSquared;
11248 int badDestAttempt;
11253 bool drivingBackward;
11254 float minAttackRange;
11255 float definedWeaponError;
11261 float overrideSpeed;
11263 void Created(GameObject *obj);
11264 void Action_Complete(GameObject *obj,
int action,ActionCompleteReason reason);
11265 void Enemy_Seen(GameObject *obj,GameObject *seen);
11266 void Damaged(GameObject *obj,GameObject *damager,
float damage);
11267 void Timer_Expired(GameObject *obj,
int number);
11268 void RunAttack(GameObject *obj,GameObject *target);
11269 int GetThreatRating(GameObject * obj);
11270 GameObject *GetAttackObject(GameObject * obj);
11271 GameObject *SelectTarget(GameObject *obj,GameObject *target);
11272 GameObject *SetTarget(GameObject *target);
11273 GameObject *GetClosest(GameObject *obj,GameObject *new_target,GameObject *old_target);
11274 int SelectAmmo(GameObject *target);
11275 void StuckCheck(GameObject *obj);
11276 void AttackMove(GameObject *obj,GameObject *target,
bool gotoObject,Vector3 targetLocation,
int fireMode,
float weaponError,
bool forceUpdate,
float arriveDistance);
11277 JMGVehicleAmmo DefineAmmo(
const AmmoDefinitionClass *ammo);
11286 void Created(GameObject *obj);
11299 void Killed(GameObject *obj,GameObject *killer);
11300 void Timer_Expired(GameObject *obj,
int number);
11323 int objectiveIds[128];
11324 int objectiveCount;
11326 void Created(GameObject *obj);
11327 void Timer_Expired(GameObject *obj,
int number);
11340 char animation[32];
11342 float lastCalculation;
11343 void Created(GameObject *obj);
11344 void Damaged(GameObject *obj,GameObject *damager,
float damage);
11356 void Created(GameObject *obj);
11357 void Timer_Expired(GameObject *obj,
int number);
11391 enum aiState{IDLE,HUNTING_STAR,ATTACKING_TARGET,RETURNING_HOME,WANDERING_GROUP,ACTION_BADPATH};
11399 bool overrideLocation;
11403 LastAction(
int targetId,Vector3 location,
float speed,
float distance,
bool attack,
bool overrideLocation)
11405 this->targetId = targetId;
11406 this->location = location;
11407 this->speed = speed;
11408 this->distance = distance;
11409 this->attack = attack;
11410 this->overrideLocation = overrideLocation;
11412 bool operator == (LastAction l)
11414 return (targetId == l.targetId && JmgUtility::SimpleDistance(location,l.location) <= 0.0f && speed == l.speed && distance == l.distance && attack == l.attack && overrideLocation == l.overrideLocation);
11417 struct ValidLastLocation
11421 ValidLastLocation(
bool valid)
11423 this->valid = valid;
11425 ValidLastLocation(
int enemyId);
11427 LastAction lastAction;
11429 Vector3 homeLocation;
11430 float maxSightFromHomeLocation;
11435 float weaponEffectiveRange;
11436 int huntingEnemyId;
11437 int removeIgnoreTime;
11439 float huntSearchDistance;
11440 float huntArriveDistance;
11441 float attackArriveDistance;
11444 Vector3 lastPosition;
11446 float wanderDistanceOverride;
11447 int wanderingAiGroupId;
11451 float returnHomeSpeed;
11452 int changeWanderGroupCustom;
11453 int changeWanderSpeedCustom;
11454 int changeHuntDistanceCustom;
11455 int changeReturnHomeSpeedCustom;
11456 int changeHuntSpeedCustom;
11457 int changeMaxSightFromHomeLocationCustom;
11458 int changeAttackSpeedCustom;
11459 void Created(GameObject *obj);
11460 void Enemy_Seen(GameObject *obj,GameObject *seen);
11461 void Timer_Expired(GameObject *obj,
int number);
11462 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
11463 void Action_Complete(GameObject *obj,
int action_id,ActionCompleteReason reason);
11464 void Damaged(GameObject *obj,GameObject *damager,
float damage);
11465 void Attack_Move(GameObject *obj,GameObject *target,Vector3 location,
float speed,
float distance,
bool attack,
bool overrideLocation);
11466 GameObject *findClosestStar(GameObject *obj);
11467 void Return_Home(GameObject *obj,ValidLastLocation goNearLastWanderPoint);
11468 void Stuck_Check(GameObject *obj,Vector3 targetPos);
11469 void Cant_Get_To_target(GameObject *obj);
11470 bool GetRandomPosition(Vector3 *position);
11471 bool Choose_Target(GameObject *obj,GameObject *target);
11480 void Created(GameObject *obj);
11489 void Created(GameObject *obj);
11509 float playerAddMaxCount;
11511 int recieveMessage;
11517 float randomChance;
11518 void Created(GameObject *obj);
11519 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
11532 void Created(GameObject *obj);
11551 bool requiresRemoveScript;
11553 char *attachScript;
11554 char *removeScript;
11555 void Created(GameObject *obj);
11556 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
11565 void Created(GameObject *obj);
11574 void Created(GameObject *obj);
11583 void Created(GameObject *obj);
11592 void Created(GameObject *obj);
11602 void Created(GameObject *obj);
11622 char weaponName[128];
11626 void Created(GameObject *obj);
11627 void Timer_Expired(GameObject *obj,
int number);
11637 void Created(GameObject *obj);
11638 void Timer_Expired(GameObject *obj,
int number);
11655 void Created(GameObject *obj);
11656 void Timer_Expired(GameObject *obj,
int number);
11673 void Created(GameObject *obj);
11674 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
11687 void Killed(GameObject *obj,GameObject *killer);
11702 char powerupName[128];
11703 void Created(GameObject *obj);
11704 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
11705 void Timer_Expired(GameObject *obj,
int number);
11720 int recieveMessage;
11722 SList<int> customs;
11725 void Created(GameObject *obj);
11726 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
11741 int recieveMessage;
11743 SList<int> customs;
11746 void Created(GameObject *obj);
11747 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
11759 bool forceOutOfOtherVehicles;
11761 enum SuccessState{SUCCESS,RETRY,ALREADY_IN,FAILED,VEHICLE_FULL,STUCK_IN_ANOTHER_VEHICLE};
11762 void Created(GameObject *obj);
11763 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
11764 SuccessState ForceIntoVehicle(GameObject *obj,GameObject *target);
11776 void Created(GameObject *obj);
11777 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
11778 void Timer_Expired(GameObject *obj,
int number);
11794 int recieveMessage;
11800 void Created(GameObject *obj);
11801 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
11817 int recieveMessage;
11823 void Created(GameObject *obj);
11824 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
11850 struct SpawnObjectNode
11853 ReferencerClass obj;
11854 SpawnObjectNode(GameObject *obj,
int spawnGroupId)
11857 this->groupId = spawnGroupId;
11860 static SList<SpawnObjectNode> spawnObjectNodeList;
11864 int spawnedObjectScriptID;
11865 int spawnedObjects;
11866 enum SpawnFailureTypes{SPAWN_BLOCKED, SUCCESS, LIMIT_REACHED, SPAWN_CODE_ERROR};
11868 int maxTotalSpawned;
11873 int changeSpawnCapCustom;
11874 int enableDisableCustom;
11876 int attachScriptsGroupId;
11877 float playersAddToSpawnAtATime;
11878 int wanderPointGroup;
11879 float safeTeleportDistance;
11880 int lastPlayerCount;
11881 void Created(GameObject *obj);
11882 void Timer_Expired(GameObject *obj,
int number);
11883 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
11884 SpawnFailureTypes AttemptSpawn(GameObject *obj);
11885 void Initial_Spawn(GameObject *obj);
11886 int GetPlayerLimitModifier();
11887 bool Grab_Teleport_Spot(GameObject *spawnedObject,
int attempts);
11888 bool Get_A_Defense_Point(Vector3 *position,
float *facing);
11899 void Created(GameObject *obj);
11905 static int globalParam;
11919 void Created(GameObject *obj);
11920 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
11936 int recieveMessage;
11941 float randomChance;
11942 void Created(GameObject *obj);
11943 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
11953 void Created(GameObject *obj);
11955 static float scale;
11968 void Created(GameObject *obj);
11969 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
11978 void Created(GameObject *obj);
11988 void Created(GameObject *obj);
11990 static float scale;
12003 void Created(GameObject *obj);
12004 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
12013 void Created(GameObject *obj);
12023 void Created(GameObject *obj);
12025 static float speed;
12038 void Created(GameObject *obj);
12039 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
12048 void Created(GameObject *obj);
12057 void Created(GameObject *obj);
12073 int recieveMessage;
12080 void Created(GameObject *obj);
12081 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
12096 int recieveMessage;
12103 void Created(GameObject *obj);
12104 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
12118 int recieveMessage;
12123 void Created(GameObject *obj);
12124 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
12137 void Killed(GameObject *obj,GameObject *killer);
12148 bool fogSynced[128];
12149 void Created(GameObject *obj);
12150 void Timer_Expired(GameObject *obj,
int number);
12170 void Created(GameObject *obj);
12171 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
12181 void Created(GameObject *obj);
12182 void Timer_Expired(GameObject *obj,
int number);
12191 char animation[32];
12193 void Created(GameObject *obj);
12194 void Timer_Expired(GameObject *obj,
int number);
12206 void Created(GameObject *obj);
12207 void Poked(GameObject *obj, GameObject *poker);
12228 bool reCreateOnDeath;
12229 void Created(GameObject *obj);
12230 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
12231 void Entered(GameObject *obj,GameObject *enterer);
12232 void Exited(GameObject *obj,GameObject *exiter);
12233 void TriggerCreate(GameObject *obj);
12241 void Killed(GameObject *obj,GameObject *killer);
12242 void Destroyed(GameObject *obj);
12252 bool deathByScript;
12253 void Created(GameObject *obj);
12254 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
12255 void Destroyed(GameObject *obj);
12269 char subObject[16];
12275 void Created(GameObject *obj);
12276 void Timer_Expired(GameObject *obj,
int number);
12277 void Killed(GameObject *obj,GameObject *killer);
12278 void PlayAnimation(GameObject *obj,
const char *aniamtionName,
float frame);
12300 void Created(GameObject *obj);
12301 void Damaged(GameObject *obj,GameObject *damager,
float damage);
12311 char skinType[128];
12312 float minHealthRatio;
12313 void Created(GameObject *obj);
12314 void Damaged(GameObject *obj,GameObject *damager,
float damage);
12318 sprintf(skinType,
"None");
12336 bool requireInPathfind;
12337 void Created(GameObject *obj);
12338 void Timer_Expired(GameObject *obj,
int number);
12351 void Killed(GameObject *obj,GameObject *killer);
12364 void Killed(GameObject *obj,GameObject *killer);
12379 int recieveMessage;
12385 void Created(GameObject *obj);
12386 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
12405 void Created(GameObject *obj);
12406 void Timer_Expired(GameObject *obj,
int number);
12420 void Created(GameObject *obj);
12421 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
12422 void Killed(GameObject *obj,GameObject *killer);
12423 void Destroyed(GameObject *obj);
12424 void Detach(GameObject *obj);
12440 int recieveMessage;
12446 float randomChance;
12447 void Created(GameObject *obj);
12448 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
12456 void Created(GameObject *obj);
12457 void Timer_Expired(GameObject *obj,
int number);
Sends a custom when customs are sent in a certain order (kind of like a combo lock) \Success_Custom -...
Definition jmgUtility.h:54
Tweaks M04 so the bubbles work right and infantry carrying the shotgun drop it.
Definition jmgUtility.h:9972
Use JMG_Utility_Turret_Spawn instead \Turret_Preset - Preset of the turret \Bone_Name - Bone to hook ...
Definition jmgUtility.h:169
Used to clean up the attack point list at gameover.
Definition jmgUtility.h:3184
Used to specify a point that JMG_Utility_AI_Aggressive_Attack_Spot should use to attack,...
Definition jmgUtility.h:3219
Used to specify a point that JMG_Utility_AI_Aggressive_Attack_Spot should use to attack \GroupId - de...
Definition jmgUtility.h:3197
Used to designate repair targets for the Engineer AI that are things other than vehicles,...
Definition jmgUtility.h:3251
Makes the AI run up to an enemy and attack it as close as possible, used for melee AI \ReturnHomeSpee...
Definition jmgUtility.h:2650
Tell objects with JMG_Utility_AI_Control_Point to ignore this object.
Definition jmgUtility.h:12056
This script makes the AI seek out the nearest enemy, players are ignored, it works for infantry and v...
Definition jmgUtility.h:10613
Used to designate targets that the engineer AI should ignore.
Definition jmgUtility.h:5485
Used to designate repair targets for the Engineer AI that are things other than vehicles,...
Definition jmgUtility.h:2957
Basic Engineer AI that will try to repair all OBJECTs in the patrol range, if an enemy gets close the...
Definition jmgUtility.h:195
Needed for AI using JMG_Utility_AI_Follow_Player_On_Poke, this script controls the limits of how many...
Definition jmgUtility.h:5527
Makes an AI follow the player that pokes it, if the player dies it goes to its original position \Fol...
Definition jmgUtility.h:5572
Tell objects with JMG_Utility_AI_Goto_Enemy_Ignore_Object to ignore this object.
Definition jmgUtility.h:4974
Tell objects with JMG_Utility_AI_Goto_Enemy_Not_Star_Ignore_Object to ignore this object.
Definition jmgUtility.h:4984
This script makes the AI seek out the nearest enemy, players are ignored, it works for infantry and v...
Definition jmgUtility.h:4684
This script makes the AI hunt down the nearest enemy, it works for infantry and vehicles \HuntSearchD...
Definition jmgUtility.h:4570
Any object this is attached to will not be shot at by JMG_Utility_AI_Goto_Location_While_Player_Nearb...
Definition jmgUtility.h:11285
AI that will attempt to go to a location as long as a player is near it \GotoObjectId - Object that t...
Definition jmgUtility.h:11217
Tell objects with JMG_Utility_AI_Goto_Player to ignore this object.
Definition jmgUtility.h:4964
This script makes the AI hunt down the nearest player, it works for infantry and vehicles \HuntSearch...
Definition jmgUtility.h:2996
Tell objects with JMG_Utility_AI_Goto_Player to ignore this object.
Definition jmgUtility.h:11479
Tell objects with JMG_Utility_AI_Goto_Target_Script that this is a target.
Definition jmgUtility.h:11488
This script makes the AI hunt down the nearest object with JMG_Utility_AI_Goto_Target_Script_Target a...
Definition jmgUtility.h:11390
Makes this unit ignored by JMG_Utility_AI_Guardian_Aircraft.
Definition jmgUtility.h:11564
Makes an aircraft move between wander points, it'll strafe at the target while it has one \WanderingA...
Definition jmgUtility.h:2896
Makes this unit ignored by JMG_Utility_AI_Guardian_Generic.
Definition jmgUtility.h:11591
Makes a unit move between wander points, it'll strafe at the target while it has one,...
Definition jmgUtility.h:6082
Makes this unit ignored by all the Guardian AI scripts.
Definition jmgUtility.h:5850
Makes this unit ignored by JMG_Utility_AI_Guardian_Infantry.
Definition jmgUtility.h:11573
Makes a unit move between wander points, it'll strafe at the target while it has one,...
Definition jmgUtility.h:3762
Makes this unit ignored by JMG_Utility_AI_Guardian_Vehicle.
Definition jmgUtility.h:11582
Makes a unit move between wander points, it'll strafe at the target while it has one,...
Definition jmgUtility.h:4856
Uses maths to "launch" a vehicle with projectile phyiscs at an enemy's location provided by a spotter...
Definition jmgUtility.h:8588
Just used to clean up JMG_Utility_AI_Skittish_Herd_Animal at game end, not required but nice to have.
Definition jmgUtility.h:7630
Prevents JMG_Utility_AI_Skittish_Herd_Animal from seening the attached object.
Definition jmgUtility.h:7621
The AI attached to this script will flee enemies seen and combat (Like in Deer Hunter mode for ECW) \...
Definition jmgUtility.h:7448
Makes this unit ignored by all JMG_Utility_AI_Vehicle.
Definition jmgUtility.h:5859
Vehicle AI that can be used for both aircraft and wheeled vehicles, the AI will attempt to backup whe...
Definition jmgUtility.h:2250
Makes the object or a sub-object of the object animate while moving, dead, or idle....
Definition jmgUtility.h:12268
Applies damage to object at a specified rate (JMG_Utility_Apply_Damage_On_Timer) \Rate - How often to...
Definition jmgUtility.h:6561
Applies damage while in the zone by attaching the script below (JMG_Utility_Apply_Damage_While_In_Zon...
Definition jmgUtility.h:6544
Attaches a script to all players in game (can only attach the designated distinct script name once) \...
Definition jmgUtility.h:6349
Scans the map and attaches the specifed script to all objects that have the specified weapon \WeaponN...
Definition jmgUtility.h:9942
Very basic AI that won't reset its attack while still seeing a target, first come first serve \MinAtt...
Definition jmgUtility.h:8400
Attaches the script supplied to anything spawned by a basic spawner \Script - Name of the script to a...
Definition jmgUtility.h:3379
Tells an object that it belongs to a group of the JMG_Utility_Basic_Spawner_In_Radius (normally attac...
Definition jmgUtility.h:7076
Place this script on an object that exists the duration of the map, all it does is deletes the spawn ...
Definition jmgUtility.h:7190
Spawns objects randomly in a circle using ray casts to find the ground around the location specified ...
Definition jmgUtility.h:7009
Allows you to set where the spawner creates the original spawn (this allows you to hide the flash whe...
Definition jmgUtility.h:3408
Spawns objects randomly in a circle using ray casts to find the ground around the location specified ...
Definition jmgUtility.h:11848
Turns a placed object into a renstyle spawner that can be sent customs like a normal object,...
Definition jmgUtility.h:2167
Used to cap the credits of a team, can be updated by sending a custom \Credits - What is the max amou...
Definition jmgUtility.h:4515
Changes a objects w3d model on a timer.
Definition jmgUtility.h:68
Fades screen color to set color while in zone \Color[Red|Green|Blue] RGB value of the color you want ...
Definition jmgUtility.h:2437
Changes the SkinType to Blamo until Armor takes any damage, after that it reverts the SkinType back t...
Definition jmgUtility.h:12310
Displays a message if the script named isn't in the scripts build on the server. \ScriptName - The na...
Definition jmgUtility.h:22
Turns the control point system into something resembling Mutant Assault in ECW, it uses the groupId o...
Definition jmgUtility.h:9812
Controller for the control point system, needed if control points are on the map (NeutralPlayer is -2...
Definition jmgUtility.h:9565
Allows the player to select their spawn location before entering the map much like Mutant Assault in ...
Definition jmgUtility.h:9873
Allows team specific overrides for a control point, script must be on the control point itself \TeamI...
Definition jmgUtility.h:9773
Needs to be on objects that can affect the control point scripts \TeamID - Team this belongs to \Mult...
Definition jmgUtility.h:9784
Adds a team's settings to the game, needs one per team \TeamID - ID of the team, this is used to inde...
Definition jmgUtility.h:9658
Updates a wander point's group ID depending on if the attached control point can be spawned at by the...
Definition jmgUtility.h:10568
Updates a wander point's group ID depending on if the attached control point can be spawned at by the...
Definition jmgUtility.h:9840
Sets this control point's default settings \ControlPointName - Name displayed when CP is lost or capt...
Definition jmgUtility.h:9678
Moves object to nearest pathfind location on create.
Definition jmgUtility.h:9927
Sets a random model on create \BaseName - Base model name in the random set to assign \FinalModelNumb...
Definition jmgUtility.h:10765
Starts a looping animation on a sub object when a client joins a game \SubObject - Subobject to play ...
Definition jmgUtility.h:10331
Destroys self if not in a pathfind sector.
Definition jmgUtility.h:11006
Sends a custom message when the attached object moves a distance from its initial spawn location \Fir...
Definition jmgUtility.h:12399
Gives a weapon to the player without need of a powerup \WeaponName - Name of the weapon to give \Gran...
Definition jmgUtility.h:6784
Makes an AI able to shoot directions the gun isn't aiming.
Definition jmgUtility.h:5882
Plays a looped animation on the attached infantry, disables all animations \Animation - Animation to ...
Definition jmgUtility.h:10373
Sets the damage and death points of an object on attach \Damage_Points - Points to give when damaged,...
Definition jmgUtility.h:6901
Creates the preset from the specified team's vehicle factory on create \PresetName - Vehicle preset t...
Definition jmgUtility.h:11531
Like any other credit trickle script but it will stop once the amount is reached for the player \Cred...
Definition jmgUtility.h:6798
Gives players a trickle of credits while they are determined not AFK (requires JMG_Utility_Detect_AFK...
Definition jmgUtility.h:6944
Sends a custom on a custom with matching param \Custom - Custom to watch for \Param - Param to watch ...
Definition jmgUtility.h:9909
Applys damage to the closest preset to the attached object (works with powerups and other "dumb" obje...
Definition jmgUtility.h:8750
Applys damage to an object when custom is received \Custom - Custom to trigger on \ID - ID of the obj...
Definition jmgUtility.h:4534
Controls if JMG_Utility_Global_Attach_Script_On_Flags can attach scripts, default flag is -1 \Custom ...
Definition jmgUtility.h:10974
Changes the character of the sender object (only works on infantry) \Custom - custom to trigger on (H...
Definition jmgUtility.h:6528
Used for pressing keys on the combination lock, script is attached by the code.
Definition jmgUtility.h:10298
Used by to make a param send when customs are sent in in the correct order \ID - ID to send the messa...
Definition jmgUtility.h:10268
Creates an explosion at the bone specified on the attached object \Custom - Custom to trigger the exp...
Definition jmgUtility.h:6616
Basic creates an object at the bone position when a custom is received \Custom - Custom message neede...
Definition jmgUtility.h:11670
Creates a specified preset at a random wander point \Custom - Custom to trigger on \Preset - Preset t...
Definition jmgUtility.h:10176
Creates an object in front of this object \Custom - Custom to trigger the script \PresetName - Name o...
Definition jmgUtility.h:6111
Creates random explosions around the attached object within the specified paramaters \Custom - Custom...
Definition jmgUtility.h:10531
Creates a 3D sound at the specified bone on custom \Sound - Sound preset to play \Bone - Bone to play...
Definition jmgUtility.h:5800
Damages all units of a preset type when a custom is received \Custom - Custom to count \PresetName - ...
Definition jmgUtility.h:6403
Kills all soldiers on a team when a custom is received \Custom - Custom to count \Team - team to wipe...
Definition jmgUtility.h:4835
Damages all vehicles on a team when a custom is received \Custom - Custom to count \Team - team to wi...
Definition jmgUtility.h:6140
Damages all objects on a team when a custom is received \Custom - Custom to trigger on \Team - Requir...
Definition jmgUtility.h:6821
Sends a custom after a delay, if the custom being watched for is received again the delay is reset be...
Definition jmgUtility.h:7266
Destroys all the objects on the map with matching preset name \Custom - Custom to trigger the script ...
Definition jmgUtility.h:5955
Destroys the closest object with the 3d model to the position (works with powerups and other "dumb" o...
Definition jmgUtility.h:4883
Destroys the closest preset to the position (works with powerups and other "dumb" objects) \Custom - ...
Definition jmgUtility.h:4174
Destroys the closest preset to the attached object (works with powerups and other "dumb" objects) \Cu...
Definition jmgUtility.h:8733
Destroy self when a custom is received \Custom - Custom to trigger on.
Definition jmgUtility.h:4463
Destroys the sender on custom \Custom - custom to destroy the sender on.
Definition jmgUtility.h:10775
Reads text from a file and displays it to the screen, \ the text in a file is broken every 150 charac...
Definition jmgUtility.h:6182
Reads text from a file and displays it to the screen, \ the text in a file is broken every 150 charac...
Definition jmgUtility.h:4307
Reads text from a file and displays it to the screen, as little popup dialogs \ the text in a file is...
Definition jmgUtility.h:8490
Displays a popup dialog to the attached player object \Custom - Custom to trigger the teleport \Messa...
Definition jmgUtility.h:7649
Works like JMG_Utility_Killed_Drop_Powerup_Become_Corpse but triggers on custom \Custom - Custom mess...
Definition jmgUtility.h:11699
Works exactly like JMG_Utility_Custom_Enable_Spawners_In_Range_Mod but player count subtracts from th...
Definition jmgUtility.h:6722
Used to enable or disable all spawners within an ID range on zone enter but only enables the IDs that...
Definition jmgUtility.h:6602
Used to enable or disable all spawners within an ID range on zone enter \StartID - ID to start at \En...
Definition jmgUtility.h:3322
Used to enable or disable a spawner within an ID range of the script each time a custom is sent (adds...
Definition jmgUtility.h:10550
When the custom is received all players on the map will attempt to enter the vehicle until it is full...
Definition jmgUtility.h:11757
Forces all occupants out of the vehicle (taking as many attempts as needed 10 times a second) once fi...
Definition jmgUtility.h:11774
Scales the given score as players join/leave the match (if no players are in game the score is not up...
Definition jmgUtility.h:7738
Destroys the sender on custom \Custom - custom to destroy the sender on \Weapon - weapon to grant/add...
Definition jmgUtility.h:10789
When a specified custom is received it plays an animation, when the animation complete it sends a cus...
Definition jmgUtility.h:10353
Sends any custom message caught back to the sender \Model - Model this object must be for the script ...
Definition jmgUtility.h:10147
Removes a script and then attaches another script on custom \Custom - Custom that triggers the script...
Definition jmgUtility.h:11548
Removes a weapon from all the players in game when a custom is received \Custom - Custom to count \We...
Definition jmgUtility.h:5941
Applys damage to the closest preset to the attached object (works with powerups and other "dumb" obje...
Definition jmgUtility.h:8765
Sends a custom on a custom from each of the players on the map \Custom - Custom to watch for \ID - ID...
Definition jmgUtility.h:12117
Sends a custom on a custom if the model matches \Model - Model this object must be for the script to ...
Definition jmgUtility.h:10037
Sends a custom if the number of occupants in a vehicle is greater than or equal to the value specifie...
Definition jmgUtility.h:11815
Sends a custom if the number of occupants in a vehicle is less than or equal to the value specified \...
Definition jmgUtility.h:11792
Sends a custom on a custom if the specified script is attached \Custom - Custom to count \ID - ID to ...
Definition jmgUtility.h:7160
Sends a custom on a custom if the count of objects with the specified script is less than the count \...
Definition jmgUtility.h:11507
Sends a custom on a custom if the specified script is not attached \Custom - Custom to count \ID - ID...
Definition jmgUtility.h:7178
Sends a custom when there are no objects of the preset type inside of the vehicle \Custom - Custom to...
Definition jmgUtility.h:12094
Sends a custom when there are no objects of the preset type outside of the vehicle \Custom - Custom t...
Definition jmgUtility.h:12071
Sends a custom when a custom has been received x times, message comes from sender \Custom - Custom to...
Definition jmgUtility.h:8660
Sends a custom when a custom has been received x times \Custom - Custom to count \Count - how many cu...
Definition jmgUtility.h:4449
References an object with JMG_Utility_Custom_Send_Custom_On_Player_Count_HUD and uses the count to se...
Definition jmgUtility.h:10992
Sends a custom when a custom has been received x times with addition of a player count multiplier,...
Definition jmgUtility.h:5901
Sends a custom when a custom has been received x times with addition of a player count multiplier,...
Definition jmgUtility.h:5822
Sends a custom if the specified preset ID is on the map \Custom - Custom to watch for \PresetID - Pre...
Definition jmgUtility.h:7669
Sends a custom if the specified script is on a preset on the map \Custom - Custom to watch for \Scrip...
Definition jmgUtility.h:7695
Sends a custom when a custom is received while a secondary count of a secondary custom matches \Trigg...
Definition jmgUtility.h:8290
Sends a custom when a custom is recieved, ignore time makes it unable to send another custom until ti...
Definition jmgUtility.h:6639
Sends a custom on a custom from the sender \Custom - Custom to watch for \ID - ID to send to,...
Definition jmgUtility.h:12439
When one of the defined customs is caught it will be instantly sent, after sending a delay timer star...
Definition jmgUtility.h:8428
Sends a to all objects on the map sends from the sender \Custom - Custom to watch for \Team - Require...
Definition jmgUtility.h:12378
Sends a to all objects on the map \Custom - Custom to watch for \Team - Required team to send to,...
Definition jmgUtility.h:7317
Sends a custom to all matching presets on the map on custom \ReceivedCustom - Message needed to trigg...
Definition jmgUtility.h:10387
Sends a custom on a custom \Custom - Custom to watch for \ID - ID to send to, 0 sends to self,...
Definition jmgUtility.h:4789
Sends a custom on a custom, the custom that is sent is cycled through the loop of customs provided (n...
Definition jmgUtility.h:8119
Watches for specific custom and sends them to the specified id, after each send starts a timer,...
Definition jmgUtility.h:9993
Sends a random custom to a random id on a custom, each time the custom is received a custom and id is...
Definition jmgUtility.h:11740
Sends a random custom on a custom, each time the custom is received a custom is sent and removed from...
Definition jmgUtility.h:11719
Sends a chat message to all players on custom \Custom - Custom message to trigger the script on \Stri...
Definition jmgUtility.h:5995
Sets the animation of an object when a custom is received \Custom - Custom to trigger on \ID - ID of ...
Definition jmgUtility.h:6846
Enables or disables the attached vehicles engine on custom \Custom - Custom to trigger on \Enable - W...
Definition jmgUtility.h:7202
Enables or disables the human anim override of a soldier \Custom - custom to update the height on \En...
Definition jmgUtility.h:7805
Sets the height scaler for an infantry on a custom \Custom - custom to update the height on \Height -...
Definition jmgUtility.h:7763
Sets the height scaler for an infantry on a custom \Custom - custom to update the height on \Width - ...
Definition jmgUtility.h:7777
Moves an object when a custom is received, works on zones \Custom - Custom to trigger on \Position - ...
Definition jmgUtility.h:7246
Sets the speed of the attached soldier on Custom \Custom - Custom needed to trigger script \Speed - M...
Definition jmgUtility.h:9534
Changes the model, team, and resets the action of an object on custom. \Custom - Custom to trigger th...
Definition jmgUtility.h:4997
Sets the attached object's team when a custom is received \Custom - Custom to trigger on \Team - Team...
Definition jmgUtility.h:10161
Sets the animation frame of a tile when a custom is received \Custom - Custom to trigger the teleport...
Definition jmgUtility.h:4262
Sets the hold style for all weapons, if -1 hold style will not be locked \Custom - custom to update t...
Definition jmgUtility.h:7791
Receiving a custom changes the Clouds on the map \Custom - Custom event to trigger the change \Cover ...
Definition jmgUtility.h:4029
Receiving a custom changes the Fog on the map \Custom - Custom event to trigger the change \StartDist...
Definition jmgUtility.h:3962
Receiving a custom changes the Lightning on the map \Custom - Custom event to trigger the change \Int...
Definition jmgUtility.h:3996
Receiving a custom changes the Precipitation on the map \Custom - Custom event to trigger the change ...
Definition jmgUtility.h:3947
Receiving a custom changes the Warblitz on the map \Custom - Custom event to trigger the change \Inte...
Definition jmgUtility.h:4014
Receiving a custom changes the Wind on the map \Custom - Custom event to trigger the change \Heading ...
Definition jmgUtility.h:3978
Switches the current weapon to a different weapon on custom \Custom - custom to trigger on \Weapon - ...
Definition jmgUtility.h:5192
Plays a sound from the position of the attached soldier, also animates their face dynamically \Custom...
Definition jmgUtility.h:10405
Teleports the object that enters the zone to a random wander point \Custom - Custom to trigger the te...
Definition jmgUtility.h:4239
Teleports the sender of a custom to a random wander point \Custom - Custom message to listen for \Wan...
Definition jmgUtility.h:10747
Teleports the object that enters the zone to a random wander point \Custom - Custom to trigger the te...
Definition jmgUtility.h:7395
Sets whether AI with Enemy Seen can see this object \Custom - custom to trigger on \Visible - Does en...
Definition jmgUtility.h:5428
Sends a custom when damaged \MinDamage - min damage required to trigger the script \ID - ID to send t...
Definition jmgUtility.h:6667
Applies damage to all smart game objects in range \Range - Range to damage objects inside of \Damage ...
Definition jmgUtility.h:4414
Empty vehicles slowly die if not occupied by a player (a player must enter the vehicle once first) \R...
Definition jmgUtility.h:4812
Changes the animation frame as an object is damaged \ (Math is (currentHP/MaxHP)*MaxFrame \Animation ...
Definition jmgUtility.h:11339
Fades the screen and applies damage as the player gets further from the spot on the map,...
Definition jmgUtility.h:5689
Creates an object at the location where the attached was when the attached object's shield is zero,...
Definition jmgUtility.h:6971
Refunds the damage if the warhead is a match \WarheadName - Warhead to refund the damage from.
Definition jmgUtility.h:10856
Basic turret attach script, turrets match team of vehicle attached to, turrets are destroyed by destr...
Definition jmgUtility.h:5172
Spawns an object if the last warhead that damaged the object matches the specified warhead \Warhead -...
Definition jmgUtility.h:5011
Spawns an object if the weapon that killed the object matches the specified weapon preset (warhead sc...
Definition jmgUtility.h:6420
Rotates the player's camera after a delay \Time - Time amount to wait \Facing - Direction to rotate t...
Definition jmgUtility.h:4399
Same as JMG_Utility_Destroy_Objects_In_ID_Range_On_Destroy but tiggers on death instead of destroy.
Definition jmgUtility.h:6222
Sends a custom when an object is destroyed \ID - Id of the object to send the custom to,...
Definition jmgUtility.h:6322
Applies damage to the target when DESTROYED \ID - Id of the object to damage \Damage - Amount of dama...
Definition jmgUtility.h:3629
Creates a powerup at the objects origin when it is destroyed if it has that weapon \RequiredWeaponPre...
Definition jmgUtility.h:6013
Sets a flag for each player when they are determined to be AFK, the determination is done by if the p...
Definition jmgUtility.h:6912
Displays a hud message to all players on custom, allows user to override string with custom string \C...
Definition jmgUtility.h:2608
Displays a hud message to all players on custom \Custom - Custom message to trigger on \StringId - ID...
Definition jmgUtility.h:122
Displays a hud message to a player on custom \Custom - Custom message to trigger on \StringId - ID of...
Definition jmgUtility.h:134
Used to display a HUD message to a player that enters a vehicle \StringId - ID of the string to displ...
Definition jmgUtility.h:2865
Displays a hud message to all players on custom, allows user to override string with custom string \C...
Definition jmgUtility.h:2620
Basically GTH_Drop_Object_On_Death but attaches a script to the dropped object \Drop_Object - Object ...
Definition jmgUtility.h:9963
Used for cleanup after the level completes, place on an object that will exist the whole level.
Definition jmgUtility.h:8964
Adds (or updates) a parameter on the specified script ID on create (there is a 0.1 second delay after...
Definition jmgUtility.h:8990
Same as JMG_Utility_Dynamic_Script_Created_Add_Update_Parameter but triggers on custom \Custom - Cust...
Definition jmgUtility.h:9005
Attaches the script specified by ID and the currently defined parameters \Custom - Custom to trigger ...
Definition jmgUtility.h:9018
Setup a dynamic script identity \ScriptID - ID that this script is stored under, used to look up the ...
Definition jmgUtility.h:8977
Turns an object into an object that emulates the damange system of DamageableStaticPhysics tiles \Ani...
Definition jmgUtility.h:103
This script makes for a rather cruddy emulation of sound_heard on a dedicated server....
Definition jmgUtility.h:8155
Enables loiter animations.
Definition jmgUtility.h:5181
Prevents JMG_Utility_Enemy_Seen_Send_Custom from seening the attached object.
Definition jmgUtility.h:7333
Sends a custom when an enemy is seen, sends a custom again after no enemy in the criteria is visible ...
Definition jmgUtility.h:7128
Attached by JMG_Utility_Enter_Play_Animation_And_Relocate, not designed to be used directly.
Definition jmgUtility.h:8716
Plays an animation on the object that enters the zone, the object is also attached to another object ...
Definition jmgUtility.h:8698
Plays an animation and locks the soldier in place when they run out of armor, when armor is full agai...
Definition jmgUtility.h:3733
Applies damage based on speed when a flying vehicle collides with terrain or another object \Min_Coll...
Definition jmgUtility.h:7100
Places all players on the same team at the end of the round \Team - Team to force all players to.
Definition jmgUtility.h:6062
Grants specified weapon to all players in range \WeaponName - Name of the weapon to grant to the play...
Definition jmgUtility.h:5504
Controller is required for the global armor system for all objects on the map that have the object sc...
Definition jmgUtility.h:10446
When a custom is received it will change the armor of all objects on the map that have the object scr...
Definition jmgUtility.h:10462
When the object is created it will use the armor specified by the controller.
Definition jmgUtility.h:10476
Controller is required for the global armor scaled system for all objects on the map that have the ob...
Definition jmgUtility.h:11952
When a custom is received it will update the scale amount for the scale system \Custom - Custom neede...
Definition jmgUtility.h:11965
When the object is created it will scale the objects armor specified by the controller.
Definition jmgUtility.h:11977
Controls if JMG_Utility_Global_Attach_Script_On_Flags can attach scripts, default flag is -1 \Custom ...
Definition jmgUtility.h:10929
Changes what the global flag is on custom \Custom - Custom to flip if attaching is allowed \GlobalFla...
Definition jmgUtility.h:10947
Attaches a script on create if the global flag matches \GlobalFlag - Value that must be matched \Scri...
Definition jmgUtility.h:10963
Controls if JMG_Utility_Global_CSC_With_Global_Param can send a custom, default param is -1 \Custom -...
Definition jmgUtility.h:11898
Changes what the global param is on custom \Custom - Custom to flip if sending is allowed \GlobalFlag...
Definition jmgUtility.h:11916
Sends a custom with the global param \Custom - Custom to watch for \ID - ID to send to,...
Definition jmgUtility.h:11935
Controls if JMG_Utility_Global_Custom_Send_Custom_Flag can send a custom, default flag is -1 \Custom ...
Definition jmgUtility.h:11148
Changes what the global flag is on custom \Custom - Custom to flip if sending is allowed \GlobalFlag ...
Definition jmgUtility.h:11166
Sends a custom if the global flag matches the specified \GlobalFlag - Value needed to match in order ...
Definition jmgUtility.h:11187
Controller is required for the global health system for all objects on the map that have the object s...
Definition jmgUtility.h:10487
When a custom is received it will change the health of all objects on the map that have the object sc...
Definition jmgUtility.h:10503
When the object is created it will use the health specified by the controller.
Definition jmgUtility.h:10517
Controller is required for the global health scaled system for all objects on the map that have the o...
Definition jmgUtility.h:11987
When a custom is received it will update the scale amount for the scale system \Custom - Custom neede...
Definition jmgUtility.h:12000
When the object is created it will scale the objects health specified by the controller.
Definition jmgUtility.h:12012
Controller is required for the global speed system for all infantry on the map that have the object s...
Definition jmgUtility.h:12022
When a custom is received it will update the speed amount for the speed system \Custom - Custom neede...
Definition jmgUtility.h:12035
When the infantry is created it will update its movement speed to the global speed.
Definition jmgUtility.h:12047
Controller for the keycard system (Grants Renegade keycards to soldiers that have the soldier scirpt ...
Definition jmgUtility.h:9232
Adds a keycard to the list of keycards to be granted to any global keycard soldier (also grants to an...
Definition jmgUtility.h:9243
Adds a keycard to the list of keycards to be granted to any global keycard soldier (also grants to an...
Definition jmgUtility.h:9255
Removes a keycard to the list of keycards to be granted to any global keycard soldier (also removes f...
Definition jmgUtility.h:9269
The attached soldier will get and lose keycards whenever the global keycard system is updated or on s...
Definition jmgUtility.h:9281
Used to set the default extension for the global random model system \DefaultExtension - String to us...
Definition jmgUtility.h:11033
Updates all objects with JMG_Utility_Global_Set_Random_Model attached to use the new global extension...
Definition jmgUtility.h:11051
Sets a random model on create, makes use of the global extension \BaseName - Base model name in the r...
Definition jmgUtility.h:11065
Grants or removes a key on attach \Key - Key number to grant \Grant - 1 to grant, 0 to remove.
Definition jmgUtility.h:4772
Sends a custom when TimeInSeconds (on JMG_Utility_HUD_Count_Down) matches the TriggerTime,...
Definition jmgUtility.h:5403
Ties a gameObject to JMG_Utility_HUD_Count_Down \ Can be placed before JMG_Utility_HUD_Count_Down is ...
Definition jmgUtility.h:8271
Displays HUD messages once at each hour, 30 min, 20 min, 10 min, 5 4 3 2 1 min, 30 sec 10 9 8 7 6 5 4...
Definition jmgUtility.h:5217
Attaches a preset to the object while its total HitPoint Percent are inside a range (object is destro...
Definition jmgUtility.h:3873
Changes the model of an object when its total HitPoint Percent enters a range \LowerHitPointsPercent ...
Definition jmgUtility.h:3856
Creates a preset at the location specified while total HitPoint Percent are inside a range (object is...
Definition jmgUtility.h:3909
Enables a spawner while the HitPoint Percent is inside a range \LowerHitPointsPercent - Lower end of ...
Definition jmgUtility.h:3891
Sends a custom upon entering the HP range \LowerHitPointsPercent - Lower end of the range (percent of...
Definition jmgUtility.h:3930
Prevents JMG_Utility_In_Line_Of_Sight_Send_Custom from seening the attached object.
Definition jmgUtility.h:7370
Sends a custom when an enemy is in the line of sight, sends a custom again after no enemy in the crit...
Definition jmgUtility.h:7350
Script used to make placeable/building objects for infantry \WeaponPreset � Weapon that must be selec...
Definition jmgUtility.h:2695
Kills a unit if it doesn't manage to move more than the specified distance in the specified time \Tim...
Definition jmgUtility.h:6156
Sends a custom message when killed by a player from the player \ID - Id of the object to send the cus...
Definition jmgUtility.h:12136
Sends a custom message when killed by a player \ID - Id of the object to send the custom to,...
Definition jmgUtility.h:5841
Sends a custom message when killed by a specific PresetID \PresetID - Preset ID to detect \ID - Id of...
Definition jmgUtility.h:5873
Creates an object at the location where the attached was killed, removes old object at the second new...
Definition jmgUtility.h:6961
Drops an object on destroyed/killed/Detached (only drops once, whichever comes first) \Weapon - Weapo...
Definition jmgUtility.h:10070
Creates a powerup at the objects origin when it is killed, then turns the powerup into the parent obj...
Definition jmgUtility.h:11298
Gives money to the player that killed it \Money - Money to give.
Definition jmgUtility.h:6889
Sends the custom message from the object that killed the attached object \ID - Id of the object to se...
Definition jmgUtility.h:8141
Sends a custom message when killed from the killer \ID - Id of the object to send the custom to,...
Definition jmgUtility.h:12363
Sends the custom message from the itself when its killed by nothing \ID - Id of the object to send th...
Definition jmgUtility.h:11686
Sends a custom message when killed \ID - Id of the object to send the custom to, 0 sends to itself,...
Definition jmgUtility.h:12350
While this script is attached it will select the weapon in the player's inventory as long as they hav...
Definition jmgUtility.h:2724
Used to control a basic objective system \ShowMarkersOnRadar - Should stars be shown on the radar \Pr...
Definition jmgUtility.h:3543
Works just like JMG_Utility_Objective_System_Objective_Update_Custom except sends a custom if the obj...
Definition jmgUtility.h:9040
Same as JMG_Utility_Objective_System_Custom_Send_Custom_Pending but only sends if the objective is re...
Definition jmgUtility.h:9081
Sends a custom on a custom if the specified objective is not matching the defined status \Custom - Cu...
Definition jmgUtility.h:9124
Sends a custom on a custom if the specified objective is matching the defined status \Custom - Custom...
Definition jmgUtility.h:9058
Used to make an objective show up as failed \Custom - Custom to trigger this script \ObjectiveID - ID...
Definition jmgUtility.h:6050
Attached by the objective controller so the code can remove the object when needed \GameObjectID - ID...
Definition jmgUtility.h:888
Creates a game object at the location of the objective's objective marker while active \ObjectivePrio...
Definition jmgUtility.h:873
Changes the location/object of the objective system's marker \Custom - Custom to trigger on \Objectiv...
Definition jmgUtility.h:6867
This allows the objective system to search through all the game objects to find the object that is ne...
Definition jmgUtility.h:11601
Used to remove an objective on custom \Custom - Custom to trigger this script \ObjectiveID - ID of th...
Definition jmgUtility.h:4386
Used to update the status of an objective \Custom - Custom to trigger on \ObjectiveID - ID of the new...
Definition jmgUtility.h:6039
Used to update your objectives \NewObjectiveID - ID of the new objective to add \NewObjectiveStringID...
Definition jmgUtility.h:4367
Used to update your objectives \NewObjectiveID - ID of the new objective to add \NewObjectiveStringID...
Definition jmgUtility.h:3617
Used to update your objectives \NewObjectiveID - ID of the new objective to add \NewObjectiveStringID...
Definition jmgUtility.h:3564
Used to update your objectives \NewObjectiveID - ID of the new objective to add \NewObjectiveStringID...
Definition jmgUtility.h:3601
Used to update your objectives \NewObjectiveID - ID of the new objective to add \NewObjectiveStringID...
Definition jmgUtility.h:3586
Sends a custom once all objectives in the required list are complete, (Not instant,...
Definition jmgUtility.h:11317
Allows the visible marker, text color, and radar blip color to be overridden for a specific objective...
Definition jmgUtility.h:11654
Chooses an non-existant or removed objective from the provided list to send as a custom \Custom - Cus...
Definition jmgUtility.h:9102
Sets what bone the visible objective marker attaches to for the objective system \InfantryAttachBone ...
Definition jmgUtility.h:10710
Script is attached by JMG_Utility_PCT_Inaccessible_Zone, no need to do anything with this one.
Definition jmgUtility.h:2596
If the player is in this zone they won't be able to access any PCT defined by JMG_Utility_PCT.
Definition jmgUtility.h:2586
Works just like a normal PCT except you can definie zones with JMG_Utility_PCT_Inaccessible_Zone in w...
Definition jmgUtility.h:2574
Attach this script to the powerup of the weapon you wish not to be lost throughout the game \WeaponNa...
Definition jmgUtility.h:4201
Script used by JMG_Utility_Persistant_Weapon_Powerup.
Definition jmgUtility.h:4220
Script used by JMG_Utility_Persistant_Weapon_Powerup.
Definition jmgUtility.h:4210
Attaches a script to the soldier that picked up the powerup \Script - Script to attach \Params - Para...
Definition jmgUtility.h:6026
Switches what music is playing, you must have a JMG_Utility_Play_Music_On_Join_Controller on the map!...
Definition jmgUtility.h:2478
Plays music for a player on join, the music can be changed for all players by calling JMG_Utility_Pla...
Definition jmgUtility.h:2458
Switches what music is playing on custom, you must have a JMG_Utility_Play_Music_On_Join_Controller o...
Definition jmgUtility.h:4045
Switches what music is playing when an object enters the attached zone, you must have a JMG_Utility_P...
Definition jmgUtility.h:3486
Switches what music is playing when the attached object is killed, you must have a JMG_Utility_Play_M...
Definition jmgUtility.h:3498
Enables spawners when player count meets specified values, disables when outside of values \StartID -...
Definition jmgUtility.h:5468
Sends a custom when a player is seen, ignores team -4 (spec) and non-visible \ID - ID to send the cus...
Definition jmgUtility.h:8678
Grants a weapon and then destroys self on poke \Weapon - Weapon to grant \Rounds - Rounds in the gun,...
Definition jmgUtility.h:10056
Grants a weapon on poke \Weapon - Weapon to grant \Rounds - Rounds in the gun, -1 = infinite \Backpac...
Definition jmgUtility.h:12205
Sends a custom message on poke, also enables the pokable indicator icon, just like JMG_Utility_Poke_S...
Definition jmgUtility.h:7719
Sends a custom message on poke if the poker has a specified weapon, the message is sent from the poke...
Definition jmgUtility.h:10096
Sends a custom message on poke, also enables the pokable indicator icon \ID - ID to send the custom t...
Definition jmgUtility.h:4492
On Poke sends custom to self \Custom - Message to send when poked \Param - Param to send when poked \...
Definition jmgUtility.h:154
Requires all customs to be received before custom can be sent (unless the custom has a value of 0) \C...
Definition jmgUtility.h:4082
Regen's health via set health/shield strength instead of Apply_Damage, useful for infantry if you don...
Definition jmgUtility.h:3688
Removes a script while if the attached doesn't have a weapon, gives it back when they have the weapon...
Definition jmgUtility.h:11621
Removes a script while a character has a weapon, gives it back when they lose the weapon \WeaponName ...
Definition jmgUtility.h:10808
Resets screen color and opacity on object destruction.
Definition jmgUtility.h:2448
This script refunds damage on the attached object by a percentage of the number of players there are ...
Definition jmgUtility.h:3642
This script refunds damage on the attached object by a percentage of the number of players there are ...
Definition jmgUtility.h:3661
Scales the HP and armor of the object as players join/leave the match (if no players are in game the ...
Definition jmgUtility.h:7291
Only use this script once unless you want to risk crashing \Scale - Scale to set the infantry to.
Definition jmgUtility.h:3449
Fades the screen red when damage, mixes with colors provided by the swimming script and JMG_Utility_S...
Definition jmgUtility.h:5441
Builds a keypad using a model with bones named Number(0-9), Clear, and Enter, the buttons it creates ...
Definition jmgUtility.h:10732
Builds a keypad using a model with bones named Number(0-9), Clear, and Enter, the buttons it creates ...
Definition jmgUtility.h:10240
Takes model and replaces it with the number slot generated by JMG_Utility_Security_System_Random_Numb...
Definition jmgUtility.h:11355
Takes a string and replaces the delim with the code generated by JMG_Utility_Security_System_Random_N...
Definition jmgUtility.h:10317
Sends a custom if the unit doesn't manage to move more than the specified distance in the specified t...
Definition jmgUtility.h:7417
Sends a custom message on if a player holds a specified weapon within a range of the attached object ...
Definition jmgUtility.h:10125
Sends a custom when the object's armor hits zero and then again when it hits full \ID - ID to send th...
Definition jmgUtility.h:8377
Counts the deaths of any object with the reporter script attached, displays hud messages at a set int...
Definition jmgUtility.h:4917
Attach this to a zone and everytime a unit enters it it will increase the death tracking system,...
Definition jmgUtility.h:6877
Attach this to the objects you want the death tracking system applied to, requires JMG_Utility_Send_C...
Definition jmgUtility.h:4955
Sends a custom message when the player count condition is hit \PlayerCount - Player count to trigger ...
Definition jmgUtility.h:3340
Sends a custom whne the attached powerup is collected from the collector \ID - Id of the object to se...
Definition jmgUtility.h:8535
Sends a custom when the attached powerup is collected \ID - Id of the object to send the custom to,...
Definition jmgUtility.h:6365
Sends a custom message when a preset enters the zone \PresetName - preset to trigger on \ID - Id of t...
Definition jmgUtility.h:3397
Sends a custom when the count of presets on the map matches the player count \Preset_ID - Preset ID r...
Definition jmgUtility.h:7223
Sends a custom when the player count condition is hit \TriggerCustom - Custom to trigger the script o...
Definition jmgUtility.h:3366
Sends a custom when an object has been damaged over a specified amount, also can have a delay how oft...
Definition jmgUtility.h:5973
Sends the matching custom when the units HP drops below the ratio \TargetRatio - (Health+Armor)*THIS ...
Definition jmgUtility.h:12292
Sends a custom message when the attached object moves a distance from its initial spawn location \Dis...
Definition jmgUtility.h:12333
Sends a custom when an object gets near a building or moves away from a building \SendCustomObjectID ...
Definition jmgUtility.h:2946
Sends a custom message when no more objects of the preset name exist on the map, then removes itself ...
Definition jmgUtility.h:5720
Makes this unit ignored by JMG_Utility_Send_Custom_When_No_More_Units_On_Team_Exist \Ignore - Does no...
Definition jmgUtility.h:6127
Sends a custom message when no more objects on the specified team exist (ignores obelisk and agt) \Te...
Definition jmgUtility.h:5782
The attached object will be ignored from checks by JMG_Utility_Send_Custom_When_Not_Team_Zone.
Definition jmgUtility.h:8362
Sends a custom when any team but the specified team is in the zone (only checks smart game objects an...
Definition jmgUtility.h:8320
Sends a custom message when a player is detected between the min and max range \MinDistance - How clo...
Definition jmgUtility.h:8459
Sends a custom message when a player comes into range of this object \Distance - how far away can the...
Definition jmgUtility.h:6695
Sends a custom message when a player goes beyond a certain range of this object \Distance - how far a...
Definition jmgUtility.h:5742
Sends a custom message when a preset gets into range \Preset - Preset to detect \Range - Range to det...
Definition jmgUtility.h:5156
Sends a custom if the object's speed is below a certain amount \Speed - speed to watch for \Rate - ho...
Definition jmgUtility.h:6464
Sends a custom if the object's speed reaches or exceeds a certain amount \Speed - speed to watch for ...
Definition jmgUtility.h:6437
The attached object will be ignored from checks by JMG_Utility_Send_Custom_When_Team_Dominates_Zone.
Definition jmgUtility.h:8344
Sends a custom when the specified team holds the zone with more objects than all the other teams comb...
Definition jmgUtility.h:8207
The attached object will be ignored from checks by JMG_Utility_Send_Custom_When_Team_Zone.
Definition jmgUtility.h:8353
Sends a custom when the specified team is in the zone (only checks smart game objects and neutral is ...
Definition jmgUtility.h:8242
Sends a custom if the object's speed is below a certain amount when going a direction \MinVelocity[Fo...
Definition jmgUtility.h:6495
Sets the animation of an object to the frame specified on script attach \Animation - Animation to pla...
Definition jmgUtility.h:2532
Makes the attached object sync its animation frame to the object's clip count.
Definition jmgUtility.h:12190
Sets the objects bullet count when it is damaged or receives a custom \WeaponName - Name of the weapo...
Definition jmgUtility.h:6381
Locks the collision mode of an object on create \CollisionGroupID - ID of the collision mode to use.
Definition jmgUtility.h:4503
Sets the maximum distance an AI can wander before returning home (the location it was created) \Dista...
Definition jmgUtility.h:3784
Allows you to Enable/Disable an AI's Innate behavior on create \Enable - Should it be enabled.
Definition jmgUtility.h:3460
Switches the model to different models as the object is damaged (Hint: Use skeleton models to fully s...
Definition jmgUtility.h:2544
Switches the model to different models as the object is damaged (Hint: Use skeleton models to fully s...
Definition jmgUtility.h:2561
Will change the visibility of an object on custom for the specified player id \Custom - Custom to tri...
Definition jmgUtility.h:238
Sets the screen opacity and color of all people that join the game, also resets the screen fade for J...
Definition jmgUtility.h:5054
Switches the default screen color and opacity of the map on a custom and updates all players \Custom ...
Definition jmgUtility.h:5087
Updates the screen of the attached player when the object is created \Transition - how long to fade t...
Definition jmgUtility.h:5099
Fades the screen back to the values set by JMG_Utility_Set_Screen_Color_Fade_Controller for a specifi...
Definition jmgUtility.h:5110
Sets the skin type and armor type on a custom \Custom - Custom to trigger setting the armor and skin ...
Definition jmgUtility.h:3811
Allows you to Enable/Disable a soldiers damage animations \Enable - Should it be enabled.
Definition jmgUtility.h:3472
Sets an object team on attach \PlayerType - Player type to set the object to. \Delay - Amount of time...
Definition jmgUtility.h:2631
Sets the player type to -2 when no armor, sets player type back to the original player type when armo...
Definition jmgUtility.h:5762
Sets the Vehicle's collision to soldier ghost when all players exit (excluding on build) and then set...
Definition jmgUtility.h:6332
Controls setup and cleanup for the Silent countdown.
Definition jmgUtility.h:9337
Sends a custom when the time on JMG_Utility_Silent_Countdown matches the defined seconds on this scri...
Definition jmgUtility.h:9485
Sends a custom when the time on JMG_Utility_Silent_Countdown matches the defined seconds on this scri...
Definition jmgUtility.h:9462
A simplified script for mech walking animatons, use w3danimsound to provide synced walk sounds \Forwa...
Definition jmgUtility.h:5125
Soldier well enter the nearest vehicle on custom.
Definition jmgUtility.h:142
Needs to be placed on the map to make JMG_Utility_Spawn_With_Last_Selected_Gun_Player work.
Definition jmgUtility.h:6731
Tells the game that this weapon shouldn't be used with the JMG_Utility_Spawn_With_Last_Selected_Gun s...
Definition jmgUtility.h:11636
When attached to a player preset, it tracks what weapon the player was holding when they died and tri...
Definition jmgUtility.h:6761
This script allows a AI soldier to swim when in a swimming zone. Attached by JMG_Utility_Swimming_Inf...
Definition jmgUtility.h:10822
This script allows an AI soldier to swim when in a swimming zone. Attached by JMG_Utility_Swimming_In...
Definition jmgUtility.h:11078
Adds all defined weapons of a specific hold style to the JMG_Utility_Swimming_Infantry_Advanced_Contr...
Definition jmgUtility.h:8060
Adds a weapon to JMG_Utility_Swimming_Infantry_Advanced_Controller \WeaponGroupID - Weapon Group to a...
Definition jmgUtility.h:8075
Script must be placed on the map in order to control the advanced swimming scripts.
Definition jmgUtility.h:7817
This script allows a soldier to swim when in a swimming zone. \ If using my swimming animations make ...
Definition jmgUtility.h:7983
This script allows a soldier to swim when in a swimming zone. Weapon that is granted should use the L...
Definition jmgUtility.h:2806
Used to trigger the simple swimming animation system this is to be used along side JMG_Utility_Swimmi...
Definition jmgUtility.h:2749
Used to set the default fog values of the map if there is no water but there are soldiers with the sw...
Definition jmgUtility.h:2734
Selects empty hands on create, the weapon it was holding before script attach is counted as the prima...
Definition jmgUtility.h:3795
Makes a unit switch its gun to a secondary gun whenever the ammo count in its primary clip runs out \...
Definition jmgUtility.h:2929
Syncs the current animation with any players that join, this is useful if you see objects slowly slid...
Definition jmgUtility.h:12179
Sets the level's fog on create, after that point its used to sync up any player that joins with the c...
Definition jmgUtility.h:12147
Updates the fog controller's fog settings \Custom - Custom to watch for \Min - Min range of the fog \...
Definition jmgUtility.h:12165
Syncs the health of an object with the ID of the object specified, object is destroyed if id object d...
Definition jmgUtility.h:5040
Syncs object positions between the client and the server \Sync_Rate - How often does this object send...
Definition jmgUtility.h:2148
Controls all objects that have the script JMG_Utility_Sync_System_Object \Sync_Rate - Speed at which ...
Definition jmgUtility.h:2132
An object that will have its position synced by JMG_Utility_Sync_System_Controller.
Definition jmgUtility.h:2111
Teleports a unit to a different location if it hasn't moved for X seconds \Seconds - Time before it m...
Definition jmgUtility.h:11017
Teleports a player to a location when they pickup a powerup, will move the player within the range de...
Definition jmgUtility.h:3422
Changes the model of any soldier that enters the zone \Time - delay to send the custom \NewModel - W3...
Definition jmgUtility.h:6299
Changes the model of any soldier that enters the zone \Time - delay to send the custom \NewModel - W3...
Definition jmgUtility.h:6274
Basically exactly the same as JMG_Utility_Timer_Custom but with a random delay \Time - delay to send ...
Definition jmgUtility.h:8784
Basically exactly the same as JFW_Timer_Custom except an id of 0 sends to itself \Time - delay to sen...
Definition jmgUtility.h:6237
Damages the attached object and teleports it after a timed delay \Delay - Amount of time in seconds t...
Definition jmgUtility.h:5651
Kills an object after a time period of not being damaged, damage resets the countdown \Time - How lon...
Definition jmgUtility.h:10912
Forces the attached object to scan for enemies more often (server's default rate has a random of 0....
Definition jmgUtility.h:7380
Just like JFW_Toggle_Door except you can't toggle during transition, and the switch object can also b...
Definition jmgUtility.h:2513
Toggles flight after delay completes \Delay - Time to wait before toggling flight.
Definition jmgUtility.h:3713
Controls if JMG_Utility_Turret_Spawn_Global_Flag can attach turrets \Custom - Custom to flip if attac...
Definition jmgUtility.h:10874
Attaches turret as long as the global flag is true otherwise is ignored \Turret_Preset - Preset of th...
Definition jmgUtility.h:10894
Basic turret attach script, turrets match team of vehicle attached to, turrets are destroyed by destr...
Definition jmgUtility.h:12417
Use this script to get AI back out of the ground \Distance - Max distance to try to move the infantry...
Definition jmgUtility.h:4430
Sends a custom to an object on entry from the enterer \PlayerType - Player type the zone triggers for...
Definition jmgUtility.h:8637
Used to apply damage to an object id or the object that entered the zone, damager is the script zone ...
Definition jmgUtility.h:2882
Changes the model of any soldier that enters the zone \NewModel - W3D Model to change it to \PlayerTy...
Definition jmgUtility.h:6256
Changes the soldier's preset on enter if the original preset matches \EntererPreset - required preset...
Definition jmgUtility.h:5026
Used by JMG_Utility_Zone_Create_Object_While_Occupied, ignore otherwise.
Definition jmgUtility.h:12240
Used by JMG_Utility_Zone_Create_Object_While_Occupied, ignore otherwise.
Definition jmgUtility.h:12250
Creates an object while at least object is in a zone \Preset - Preset to create \Location - Spot to c...
Definition jmgUtility.h:12220
Used to damage all objects in an id range on enter \StartID - ID to start at \EndID - ID to stop at \...
Definition jmgUtility.h:3829
Used to enable or disable all spawners within an ID range on zone enter \StartID - ID to start at \En...
Definition jmgUtility.h:2850
Fades the screen of a specific player \Color - color to fade to (if Red (X) is set to less than 0 col...
Definition jmgUtility.h:5417
Sends a custom to an object on entry from the enterer \PlayerType - Player type the zone triggers for...
Definition jmgUtility.h:8550
Sends a custom to an object on entry if the preset matches \Preset - Preset required \PlayerType - Pl...
Definition jmgUtility.h:10427
Sends a custom to an object on entry \PlayerType - Player type the zone triggers for \ID - ID to send...
Definition jmgUtility.h:4153
Sends a custom to an object on exit \PlayerType - Player type the zone triggers for \ID - ID to send ...
Definition jmgUtility.h:6581
Sends a custom if the object entering the zone has a weapon \PlayerType - Player type the zone trigge...
Definition jmgUtility.h:5668
Sends a custom if the object entering the zone has a weapon, one custom is sent for each ammo count t...
Definition jmgUtility.h:5930
Sends a custom if the object entering the zone has a weapon \PlayerType - Player type the zone trigge...
Definition jmgUtility.h:4065
Sends a custom if the object entering the zone does not have a weapon \PlayerType - Player type the z...
Definition jmgUtility.h:4280
Attached by JMG_Utility_Zone_Send_Custom_On_Player_Occupation_Change.
Definition jmgUtility.h:9328
Sends a custom when the zone becomes occupied by a player and then sends a custom again when its vaca...
Definition jmgUtility.h:9300
Sends a custom to all objects with the specified script attached, sender is the enter \PlayerType - P...
Definition jmgUtility.h:3844
Sets the animation of an object when the script zone is entered \ObjectID - ID of the object to anima...
Definition jmgUtility.h:3438
Changes the player's team to the value specified, then kills the player, finally subtracting 1 from t...
Definition jmgUtility.h:4475
Changes the player's team the value \RequiredPlayerTeam - Player team that the player has to be in or...
Definition jmgUtility.h:4350
Changes the player type of the player's game object (not the player's team) \RequiredPlayerType - Pla...
Definition jmgUtility.h:4135
Used to enable or disable a spawner, allows you to only have it trigger the script once \SpawnerID - ...
Definition jmgUtility.h:4189
Used by JMG_Utility_Zone_Teleport_To_Random_Wander_Point.
Definition jmgUtility.h:10215
Teleports the object that enters the zone to a wander point that isn't visible to players \WanderingA...
Definition jmgUtility.h:10196
Marks this object as a boss object for the JMG_Utility_Zone_Teleport_To_Random_WP_Boss script,...
Definition jmgUtility.h:9523
Teleports the object that enters the zone to a random wander point furthest from a boss object \Wande...
Definition jmgUtility.h:9501
Used by JMG_Utility_Zone_Teleport_To_Random_Wander_Point.
Definition jmgUtility.h:4120
Teleports the object that enters the zone to a random wander point \WanderingAIGroupID - Group of poi...
Definition jmgUtility.h:4101