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 05-01-2012, 09:46 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

You must add an 'action part' to the OnTrigger in the script, at the moment there is none. (pure radar script)
Code:
AiAction action = GamePlay.gpGetAction(shortName);
        if (action != null)
            action.Do();
Its always nessesary if OnTrigger is overriden.

Last edited by FG28_Kodiak; 05-02-2012 at 02:31 AM.
Reply With Quote
  #2  
Old 05-01-2012, 09:54 PM
5./JG27.Farber 5./JG27.Farber is offline
Approved Member
 
Join Date: Aug 2011
Posts: 1,958
Default

ahh I used this:

http://forum.1cpublishing.eu/showthread.php?t=28454

by you


It didnt mention .cs file. So when I put in the new .cs I deleted it?
Reply With Quote
  #3  
Old 05-02-2012, 02:30 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Only if OnTrigger is overriden if not you dont need to add the action part, in the script i use OnTrigger to detect the destruction of a radar via trigger.
Code:
public override void OnTrigger(int missionNumber, string shortName, bool active)
    {
        base.OnTrigger(missionNumber, shortName, active);
        
        if (shortName.StartsWith("Radar") && shortName.EndsWith("Destroyed"))
        {
            GamePlay.gpLogServer(null, "Radar destroyed", null); //testing only

            Headquarters.ForEach(item =>
                {
                    item.SetObserverInactive(shortName);
                });
        }

    }
So if you use Actions you must add
Code:
AiAction action = GamePlay.gpGetAction(shortName);
        if (action != null)
            action.Do();
to get them to work.

So the Ontrigger should look like:
Code:
public override void OnTrigger(int missionNumber, string shortName, bool active)
    {
        base.OnTrigger(missionNumber, shortName, active);
        
        if (shortName.StartsWith("Radar") && shortName.EndsWith("Destroyed"))
        {
            GamePlay.gpLogServer(null, "Radar destroyed", null); //testing only

            Headquarters.ForEach(item =>
                {
                    item.SetObserverInactive(shortName);
                });
        }

        AiAction action = GamePlay.gpGetAction(shortName);
        if (action != null)
            action.Do();
    }
Reply With Quote
  #4  
Old 05-02-2012, 09:15 AM
5./JG27.Farber 5./JG27.Farber is offline
Approved Member
 
Join Date: Aug 2011
Posts: 1,958
Default

ok so all the "ontrigger parts" go together.
Reply With Quote
  #5  
Old 05-03-2012, 12:34 PM
5./JG27.Farber 5./JG27.Farber is offline
Approved Member
 
Join Date: Aug 2011
Posts: 1,958
Default

I tried putting that piece of code in and it didnt work
Reply With Quote
  #6  
Old 05-03-2012, 01:14 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Must make some tests, but i am too busy at the moment.
Reply With Quote
  #7  
Old 05-03-2012, 01:18 PM
5./JG27.Farber 5./JG27.Farber is offline
Approved Member
 
Join Date: Aug 2011
Posts: 1,958
Default

I understand. I will wait patiently.
Reply With Quote
Reply

Thread Tools
Display Modes

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 02:48 PM.


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