Jump to content

Photo

Scripts Self-Disable

script help problem

  • Please log in to reply
9 replies to this topic

#1 linkinsphere

linkinsphere

    Junior

  • Members
  • Location:US

Posted 11 September 2016 - 10:33 AM

So I've been working on my quest, but for some reason, the scripts all disable themselves out of nowhere. When I go back to test them, they no longer work. The weird thing is... they all worked at first. Now they're all acting as if they're not even active. And I'm well aware they were. I tested them a lot! It's so strange... Please get back to me when you can. This issue is really bugging me.

 

Thanks!

Linkinsphere



#2 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 11 September 2016 - 10:58 AM

Would you mind showing some examples of scripts that don't work anymore?

 

This is just a guess, but maybe the issue are global variables. Try starting a new savefile for your quest.



#3 linkinsphere

linkinsphere

    Junior

  • Members
  • Location:US

Posted 11 September 2016 - 11:05 AM

Would you mind showing some examples of scripts that don't work anymore?

 

This is just a guess, but maybe the issue are global variables. Try starting a new savefile for your quest.

They're all FFC scripts. And yes, I did start a new save file, but they still refuse to work.

 

Here is a previously-working script:

 

(None of them work anymore. And they used to)

import "std.zh"
const int DeathClock = 5; // seconds

ffc script die
{
	void run()
	{	
		Waitframes(30*DeathClock);
		Link->HP = 0;
	}
}


Edited by linkinsphere, 11 September 2016 - 11:05 AM.


#4 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 11 September 2016 - 11:07 AM

I'm not sure what's happening then. When importing the scripts, make sure you import every script at once. Are all your ffc scripts in the same file?



#5 linkinsphere

linkinsphere

    Junior

  • Members
  • Location:US

Posted 11 September 2016 - 11:50 AM

I'm not sure what's happening then. When importing the scripts, make sure you import every script at once. Are all your ffc scripts in the same file?

Yes, they are. I never removed any; only added.

 

Edit: My bad, I meant no. They're in the same folder, though.


Edited by linkinsphere, 11 September 2016 - 12:11 PM.


#6 Mani Kanina

Mani Kanina

    Rabbits!

  • Members

Posted 11 September 2016 - 02:04 PM

That's your issue, you need to include all scripts you want in the same file, probably.

#7 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 11 September 2016 - 02:15 PM

Yeah because all scripts need to be imported at once.



#8 idontknow8

idontknow8

    Senior

  • Members

Posted 11 September 2016 - 03:03 PM

Also, you might want to change the 30 to 60 because there are 60 tics/frames in a second, not 30.  If you want a five second clock, it should be five times 60.



#9 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 11 September 2016 - 05:40 PM

Pro tip: To import all your scripts at once without putting them all in one file, you can make one master script file, called something like myQuest.z, and fill that with just a bunch of import statements. Scripts (.z) can be imported exactly the same way as headers (.zh).

 

import "std.zh";
 
import "die.z";
// And so on...


#10 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 11 September 2016 - 09:05 PM

Uber-Pro-Tip: if you tick 'Save ZASM to Allegro.log', and save the assembly code for each ffc/other script in text files, you can load the assembly into slots in ZQuest without needing to recompile, at any time. That's by far the fastest way to add a script to a quest, and in particular, to add scripts to a quest that has scripts loaded, where you don't have the source files (or the ability to recompile).





Also tagged with one or more of these keywords: script, help, problem

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users