View Single Post
  #150  
Old 05-23-2011, 06:12 PM
Flashman Flashman is offline
Approved Member
 
Join Date: May 2010
Posts: 109
Default

Im trying different things with these scripts by picking through other peoples. I have been trying various methods to ensure missions repeat, though so far they only repeat once for some reason.

Anyway instead of using the tick counter i have been looking at the init time settings people have been using. If i understand it correctly this allows a certaqin number of seconds to pass before carrying out whatever command you set.

This is a test script I am having problems with:

PHP Code:
 using System;
using maddox.game;
using maddox.game.world;
using System.Collections.Generic;

public class 
Mission AMission
{
     public 
override void OnTickGame() 
    {
     
double initTime 0.0;

      
Timeout(initTime += 60, () =>
    
            {    
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/Channelv1/BM2/sb1d.mis");    
                
GamePlay.gpHUDLogCenter("Intel: Stuka raid 1XXX inbound at Angels 13, heading W"); 
            });

        }

The purpose of the script is to run this mission (sb1d) 60 seconds after the script starts. It also has to only run the mission once. In this case the mission consists of a single AI stuka spawning, flying and then landing. Like I say, a simple test mission.

However when I test the mission, endless stukas spawn and blow each other up, in other words far more than 1!!!!

I have no idea about scripts, I have been picking bits out of other peoples, inserting them, hitting 'compile' and then testing the effects in game. I would be grateful if anyone can have a look and see where I am going wrong.
Reply With Quote