Yet Another Script Problem (YASP)
Well, this time, it's serious. To protect my plans with the scripts I will show soon, I am going to take out any mentions of the names. :D
These two scripts work in tandem to trigger one effect, but when I open a quest in ZC with them in it, the player freezes before the quest is finished loading.
Code:
ffc script -taken out-
{
int Activated = 0;
void run()
{
while(true)
{
while (Activated == 1)
{
Screen->ComboD[176] = 3;
}
}
}
}
Code:
import "std.zh"
import "-taken out-.z"
ffc script -taken out again-
{
int Type = 0;
int Piece = 1;
int Weapon = 0;
void run()
{
while(true)
{
if (Type == 0)
{
-taken out-.Activated = 1;
}
else if (Type == 1)
{
Screen->ClearSprites(0);
int ScrnNPCs = Screen->NumNPCs();
if (ScrnNPCs == 0)
{
-taken out-.Activated = 1;
}
}
else if (Type == 3)
{
if (Link->Item[Weapon])
{
-taken out-.Activated = 1;
}
}
}
}
}
Yeah... I have no clue what's wrong. Is it because I try to clear the guys from the screen?
Re: Yet Another Script Problem (YASP)
Offhand, I'd say it's because you have an infinite loop without a Waitframe().
Re: Yet Another Script Problem (YASP)
Quote:
Originally Posted by
Saffith
Offhand, I'd say it's because you have an infinite loop without a Waitframe().
Oh darn, I forgot that. XD I'm too used to item scripts. XD Thanks for telling me that. :)
Edit: Well darn. That fixed the freezing problems, but... Now, whenever the "thing" is triggered, it goes to the wrong location. Okay, help me out here. I want to put a combo at an exact location without using FFCs (Because for some reason, doing it that way completely erases combo type...). I want to put Combo 3 at 96,80. How would I tell the script to look at x-96, y-80?
Re: Yet Another Script Problem (YASP)
I'm not sure I see what you mean... Are you trying to change Screen->ComboD at a particular location? If that's it, it would be Screen->ComboD[ComboAt(96, 80)]=3.
Re: Yet Another Script Problem (YASP)
Quote:
Originally Posted by
Saffith
I'm not sure I see what you mean... Are you trying to change Screen->ComboD at a particular location? If that's it, it would be Screen->ComboD[ComboAt(96, 80)]=3.
Oh. XD I've always wondered how I'd use ComboAt.... XD
Edit: It works, but there's a problem- The Combo Type refuses to work. :(
Re: Yet Another Script Problem (YASP)
What type of combo is it you're changing it to?
Re: Yet Another Script Problem (YASP)
Quote:
Originally Posted by
Saffith
What type of combo is it you're changing it to?
Stairs. If I change it using a variable that isn't a loaded FFC, the combo type works. If I use a variable with a loaded FFC, the combo type doesn't work. It doesn't work here, either, and this is in build 240!
Re: Yet Another Script Problem (YASP)
So Screen->ComboD[x]=3 works, but Screen->ComboD[x]=ffcPtr->Data doesn't? Is that what you're saying?
Re: Yet Another Script Problem (YASP)
Quote:
Originally Posted by
Saffith
So Screen->ComboD[x]=3 works, but Screen->ComboD[x]=ffcPtr->Data doesn't? Is that what you're saying?
Huh? No, let me explain...
Before, I tried to make a variable be equal to "(96)&(80)", and that would put it at the wrong spot. When I did that, the stairs worked.
If I did "ffc varaible_here = Screen->LoadFFC(32)", I had to put the FFC's X and Y positions into one variables, so I'd do "variable_Here = (FFC->Y & 240)+(FFC->X>>4)", which is supposed to attach it to a specific combo location instead of by pixels (or so I was told). Then, when putting THAT variable into the ComboD line, it acts like I put the combo on Layer 1.... Meaning, the combo type gets completely erased!
Not even your version of doing it worked. :(
Re: Yet Another Script Problem (YASP)
Hm... Okay, what are you changing it from, then?
And when you say it doesn't work, you mean you can walk over the stairs and they just don't warp you anywhere?