Mark., on 24 June 2017 - 06:17 AM, said:
I'm a beginner level coder and my bracketing may be wrong but this is where I would start from. Basically you need the " ifaction OPENING" after the else which you were missing.
action CLOSING 1 9 1 1 2
action OPENING 9 9 9 -1 2 // I'm assuming your existing numbers are right
useractor notenemy TEST_DOOR TOUGH CLOSING
ifpdistl 1024 ifcansee ifhitspace
ifaction CLOSING
{
soundonce 412
action OPENING
}
else
ifaction OPENING
{
soundonce 412
action CLOSING
}
enda
For now I'm a beginner too (hope it's gonna change:) and I have difficulty especially with actions.
The problem is despite the number -1 I set in the CLOSING action, this changes nothing ; this is not playing the animation backward.
(Also the OPENING action (which works satisfactorily) doesn't change behaviour with 'start frame' ; 'number of tiles' or 'delay' parameters, which I don't understand neither. And if I set "-1" as incvalue the code still opens the door (still playing forward despite of -1 !).
Let's say I define 5 for the 'start frame' I should see my door starting suddenly from the 5th frame instead of playing the whole animation, right ?)
Calling an action "CLOSING" where I defined "-1" as incvalue should necessarily play the animation backward. So what happens here... ?
If this can help, I post again how my model was defined :
dummytilerange 5640 5649 128 128
texture 5640 {
pal 0 { file "fx/door.jpg" }
}
model "models/doors/door.md3" {
scale 2 shade 4
skin { pal 0 surface 0 file "models/doors/door.jpg" }
skin { pal 30 surface 0 file "models/doors/door_30.jpg" }
skin { surface 1 file "models/doors/metal.jpg" }
skin { surface 2 file "models/doors/glass.png" }
normal { surface 0 file "models/doors/door_n.jpg" }
frame { name "closed1" tile 5640 }
anim { frame0 "open1" frame1 "open9" fps 8 flags 1 }
frame { name "open1" tile0 5641 tile1 5649 }
}
When I see how hard it is for a door coding, the guys who have hard coded the monsters in the HRP version are really Kings !!