View Single Post
  #2  
Old 03-19-2012, 07:03 PM
Smokeynz Smokeynz is offline
Approved Member
 
Join Date: Apr 2011
Posts: 106
Default

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();      

         }

    }

}

Last edited by Smokeynz; 03-19-2012 at 07:46 PM.
Reply With Quote