Log in

View Full Version : need help with script


Megahurt
12-20-2011, 06:50 PM
Ive tried and tried but i cant get it right...

I have a trigger in the mission called "PlayerGetsClose"
when blue army passes through it becomes active.
Its suppossed to load a mission file called dovertrains.mis
the path is missions\dogfights\DoverTrains\red


There is a second trigger called "Sheernes"
when blue army passes through it becomes active.
Its suppossed to load a mission file called sheernes.mis.
the path is missions\dogfights\DoverTrains\red

Can anyone right this cs file for me? Ive tried to copy others and edited but i keep getting errors.

Please help.

Megahurt

FG28_Kodiak
12-20-2011, 07:08 PM
using System;
using System.Collections;
using System.Collections.Generic;
using maddox.game;
using maddox.game.world;

public class Mission : AMission
{

public override void OnBattleStarted()
{
base.OnBattleStarted();

MissionNumberListener = -1;
}



public override void OnTrigger(int missionNumber, string shortName, bool active)
{
base.OnTrigger(missionNumber, shortName, active);


if ("PlayerGetsClose".Equals(shortName))
{
GamePlay.gpPostMissionLoad(@"missions\dogfights\DoverTrains\red\dovertrains.mis");
GamePlay.gpGetTrigger(shortName).Enable = false;
}

if ("Sheernes".Equals(shortName))
{
GamePlay.gpPostMissionLoad(@"missions\dogfights\DoverTrains\red\sheernes.mis");
GamePlay.gpGetTrigger(shortName).Enable = false;
}
}
}

Megahurt
12-20-2011, 08:26 PM
Thanks Kodiak
Hopefully others wanting to do the same can copy this as a template for a simple script that can be easily edited to suit.

Much appreciated.

Megahurt

FG28_Kodiak
12-20-2011, 08:53 PM
Oh they will get a complete tutorial about this in the near future ;)