new trigger features: triponce, tripcondition, and trippedby.

once fires off callbacks one time,
condition lets you plug in an a==b, or method that returns a true/false;
 trippedby lets us plug in things like $TypeMasks::PlayerObjectType ( ac39577543/Engine/source/T3D/gameFunctions.cpp (L658) ) so that *only* players can trigger it
This commit is contained in:
AzaezelX 2020-09-04 19:29:50 -05:00
parent 93ce5d0cfa
commit 91ff953c19
2 changed files with 99 additions and 11 deletions

View file

@ -83,6 +83,11 @@ class Trigger : public GameBase
U32 mCurrTick;
Convex *mConvexList;
bool mTripOnce;
bool mTripped;
S32 mTrippedBy;
String mTripCondition;
String mEnterCommand;
String mLeaveCommand;
String mTickCommand;
@ -105,6 +110,9 @@ class Trigger : public GameBase
static bool smRenderTriggers;
bool testObject(GameBase* enter);
bool testTrippable();
bool testCondition();
bool evalCmD(String*);
void processTick(const Move *move);
void interpolateTick(F32 delta);
@ -113,7 +121,6 @@ class Trigger : public GameBase
static bool setEnterCmd(void *object, const char *index, const char *data);
static bool setLeaveCmd(void *object, const char *index, const char *data);
static bool setTickCmd(void *object, const char *index, const char *data);
public:
Trigger();
~Trigger();
@ -168,5 +175,20 @@ inline GameBase* Trigger::getObject(const U32 index)
return mObjects[index];
}
#define AI_NAVCHOICES 8
class AITrigger : public Trigger
{
typedef Trigger Parent;
public:
AITrigger();
~AITrigger();
StringTableEntry mWaypoints[AI_NAVCHOICES];
S32 mProbability[AI_NAVCHOICES];
static void initPersistFields();
// SimObject
DECLARE_CONOBJECT(AITrigger);
};
#endif // _H_TRIGGER