Back to the Vavoom Forum Archives


Forum

Strange acs_terminate glitch

Wed, 17 Jan 2007 02:35:39

The 4th Class

In short, here's what I'm doing:
// Let's say this is MAP01

script 1 OPEN
{
	many things 1;
	delay(35);
	many things 2;
	delay(35);
	many things 3;
	delay(35);
	...
	many things 16;
	delay(35);
	restart;
}

script 2 (void)
{
	acs_terminate(1,1); /* The chunk of code where script 1 is terminated, theoretically, could be at any point */
	teleport_newmap(2,0);
}



// Now let's say this is a script for MAP02

script 3 (void)
{
	acs_execute(1,1);
	teleport_newmap(1,0);
}
Granted, the teleport_newmap functions may be arbitrary for my problem. Basically, what I want to do is break out of script 1 at any line (not just wait until it's finished its cycle) and re-execute it from the beginning upon command. The trouble is that once I terminate script 1 and re-execute it, it doesn't merely start from the beginning again. It seems to be running TWICE at the same time: once at the beginning (like I asked it), but again at the point where it left off when I terminated it. In other words, let's say I terminate script 1 at many things 8. When I re-execute it, both many things 1 and many things 9 will be active, then many things 2 and many things 10, etc. Strangely, why is this happening? Why is it not breaking out completely? More importantly, how can I come across this dilemma?
Wed, 17 Jan 2007 08:04:56

Crimson Wizard

I am not sure, but perhaps you should not use OPEN scripts. Maybe place all the stuff to extra script, no 4, and OPEN script 1 should only call script 4 then.
Wed, 17 Jan 2007 14:24:41

The 4th Class

I tried that and it works the first time, but on the 2nd execution of script 4 onwards I get the same problems. <!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very sad" /><!-- s:cry: -->
Thu, 18 Jan 2007 17:53:38

Firebrand

If I understand correctly, you are executing the same script from another map? That could be the cause of it being executed in two different forms, the game saves which scripts are being executed until you change the maps hub, that might be the problem here.
Thu, 18 Jan 2007 22:25:58

The 4th Class

Strangely I ran a test where I took the same scripts and just had them execute/terminate/re-execute on the same map, but the problem persists. <!-- s:? --><img src="{SMILIES_PATH}/icon_confused.gif" alt=":?" title="Confused" /><!-- s:? -->
Fri, 19 Jan 2007 20:10:45

Firebrand

Do you need the many things X sections to be executed sequentially? or they do depend of some variable's value? If you need them sequentially then my idea is stupid, but if they depend on a variable's value, you could make a case cycle with corresponding break statements and that should make the script end correctly.

Back to the Vavoom Forum Archives