Revfan9
02-28-2007, 09:44 PM
This script is suppossed to move in a direction, then reflect in the direction of Link's sword when he hits it. It parses just fine, and everything else works except it doesn't reflect when Link hits it with the sword.
I think the problem is that I'm checking Link's action instead of the position of Link's weapon, except I don't know the commands/variables for weapons... anyone care to inform me on that?
Other than that, from all my knowledge it should work. Here's the script if anyone can get any other ideas as to why it doesn't work.
SETR data,d0
WAIT WAITFRAME
SETR data,d0
COMPAREV sd0,1
GOTOTRUE ATTACKSTART
GOTOFALSE WAIT
ATTACKSTART SETR data,d1
PLAYSOUNDV 32
SETR x,sd1
SETR y,sd2
COMPAREV sd3,1
GOTOTRUE MOVRIGHT
COMPAREV sd3,2
GOTOTRUE MOVLEFT
COMPAREV sd3,3
GOTOTRUE MOVDOWN
COMPAREV sd3,4
GOTOTRUE MOVUP
COMPAREV sd3,0
GOTOTRUE WAIT
MOVRIGHT SETV xd,2
GOTO LDIR
MOVLEFT SETV xd,-2
GOTO LDIR
MOVDOWN SETV yd,2
GOTO LDIR
MOVUP SETV yd,-2
GOTO LDIR
LDIR COMPAREV linkdir,0
GOTOTRUE LUP
COMPAREV linkdir,1
GOTOTRUE LDOWN
COMPAREV linkdir,2
GOTOTRUE LLEFT
COMPAREV linkdir,3
GOTOTRUE LRIGHT
LUP SETR sd4,linkx
SETR sd5,linky
SUBV sd5,16
GOTO AWAIT
LDOWN SETR sd4,linkx
SETR sd5,linky
ADDV sd5,16
GOTO AWAIT
LLEFT SETR sd4,linkx
SETR sd5,linky
SUBV sd4,16
GOTO AWAIT
LRIGHT SETR sd4,linkx
SETR sd5,linky
ADDV sd4,16
GOTO AWAIT
AWAIT WAITFRAME
COMPAREV sd0,0
GOTOTRUE WAIT
COMPARER x,sd4
GOTOTRUE LYCK
COMPARER y,sd5
GOTOTRUE LXCK
GOTO AWAIT
LYCK COMPARER y,sd5
GOTOTRUE LSTAB
GOTOFALSE AWAIT
LXCK COMPARER x,sd4
GOTOTRUE LSTAB
GOTOFALSE AWAIT
LSTAB COMPAREV linkaction,2
GOTOTRUE REFLECT
GOTOFALSE AWAIT
REFLECT COMPAREV linkdir,0
GOTO RUP
COMPAREV linkdir,1
GOTO RDOWN
COMPAREV linkdir,2
GOTO RLEFT
COMPAREV linkdir,3
GOTO RRIGHT
RUP SETV xd,0
SETV yd,-2
GOTO AWAIT2
RDOWN SETV xd,0
SETV yd,2
GOTO AWAIT2
RLEFT SETV xd,-2
SETV yd,0
GOTO AWAIT2
RRIGHT SETV xd,2
SETV yd,0
GOTO AWAIT2
AWAIT2 WAITFRAME
COMPARER sd1,x
GOTOTRUE AYCK
COMPARER sd2,y
GOTOTRUE AXCK
GOTO AWAIT2
AYCK COMPARER sd2,y
GOTOTRUE DMGA
AXCK COMPARER sd1,x
GOTOTRUE DMGA
DMGA PITWARPR d2,d3
I think the problem is that I'm checking Link's action instead of the position of Link's weapon, except I don't know the commands/variables for weapons... anyone care to inform me on that?
Other than that, from all my knowledge it should work. Here's the script if anyone can get any other ideas as to why it doesn't work.
SETR data,d0
WAIT WAITFRAME
SETR data,d0
COMPAREV sd0,1
GOTOTRUE ATTACKSTART
GOTOFALSE WAIT
ATTACKSTART SETR data,d1
PLAYSOUNDV 32
SETR x,sd1
SETR y,sd2
COMPAREV sd3,1
GOTOTRUE MOVRIGHT
COMPAREV sd3,2
GOTOTRUE MOVLEFT
COMPAREV sd3,3
GOTOTRUE MOVDOWN
COMPAREV sd3,4
GOTOTRUE MOVUP
COMPAREV sd3,0
GOTOTRUE WAIT
MOVRIGHT SETV xd,2
GOTO LDIR
MOVLEFT SETV xd,-2
GOTO LDIR
MOVDOWN SETV yd,2
GOTO LDIR
MOVUP SETV yd,-2
GOTO LDIR
LDIR COMPAREV linkdir,0
GOTOTRUE LUP
COMPAREV linkdir,1
GOTOTRUE LDOWN
COMPAREV linkdir,2
GOTOTRUE LLEFT
COMPAREV linkdir,3
GOTOTRUE LRIGHT
LUP SETR sd4,linkx
SETR sd5,linky
SUBV sd5,16
GOTO AWAIT
LDOWN SETR sd4,linkx
SETR sd5,linky
ADDV sd5,16
GOTO AWAIT
LLEFT SETR sd4,linkx
SETR sd5,linky
SUBV sd4,16
GOTO AWAIT
LRIGHT SETR sd4,linkx
SETR sd5,linky
ADDV sd4,16
GOTO AWAIT
AWAIT WAITFRAME
COMPAREV sd0,0
GOTOTRUE WAIT
COMPARER x,sd4
GOTOTRUE LYCK
COMPARER y,sd5
GOTOTRUE LXCK
GOTO AWAIT
LYCK COMPARER y,sd5
GOTOTRUE LSTAB
GOTOFALSE AWAIT
LXCK COMPARER x,sd4
GOTOTRUE LSTAB
GOTOFALSE AWAIT
LSTAB COMPAREV linkaction,2
GOTOTRUE REFLECT
GOTOFALSE AWAIT
REFLECT COMPAREV linkdir,0
GOTO RUP
COMPAREV linkdir,1
GOTO RDOWN
COMPAREV linkdir,2
GOTO RLEFT
COMPAREV linkdir,3
GOTO RRIGHT
RUP SETV xd,0
SETV yd,-2
GOTO AWAIT2
RDOWN SETV xd,0
SETV yd,2
GOTO AWAIT2
RLEFT SETV xd,-2
SETV yd,0
GOTO AWAIT2
RRIGHT SETV xd,2
SETV yd,0
GOTO AWAIT2
AWAIT2 WAITFRAME
COMPARER sd1,x
GOTOTRUE AYCK
COMPARER sd2,y
GOTOTRUE AXCK
GOTO AWAIT2
AYCK COMPARER sd2,y
GOTOTRUE DMGA
AXCK COMPARER sd1,x
GOTOTRUE DMGA
DMGA PITWARPR d2,d3