Official Fulqrum Publishing forum

Official Fulqrum Publishing forum (http://forum.fulqrumpublishing.com/index.php)
-   FMB, Mission & Campaign builder Discussions (http://forum.fulqrumpublishing.com/forumdisplay.php?f=203)
-   -   Spawn Point Script 0 (http://forum.fulqrumpublishing.com/showthread.php?t=25383)

Troll2k 08-12-2011 10:24 PM

Spawn Point Script 0
 
What is Spawn Point Script 0?

What is it used for?

How do you use it?

ATAG_Bliss 08-13-2011 07:24 PM

Quote:

Originally Posted by Troll2k (Post 323161)
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 (Post 312513)
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


Lookaloft 08-20-2011 02:49 PM

Insert script
 
How can I insert scripts in scripts window?

FG28_Kodiak 08-20-2011 03:25 PM

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.

Lookaloft 08-21-2011 09:49 AM

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.


All times are GMT. The time now is 11:15 AM.

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