PDA

View Full Version : Script Spawn?


SEE
05-16-2011, 08:21 AM
Can anyone provide information regards how to use the Script Spawning feature and the function of the script text box?

MadTommy
05-16-2011, 10:31 AM
Can anyone provide information regards how to use the Script Spawning feature and the function of the script text box?

Here is a thread about using it for a delayed spawn.. explains quite a bit.

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

SEE
05-16-2011, 11:00 AM
Cheers Madtommy, that will get me started (maybe that thread should be moved here).

SEE
05-17-2011, 08:41 AM
Passthrough and Time are working Ok as triggers to spawn airgroups but I am struggling with the following:-


1. Destruction of Ground Target or Ground Objects to trigger spawns. The targets/objects are recognsied in the menu but their destruction does not trigger the assigned Airgroup to spawn, (Script c enabled in AG properties)

2. From what I can see only Airgroups are available in the dropdown Action menu. Has anyon manged to get Ground units (armour) to spawn?

Many thanks......

Ataros
05-17-2011, 02:11 PM
2. From what I can see only Airgroups are available in the dropdown Action menu. Has anyon manged to get Ground units (armour) to spawn?

Many thanks......

Not implemented in the FMB atm, but you can do it with a script somehow.using System;
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))
{
GamePlay.gpPostMissionLoad("path to your mission files");
GamePlay.gpGetTrigger(shortName).Enable = true;
}

}
}

"trigger" is the name of your trigger in FMB I guess.
The script loads a submission with whatever units you want into your current mission based on trigger. I did not try it yet.