PDA

View Full Version : The first "Hey guys what's wrong with my script" topic



_L_
08-29-2006, 11:22 AM
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 WAITIt'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.

Saffith
08-30-2006, 12:15 AM
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 WAITshould be
A COMPAREV xd,-0.5
GOTOLESS MORE
SUBV xd,0.1
GOTO MOREAt 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.

_L_
08-30-2006, 05:32 AM
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.

ShadowTiger
08-30-2006, 09:24 AM
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.

DarkDragon
08-30-2006, 12:49 PM
Can anyone isolate the single command that isn't working as expected?

Moved to Beta Bugs forum.

EDIT: n/m, already done ;)