need help on variable
Hello,
Is it possible to initialize a variable but only one time (at the beginning) ?
I'am making an animated train which follow a path and i would like it to move backward (along the path) when it reach the end. So a made 2 animations (forward animation and backward animation) and i used an user variable to change the train move, using this code :
SETWRD 0312h,1
;0=A->B / 1=B->A
IFIN1 lbl_BtoA, 0312h, 0, 0
BGL_JUMP_32 lbl_AtoB
lbl_BtoA label word
BGL_ANIMATE VAR_BASE_GLOBAL,usrvr2,VAR_BASE_LOCAL,(offset SD_train_trans_back - offset SD_train_pvan_1),0.0,0.0,0.0
BGL_ANIMATE VAR_BASE_GLOBAL,usrvr2,VAR_BASE_LOCAL,(offset SD_train_quat_back - offset SD_train_pvan_1),0.000000,0.000000,0.000000
SETWRD 0312h,0
BGL_JUMP_32 lbl_fin
lbl_AtoB label word
BGL_ANIMATE VAR_BASE_GLOBAL,usrvr2,VAR_BASE_LOCAL,(offset SD_train_trans_1 - offset SD_train_pvan_1),0.0,0.0,0.0
BGL_ANIMATE VAR_BASE_GLOBAL,usrvr2,VAR_BASE_LOCAL,(offset SD_train_quat_1 - offset SD_train_pvan_1),0.000000,0.000000,0.000000
SETWRD 0312h,1
BGL_JUMP_32 lbl_fin
lbl_fin label word
but the train always do the same animation because the SETWRD 0312h,1 command (at the beginning) is repeating each time. So is there a way to do this command only one time, just to set the first train animation ?
Thanks
Hello,
Is it possible to initialize a variable but only one time (at the beginning) ?
I'am making an animated train which follow a path and i would like it to move backward (along the path) when it reach the end. So a made 2 animations (forward animation and backward animation) and i used an user variable to change the train move, using this code :
SETWRD 0312h,1
;0=A->B / 1=B->A
IFIN1 lbl_BtoA, 0312h, 0, 0
BGL_JUMP_32 lbl_AtoB
lbl_BtoA label word
BGL_ANIMATE VAR_BASE_GLOBAL,usrvr2,VAR_BASE_LOCAL,(offset SD_train_trans_back - offset SD_train_pvan_1),0.0,0.0,0.0
BGL_ANIMATE VAR_BASE_GLOBAL,usrvr2,VAR_BASE_LOCAL,(offset SD_train_quat_back - offset SD_train_pvan_1),0.000000,0.000000,0.000000
SETWRD 0312h,0
BGL_JUMP_32 lbl_fin
lbl_AtoB label word
BGL_ANIMATE VAR_BASE_GLOBAL,usrvr2,VAR_BASE_LOCAL,(offset SD_train_trans_1 - offset SD_train_pvan_1),0.0,0.0,0.0
BGL_ANIMATE VAR_BASE_GLOBAL,usrvr2,VAR_BASE_LOCAL,(offset SD_train_quat_1 - offset SD_train_pvan_1),0.000000,0.000000,0.000000
SETWRD 0312h,1
BGL_JUMP_32 lbl_fin
lbl_fin label word
but the train always do the same animation because the SETWRD 0312h,1 command (at the beginning) is repeating each time. So is there a way to do this command only one time, just to set the first train animation ?
Thanks
Last edited:

