Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

Assigning CSet in Scripts (Unspoken Restrictions?)

1 replies · 1,234 views · Started 08 October 2007

I spent about two days debugging some new scripts and I finally discovered the problem. It's got something to do with how assigning or reading a CSet doesn't work as expected.

Script #1 sets the combo (Data) and CSet of FFC10-14 at regular intervals.

Script #2 runs on FFC10-14. When each FFC notices it's combo is changed, it changes its behavior to match the new combo. It also sets its "difficulty" based on the CSet.

What I was doing was assigning CSet 7 for easy, 8 for hard, in Script #1. But the if(this_ffc->CSet == 7) in the second script simply refused to trigger. When I took out the conditional, it worked fine.

So somewhere between assigning the CSet to be 7 and the next script reading the CSet a tic later, something went awry.

I can post the code if it helps, but I think the problem is pretty clear.

Could you post an example quest? I just tried the two scripts


import "std.zh"

ffc script foo {
void run() {
while(true)
{
if(this->CSet == 7)
Trace(this->CSet);
Waitframe();
}
}
}

ffc script bar {
void run() {
Waitframes(15);
ffc other = Screen->LoadFFC(1);
other->CSet = 7;
}
}


which worked like a charm.

PS: The "this_ffc" bug should be long dead and gone.