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 08-12-2011, 11:24 PM
Troll2k Troll2k is offline
Approved Member
 
Join Date: Dec 2007
Posts: 722
Default Spawn Point Script 0

What is Spawn Point Script 0?

What is it used for?

How do you use it?
Reply With Quote
  #2  
Old 08-13-2011, 08:24 PM
ATAG_Bliss ATAG_Bliss is offline
Approved Member
 
Join Date: Mar 2010
Posts: 1,156
Default

Quote:
Originally Posted by Troll2k View Post
What is Spawn Point Script 0?

What is it used for?

How do you use it?
I think it actually means SpawnPoint ScriptOn (with the n cut off)

Basically this is to spawn AI (planes/tanks etc.) at different times from mission start. If you don't check the SpawnPoint ScriptOn that group of AI (regardless if you have them scripted in or not) will all spawn on mission startup. So you make a trigger with TTime (for time delay - as an example) and an action for that trigger (spawn air group - to spawn AI planes) and from that action you choose the airgroup (similar to setting a target with the FMB - the target recticle will show up and you can hover over the spawn point for w/e airgroup you want to spawn) and then you put the scripts in the scripts window. In that window you can also left click and "compile" to check to see your script is ok.

Here's a tidbit from Kodiac that taught me how it works:
Quote:
Originally Posted by FG28_Kodiak View Post
You can also script a Mission with C#
for example to spawn the airgroup with a script
Make a trigger with name "SpawnAirgroup1" and a action "Airgroup1" and insert following code in the script window.

Code:
using System;
using maddox.game;
using maddox.game.world;


public class Mission : maddox.game.AMission
{
    
    public override void OnTrigger(int missionNumber, string shortName, bool active) 
    {
       base.OnTrigger(missionNumber, shortName, active); 

          if ("SpawnAirgroup1".Equals(shortName) && active) 
          { 
                AiAction action = GamePlay.gpGetAction("Airgroup1");
                if (action != null)
                {
                     action.Do();
                }
                GamePlay.gpHUDLogCenter("Spitfires near");      
                GamePlay.gpGetTrigger(shortName).Enable = false;            
          }
    }
}
With scripts you are much more flexible.

I've made tutorials about scripting in german (my english is to bad ):
http://forum.sturmovik.de/index.php/topic,689.0.html
http://forum.sturmovik.de/index.php/topic,695.0.html
http://forum.sturmovik.de/index.php/topic,699.0.html
http://forum.sturmovik.de/index.php/topic,711.0.html
http://forum.sturmovik.de/index.php/topic,721.0.html
http://forum.sturmovik.de/index.php/topic,727.0.html
http://forum.sturmovik.de/index.php/topic,764.0.html
__________________

ATAG Forums + Stats
Reply With Quote
  #3  
Old 08-20-2011, 03:49 PM
Lookaloft Lookaloft is offline
Approved Member
 
Join Date: Dec 2010
Posts: 38
Default Insert script

How can I insert scripts in scripts window?
Reply With Quote
  #4  
Old 08-20-2011, 04:25 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Copy the script with CTRL+C, click in the script window and paste it with CTRL+V.
You can also create a txt-file, paste the text, then save the txt under the same name as the mission with a .cs.
For example if you have a mission MyMission.mis then you must name the Script file MyMission.cs. The advantage of this method is that you can use better editors like Notepad++ or if you like MS Visual C# Express.
Reply With Quote
  #5  
Old 08-21-2011, 10:49 AM
Lookaloft Lookaloft is offline
Approved Member
 
Join Date: Dec 2010
Posts: 38
Default Insert Script

Thanks very much Kodiak for your help. Now I successfully launched an example mission from your Mission Editor “Scripting for Dummies”. Got the message: “Ziel erreicht” as four Emils did their job quite well.
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 12:17 AM.


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