*SOLVED* Bind to camera?

Started by Hero, April 02, 2011, 07:53:07 AM

Previous topic - Next topic

Hero

I have a problem.

I'm calling a gauge bar to keep track of the time of custom combo. The bar works perfectly, but I want to bind to the camera (I mean, if the camera "ups", the gauga bar "follows" it.

I was able to get a code, but anyway, when a character jumps (or perform a fast xvel move). The bar doesn't follow ta the same time, it follows the camera after a few ticks (like 5 or 6, dunno exactly).

[State 930,bar]
type=helper
trigger1 = !Time
helpertype=normal
stateno=7700
ID=7700
name="CustomComboBar"
postype=left
pos=0,-120
ownpal=1
ignorehitpause=1
supermovetime=36
size.xscale=.5
size.yscale=.5
facing = IfElse(teamside,1,-1)


;================

[Statedef 7700]
type=A
velset=0,0
anim=7720
sprpriority = 6

[State 7700, Turn]
type = Turn
trigger1 = !Time && root,teamside = 2
ignorehitpause = 1

[State 7700, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1
[State 7700, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = !Time
var(59)=IfElse(root,teamside=1,-1,1)
ignorehitpause = 1

[State 7700, Bind]
type=posset
trigger1= 1
x=(185-(time*7))*var(59)
y=(pos y-screenpos y)+220
ignorehitpause = 1

[State 7700, End]
type=changestate
trigger1= time = 6
value = 7701
ignorehitpause=1

;================

;THE MAIN STATE OF HELPER
[Statedef 7701]
type=A
velset=0,0
anim=7720
sprpriority = 6

[State 7700, PalFX]
type = PalFX
trigger1 = root,fvar(7)<50&&gametime%6=0
time = 2
add = 256,256,256
ignorehitpause = 1

[State 7700, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1
[State 7700, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
ignorehitpause = 1

[State 7700, VarSet]
type = VarSet
trigger1 = !Time
var(59)=IfElse(root,teamside=1,-1,1)
ignorehitpause=1

[State 7700, Bind]
type=posset
trigger1= 1
x=150*var(59)
y=(pos y-screenpos y)+220
ignorehitpause = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = (root,var(15)=0&&root,var(9)=0&&root,stateno!=930)
value = 7702
ignorehitpause = 1


If you need more information, just ask.

Thank you  :) and forgive bad english/grammar


rednavi -RETIRED

if you plan to stick a gauge to the screen (as in, like the lifebars) then you should use explods inside the helper instead of animating the helper. it would be quite easier and you wont need to reposition the helper at all because it wont matter. The explods bind to the screen wont fail at all.


Hero

After a lot of work with triggers, I got it working. thank you. I'm changing the title and wait for close this thread.