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

The first "Hey guys what's wrong with my script" topic

4 replies · 1,550 views · Started 29 August 2006

Hey guys, can you help me find out what's wrong with this script?

WAIT WAITFRAME
COMPARER lx,x
GOTOLESS A
COMPAREV xd,0.5
GOTOMORE MORE
ADDV xd,0.1
MORE COMPARER ly,y
GOTOLESS B
COMPAREV yd,0.5
GOTOMORE WAIT
ADDV yd,0.1
GOTO WAIT
A COMPAREV xd,-0.5
GOTOLESS MORE
SUBV xd,0.1
GOTO WAIT
B COMPAREV yd,-0.5
GOTOLESS WAIT
SUBV yd,0.1
GOTO WAIT
It's supposed to provide a different kind of homing capability to an FFC, using speed instead of position, and with upper and lower caps on both speed values. Just attach it to an FFC yourself and see how it goes wrong, then maybe tell me what the problem is.

The only error I see is that you put the wrong thing to GOTO in one line in part A.

A COMPAREV xd,-0.5
GOTOLESS MORE
SUBV xd,0.1
GOTO WAIT
should be
A COMPAREV xd,-0.5
GOTOLESS MORE
SUBV xd,0.1
GOTO MORE
At least, I assume that was the idea.

The reason the script is failing so badly, though, is not your fault. The game just isn't handling the decimals very well. Remove them, like so:

WAIT WAITFRAME
COMPARER lx,x
GOTOLESS A
COMPAREV xd,5
GOTOMORE MORE
ADDV xd,1
MORE COMPARER ly,y
GOTOLESS B
COMPAREV yd,5
GOTOMORE WAIT
ADDV yd,1
GOTO WAIT
A COMPAREV xd,-5
GOTOLESS MORE
SUBV xd,1
GOTO MORE
B COMPAREV yd,-5
GOTOLESS WAIT
SUBV yd,1
GOTO WAIT
... And it'll work just fine, albeit much too fast.
Perhaps you could get around it by using data registers instead of xd and yd and dividing by ten when you update the position.

Saffith wrote:The reason the script is failing so badly, though, is not your fault. The game just isn't handling the decimals very well.

Hmm... it seems you're right.

It seems to be one of the errors ZC has with Freeform Combos as a whole, actually. ZC really doesn't like decimals. Not much at all. Particularly when combined with negatives.

Can anyone isolate the single command that isn't working as expected?

Moved to Beta Bugs forum.

EDIT: n/m, already done 😉