|
Development Forum |
 |
| 
Malkin
     Manager

|
7/3/2013 | |
So I have this error (Thanks Darby!):
Runtime error in agent 2 13 10854 script 2 13 10854 9 unique id 250434
Anim change failed - on part 0 which has base 0
... ubr wlkr velo -3 -2 {@}anim [8 9 10 11 12 13 14 15 14 ...
from this code:
***walking right
subr wlkr
velo -3 -2
anim [8 9 10 11 12 13 14 15 14 13 12 11 10 9 8]
over
retn
***walking left
subr wlkl
velo 3 -2
anim [0 1 2 3 4 5 6 7 6 5 4 3 2 1 0]
over
retn |
and the offending agent's sprite can be described as:
| new: simp 2 13 10855 "albiansnail" 16 0 name "patch_plane" |
I've read through this thread and this thread, and I think it's something to do with counting the frames I'm cycling through.
There are 0-15 images, thus 16 images total. 0-7 show the snail facing right, and 8-15 show the snail facing left.
What is this error message telling me? Could someone please explain how to fix it?
My TCR Norns |
 Prodigal Sock
Ghosthande
    

|
7/3/2013 | |
Typically if the anim line looks okay (which it does), the problem lies somewhere else... the game only knows that it errors when it gets to that point, it can't definitively tell you that that exact line is the culprit; so without seeing the entire code it isn't really possible to tell you what's wrong. You could try looking at the lines that come before these subroutines trigger, though; if the snail is approaching food, for instance, it could be that it's targeting the wrong agent and trying to animate the food instead of the snail.
 |

Malkin
     Manager

|
7/3/2013 | |
Thanks for the confirmation that the anim code is correct, I've been scratching my head on it for a while now!
the full timer code is:
******************
***Timer Script***
******************
scrp 2 13 10854 9
***time to die?
doif time eq 3 or time eq 4
gsub die
endi
***drown in water.
doif rtyp room targ = 8 or rtyp room targ = 9
gsub die
endi
addv ov00 rand 1 2
***decide if walk right
doif ov00 ge 0 and ov00 lt 50
gsub wlkr
endi
***decide if walk left
doif ov00 ge 50 and ov00 lt 100
gsub wlkl
endi
***moved left enough so now set it up to move right
doif ov00 ge 100
setv ov00 0
endi
***walking right
subr wlkr
velo -3 -2
anim [8 9 10 11 12 13 14 15 14 13 12 11 10 9 8]
over
retn
***walking left
subr wlkl
velo 3 -2
anim [0 1 2 3 4 5 6 7 6 5 4 3 2 1 0]
over
retn
***die
subr die
kill ownr
retn
endm |
does that give any indications as to what the trouble is?
My TCR Norns |
 Prodigal Sock
Ghosthande
    

|
7/3/2013 | |
Erm... possibly because the code is for species 10854, and the install script for species 10855?
 |

Malkin
     Manager

|
7/3/2013 | |
That... would be it. :/ Thank you, Ghosthande! 
My TCR Norns |
|