[SOLVED] FACING in Flashes

O Ilusionista

Captain 100K
Guys, I have a flash which needs to always be facing right (because it has a text on it).
91LIr8E.png


It works pretty well...until I pause the game (using a text entity for that). Then the effect will be facing the other way until the pause is gone.

What I am doing wrong? Or should I need to add a script to set it frozen time?

name Flash
type none
shadow 0
antigravity 100
lifespan 0.20

anim idle
loop 0
delay 5
offset 40 40
facing 1
frame data/chars/misc/sp1.pcx
frame data/chars/misc/sp2.pcx
frame data/chars/misc/sp3.pcx
@cmd killentity getlocalvar("self")
frame data/chars/misc/sp3.pcx
 
Maybe this one will work?

Code:
@script
if(frame == 0){
           changeentityproperty(getlocalvar("self"), "direction", 1);
}
@end_script

... or this?

Code:
@script
changeentityproperty(getlocalvar("self"), "direction", 1);
@end_script

or maybe this one?

name  Flash
type  none
shadow  0
antigravity 100
lifespan 0.20

anim  idle
  loop  0
  delay  5
  offset  40 40
  @cmd changeentityproperty getlocalvar("self") "direction" 1
  frame  data/chars/misc/sp1.pcx
  frame  data/chars/misc/sp2.pcx
  frame  data/chars/misc/sp3.pcx
  @cmd  killentity getlocalvar("self")
  frame  data/chars/misc/sp3.pcx
 
O Ilusionista said:
Thanks budyd, this had worked for me:
  @cmd changeentityproperty getlocalvar("self") "direction" 1

You shouldn't have to do that - that's what facing is for, but if it works, it works. :)

That said, remember to always use constants - magic numbers in your code are the way to pain.

Code:
@cmd changeentityproperty getlocalvar("self") "direction" openborconstant("DIRECTION_RIGHT")
 
You shouldn't have to do that - that's what facing is for, but if it works, it works.
Yeah :) But it would be good if it worked the way it was intended for.

That said, remember to always use constants - magic numbers in your code are the way to pain.
The version I am using to code my game doesn't support it. But once I change it, I will change the code, thanks.
 
Back
Top Bottom