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

Reply
 
Thread Tools Display Modes
  #1  
Old 12-16-2011, 08:33 AM
Pato Salvaje's Avatar
Pato Salvaje Pato Salvaje is offline
Approved Member
 
Join Date: Jan 2010
Posts: 123
Default

Thank you very much sir. Great tutorial. Keep it coming.
I have to test if a group with "script spawn C" selected can be flight by a human pilot...
And if this group can have only a "takeoff waypoint"...
__________________
Phenom II X4 970 3,5 Ghz, Gigabyte 890GPA UD3H, 4GB RAM GSKILL RIP-JAWS 1333, Gigabyte 560Ti OC 1GB, W7 64
Reply With Quote
  #2  
Old 12-16-2011, 10:16 AM
WarFox101 WarFox101 is offline
Approved Member
 
Join Date: Dec 2011
Posts: 21
Default

OK works great, however the spawning aircraft keep spawning There must have been 50 on the ground waiting to take off.
Reply With Quote
  #3  
Old 12-16-2011, 10:52 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by WarFox101 View Post
OK works great, however the spawning aircraft keep spawning There must have been 50 on the ground waiting to take off.
I suspect the trigger "works" for every aircraft in a group. Had this issue in R2 mission, had to include in a script a variable TriggerOn = 1 every time trigger "worked" and then check if TriggerOn = 1 or = 0 regularly.
Reply With Quote
  #4  
Old 12-16-2011, 02:25 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

You can use this script to avoid 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);

        AiAction Action = GamePlay.gpGetAction(shortName);

        if (Action != null)
            Action.Do();
        
        GamePlay.gpGetTrigger(shortName).Enable = false;
    }
}
Reply With Quote
  #5  
Old 12-16-2011, 09:56 PM
335th_GRAthos 335th_GRAthos is offline
Approved Member
 
Join Date: Oct 2007
Posts: 1,240
Default

Awesome!

Thanks guys for these postings!



~S~
Reply With Quote
  #6  
Old 12-16-2011, 11:30 PM
WarFox101 WarFox101 is offline
Approved Member
 
Join Date: Dec 2011
Posts: 21
Default

Thanks FG28_Kodiak looks good, ill try it out and see how it works.
Reply With Quote
  #7  
Old 05-27-2012, 01:20 PM
Freyah's Avatar
Freyah Freyah is offline
Approved Member
 
Join Date: May 2012
Posts: 8
Default

@Kodiak, I'm looking at the script you posted to nullify multiple spawn events:
Quote:
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;
}
}
If I have at trigger to spawn 109's (called "109") and only want them to spawn once, no matter how many times I fly through the trigger zone, should It be done with your script by just putting "109" where ever (shortname) appears? Do I just write for example - public override void OnTrigger(int missionNumber, string 109, bool active) etc or is there something to be entered for missionNumber and bool active? (possibly Amission too?) Also is it possible to do this for several triggers in one mission by just repeating the script in its entirety one after another?

Hope its no trouble to ask, I'm just learning the ropes here....

cheers
Freyah
Reply With Quote
  #8  
Old 05-27-2012, 01:32 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

You get the triggername via shortName.
So you can check the trigger with a if clause.

OnTrigger(..) should look like:
Code:
   public override void OnTrigger(int missionNumber, string shortName, bool active)
    {
        base.OnTrigger(missionNumber, shortName, active);


        if ("109".Equals(shortName))
        {
            AiAction Action = GamePlay.gpGetAction(shortName); // if your action has an other Name than your trigger change GamePlay.gpGetAction(shortName) into GamePlay.gpGetAction("ActionName")

            if (Action != null)
                Action.Do();

            GamePlay.gpGetTrigger(shortName).Enable = false; // if trigger is TPassThru to avoid multiple activation

            return; // leave method to avoid second call of the Action
        }


        AiAction Action = GamePlay.gpGetAction(shortName); 

        if (Action != null)
            Action.Do();
        GamePlay.gpGetTrigger(shortName).Enable = false;
        
    }
Reply With Quote
Reply


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 11:19 AM.


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