YesNoOk
avatar

a different postype for x and y? (Read 484 times)

Started by Continuity, October 21, 2009, 10:19:09 pm
Share this topic:
a different postype for x and y?
#1  October 21, 2009, 10:19:09 pm
  • ***
  • 我が名は 「ハクメン」、押して参る!
I'm using helpers as hitsparks for my character because the original sprites were huge and look terrible if you resize them outside of the game. And I've encountered some problem with the hitspark position, according to the doc, the way sparkxy works in hitdef is that "spark_x is a coordinate relative to the front of P2. spark_y is relative to P1". When I'm doing postype for the helper statedef, it seems I can only use one type, which is not working out for me. Any suggestions? thank you
Re: a different postype for x and y?
#2  October 22, 2009, 12:51:44 am
  • avatar
Try making an explod which use's the correct positioning, is set to Ignorehitpause = 1 and is dependent on a variable set at the beginning of the move to prevent overflow of hitsparks.

Something like:

[State xxxx, Hitspark ON]
type = varset
trigger1 = !time
v = x ;This variable can be reused for all hitsparks throughout the character, except any hitsparks which are part of rapid hits. --;
value = 1

[State xxxx, Hitspark]
type = Explod
trigger1 = Movecontact && Var(x) ;Same Variable as above
anim = xxxx
ID = xxxx
pos = x,x
postype = p1
facing = 1
bindtime = 1
removetime = -2
scale = x,x
sprpriority = x
ontop = 1
shadow = 0,0,0
ownpal = 1
ignorehitpause = 1

[State xxxx, Hitspark ON]
type = varset
trigger1 = Movecontact && Var(x)
v = x ;Same Variable as above
value = 0
ignorehitpause = 1

That SHOULD do the job, otherwise you could request a postype for hitsparks at the Elecbyte Forum. ;)
(x's mean you set it to whatever you want.)
Re: a different postype for x and y?
#3  October 22, 2009, 02:33:11 am
  • ***
  • 我が名は 「ハクメン」、押して参る!
I don't quite sure what you mean, or maybe I didn't make myself clear, here's an example

say for the a single hitspark, it's like this

[mcode][state 200, hitspark]
type=helper
trigger1=movehit
stateno=8004
size.xscale=0.5
size.yscale=0.5
pos=48, 27
postype=p1
ownpal=1
keyctrl=0
ignorehitpause=1
persistent=0[/mcode]

because postype=p1, the spark will always appear at the same place relative to p1's body, which means that if this attack lands very close to p2's body, the hitspark will appear behind p2 instead of on p2's body.
now if you change that to postype=p2, we'll have similar problem if p2 gets hit by this attack in midair.
So my question is, is there a way to make the x position relative to p2 while the y position relative to p1?
Re: a different postype for x and y?
#4  October 22, 2009, 04:29:15 am
  • **
Yes you could calculate it with
[mcode]ceil(P2BodyDist X - ???)[/mcode]

You could also just use a fixed X position and just check if the enemy is too close and then set the position to P2Dist X (I think most people, including me, do it that way)
[mcode]ifelse(P2Dist X < ???, ceil(P2Dist X), ???)[/mcode]
Latest Creation: SSBB Assist Trophies
Re: a different postype for x and y?
#5  October 22, 2009, 04:47:27 am
  • ***
  • 我が名は 「ハクメン」、押して参る!
thanks, it works very well, now I can get on with my work  :sugoi: