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

Screen->ComboD[] Crash Bug...

4 replies · 1,174 views · Started 06 November 2008

Well, I've had a play around with this for a bit, and I can't seem to see what's causing it...

ffc script CrashTester{
void run(){
for(int i=0;i<=176;i++) Screen->ComboD = 1;
}
}

This script is crashing my game every other time you enter the screen with it on, [i]without fail
.
And if you enter the screen, then reset the system, it crashes when you load any quest.

Test Quest
Screen with the script on it 1 screen below where you start

However, when I put it on a screen in a new quest file, it works fine.

TestQuest2
Screen with the script on it is the origin.

I've played around with the quest rules and Diagonal Movement, and it's not anything to do with that. There are no Screen Flags set on either screen, so it's not that. I'm using the 'Run Script At Screen Init.' ffc flag, but I've tried both cases with and without that and I get the same result, and I've even tried deleting every other script from my file on my game and I'm still getting the same problem, so it's not to do with any of my other scripts.

And on a side note, this is my 2000th post. Go me.

ffc script CrashTester{
void run(){
for(int i=0;i<=176;i++) Screen->ComboD[i] = 1;
}
}
I am certain that this is the problem. There are only 176 combo positions, numbered from 0 to 175. To execute a line like "Screen->ComboD[176] = 1;" currently causes disaster. The bug is that such a command isn't properly sanitised by the script engine.

As you are no doubt wondering, this doesn't crash "my script", where you inherited the bug from, because it contains this line:


if (Rand(100) <=2 && Screen->ComboD[i] == ED_NULL) {
...where "Screen->ComboD[i] == ED_NULL" will always be false.

Ah!

I was wondering why the more-complicated version of the script which I'd produced after that wasn't crashing it.
Thankyou.

EDIT: Just changed it and it works now.

Did you have that equals sign in your script for any particular reason?