Post: Actor wave instantly freezing
11-23-2015, 03:20 AM #1
BullyWiiPlaza
Climbing up the ladder
(adsbygoogle = window.adsbygoogle || []).push({}); Just wondering why the actor wave a.k.a. mexican wave script instantly freezes me when executed/clicked on in the mod menu. What could be the cause? I did precache the defaultactor model:
    precacheModel("defaultactor");


The default actor wave script is as follows:
    mexicanWave()
{
if(isDefined(level.mexicanWave))
{
array_delete(level.mexicanWave);
level.mexicanWave=undefined;
return;
}
self iPrintln("Actor Wave ^2ON");
level.mexicanWave=spawnMultipleModels((self.origin+(0,180,0)),1,10,1,0,-25,0,"defaultactor",(0,180,0));
for(m=0;m<level.mexicanWave.size;m++)
{
level.mexicanWave[m] thread mexicanMove();
wait .1;
}
}
mexicanMove()
{
self endon("disconnect");
level endon("game_ended");
while(isDefined(self))
{
self moveZ(80,1,.2,.4);
wait 1;
self moveZ(-80,1,.2,.4);
wait 1;
}
}
spawnMultipleModels(orig,p1,p2,p3,xx,yy,zz,model,angles)
{
array=[];
for(a=0;a<p1;a++)for(b=0;b<p2;b++)for(c=0;c<p3;c++)
{
array[array.size]=spawnSM((orig[0]+(a*xx),orig[1]+(b*yy),orig[2]+(c*zz)),model,angles);
wait .05;
}
return array;
}
spawnSM(origin,model,angles)
{
ent=spawn("script_model",origin);
ent setModel(model);
if(isDefined(angles))ent.angles=angles;
return ent;
}
array_Delete(array)
{
self iPrintln("Actor Wave ^1OFF");
for(i=0;i<array.size;i ++)
{
array[i] delete();
}
}
(adsbygoogle = window.adsbygoogle || []).push({});
11-26-2015, 03:08 PM #2
anthonything
Space Ninja
Probably an issue with the menu execution its self. Seems to check out syntactically; The best way to debug a function is to try bit by bit, for example, commenting out most of the lines and checking proper execution through isolation. So, first, make sure toggle works, then the spawning, then the movement, etc. Eventually when adding back, you will freeze again and then youve found the issue. Good luck.
11-26-2015, 03:52 PM #3
BullyWiiPlaza
Climbing up the ladder
Originally posted by anthonything View Post
Probably an issue with the menu execution its self. Seems to check out syntactically; The best way to debug a function is to try bit by bit, for example, commenting out most of the lines and checking proper execution through isolation. So, first, make sure toggle works, then the spawning, then the movement, etc. Eventually when adding back, you will freeze again and then youve found the issue. Good luck.

Okay, that's the tedious but working way i guess. If nobody knows or can imagine the root cause of this, I might do what you said. Smile
11-26-2015, 04:50 PM #4
jwm614
NextGenUpdate Elite
Originally posted by BullyWiiPlaza View Post
Okay, that's the tedious but working way i guess. If nobody knows or can imagine the root cause of this, I might do what you said. Smile


its the movez
11-26-2015, 05:05 PM #5
BullyWiiPlaza
Climbing up the ladder
Originally posted by jwm614 View Post
its the movez

Okay, which replacement function would you use that works flawlessly?
11-26-2015, 05:21 PM #6
jwm614
NextGenUpdate Elite
Originally posted by BullyWiiPlaza View Post
Okay, which replacement function would you use that works flawlessly?

Remove the .2,.4 an try it it shoukd not freeze
         self moveZ(80,1);
wait 1;
self moveZ(-80,1);
wait 1;

The following user thanked jwm614 for this useful post:

BullyWiiPlaza
12-03-2015, 06:37 PM #7
BullyWiiPlaza
Climbing up the ladder
Originally posted by jwm614 View Post
Remove the .2,.4 an try it it shoukd not freeze
         self moveZ(80,1);
wait 1;
self moveZ(-80,1);
wait 1;

This works perfectly, you're the boss. Great job Smile

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo