Ai will interfere with player detection, players are actors aswell.
However I believe actions are for ai actions, for players you need another piece
This bit enables resetting of a trigger , true to keep alive, false to turn off
People use the false to stop double activation
GamePlay.gpGetTrigger(shortName).Enable = false;
However asking this if("trigger".Equals(shortName)) also looks for the trigger in both true and false states.
Listing as if("trigger".Equals(shortName) && Active) will look for true trigger in true only.
Because you are basically always using the trigger to activate the code you might find you also need a reference to the trigger, so may have to combine the 2 methods following
Re quote from Kodiak
Code:
using System;
using System.Collections;
using System.Collections.Generic;
using maddox.game;
using maddox.game.world;
public class Mission : AMission
{
public override void OnTrigger(int missionNumber, string shortName, bool active)
{
base.OnTrigger(missionNumber, shortName, active);
AiAction Action = GamePlay.gpGetAction(shortName);
if (Action != null)
Action.Do();
GamePlay.gpGetTrigger(shortName).Enable = false;
}
}
Try this
Code:
using System;
using System.Collections;
using System.Collections.Generic;
using maddox.game;
using maddox.game.world;
public class Mission : AMission
{
public override void OnTrigger(int missionNumber, string shortName, bool active)
{
base.OnTrigger(missionNumber, shortName, active);
if("trigger".Equals(shortName) && Active)
{
GamePlay.gpPostMissionLoad("missions/etc/etc/MissionName.mis"); // load sub mission as result of player
AiAction Action = GamePlay.gpGetAction(shortName); // note this shortname is action shortname and ai response
if (Action != null)
Action.Do();
}
}
}