Monster Spawning script error

Discuss all aspects related to modding Zandronum here.
Post Reply
Flaminglacier
 
Posts: 65
Joined: Thu Jun 21, 2012 9:28 pm

Monster Spawning script error

#1

Post by Flaminglacier » Sun Jun 29, 2014 2:28 am

I am having a Runaway script error whenever I happen to activate this script:

Code: Select all

  script 99 (void)//Monster invasion
    {
    setmusic("D_LAVO");
    changesky("SKY66","SKY66");
    Thing_Activate(101);
    ChangeCamera(101, 0, 0);
    delay(100);
    Floor_RaiseByValue (99, 5, 64);
    Radius_Quake (6, 120, 5, 200, 100);
    delay(180);
    SpawnSpot ("Hell-o", 100, 165);
SpawnSpot ("TeleportFog", 100);
    SetFont("BIGFONT");
    HudMessageBold(s:"Dear guests of the DMU HQ. Prepare to meet your doom!"; HUDMSG_TYPEON, 0,CR_RED, 0.5, 0.4, 0.0, 0.028, 10.0);
    delay(180);
    SpawnSpot ("shotgunguy", 65, 65);
    SpawnSpot ("TeleportFog", 65, 65);
    delay(150);
     ChangeCamera(0, 1, 0);
    delay(380);
       SpawnSpot ("Baronofhell", 65, 65);
    SpawnSpot ("TeleportFog", 65, 65);
    While(ThingCountName("Hell-o", 165) > 0)
     HudMessageBold(s:"Don't think this is over..."; HUDMSG_TYPEON, 0,CR_RED, 0.5, 0.4, 0.0, 0.028, 10.0);
    }
    
It seems to happ after the Camera changes back to the players view right after spawning the former sergeants. Any clue why the script ends up causing an error and lagging the entire game?

Also while it lags the game it appears to run the hudmessagebold that is suppose to occur when Hell-o dies.
Last edited by Flaminglacier on Sun Jun 29, 2014 2:29 am, edited 1 time in total.
Image

User avatar
-Jes-
Frequent Poster Miles card holder
Posts: 975
Joined: Fri Aug 03, 2012 9:55 am
Location: Void Zone

RE: Monster Spawning script error

#2

Post by -Jes- » Sun Jun 29, 2014 4:20 am

You're using While wrong - it has no delay, and as such repeats the hudmessagebold line ad infinitum.

ZDoom Wiki: FOR and WHILE loops.

Post Reply