Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > FMB, Mission & Campaign builder Discussions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 03-19-2012, 08: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 08:46 PM.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:26 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.