screenpos/screenbound problem *SOLVED*

Started by sgn15, February 19, 2011, 01:19:08 PM

Previous topic - Next topic

sgn15

i think this is a unique problem. so i called some helpers into places that depends on the screen (the blue circles on the pic are where i want the helpers to be, even if the camera moves) (helpers' position is not dependent on p1's or p2's place)

i tried using screenbound sctrl and screenpos trigger for posadd but both doesnt work

here are the codes involved

calling helper
Quote[State 0, 2]
type = helper
trigger1 = animelemtime(10)=0
helpertype = normal
stateno = 422
postype = p2
pos = 40, 0 ; i tried using screenpos here but mugen doesnt allow it
ownpal = 1
ontop = 1
size.xscale = 1.1
size.yscale = 1.1

helper state
Quote;-------------------------------------------------------------------------------
[Statedef 422]
type = S
movetype= A
physics = N
juggle = 0
poweradd= 0
ctrl = 0
velset = 0,0
anim = 422
sprpriority = 2

[State 0, ScreenBound]
type = ScreenBound
trigger1 = animelem = 1
value = 0
movecamera = 0,0
;ignorehitpause =
;persistent =

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem = 1
x = ScreenPos X = [0,20]
y = ScreenPos Y = [0,20]

[State 0, 4]
type = Destroyself
trigger1 = AnimTime = 0

i tried changing the posadd to posset but i didnt notice any changes. how to fix it so it will end up like i wanted it to be?

Cyanide

posset
x = 160
y = floor(pos Y-screenpos Y)

x = -160
y = floor(pos Y-screenpos Y)

x = 0
y = floor(pos Y-screenpos Y)

x = 160
y = floor(pos Y+screenpos Y)

x = -160
y = floor(pos Y+screenpos Y)

x = 0
y = floor(pos Y+screenpos Y)

Or something like that. You want pos Y to always hit the top and bottom. I can never remember the expression for that but it's the piece of code you need. X axis of posset is always consistent however in that -160 is the left, 160 is the right and 0 is the middle of the screen.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.