Jump to content
  • 0
Synck

Helper binding problem

Question

I have a problem with some move again...
So when explosive (p1) hit p2 with some special move which I have created, he need to place the bomb into the p2's body then it will blow up in the p2's body...explod gets binded on p2 but helper doesn't do that...
 
Here's the picture:
r3MQgwp.png
 
Code in p1's state:
 
[state 810, Helper]; It's in throwing state
type = Helper
trigger1 = time = 21
helpertype = normal
name = "Bomb in the body"
id = 1574
pos = 0, -50
postype = P2
stateno = 1574
keyctrl = 0
 
and here's the code in helper 1574:
 
...
 
[state 1000]
type = bindtotarget
trigger1 = 1
time = 9999
pos = 0,-50,mid
persistent = 1
 
[state 1000];Bomb indicator
type = explod
trigger1 = time = 0
anim = 850
ontop = 1
postype = p2
pos = 0,-65
removeongethit = 0
ignorehitpause = 1
bindtime = -1
 
[state 1000]
type = changestate
trigger1 = time = 300
value = 1573
 
 
help?

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

In order for BindToTarget to work, your helper needs to have a target. You helper will lose its target as soon as the player recovers, as he needs to be in hitstates. Here's how I would do this:

First, give the HitDef an ID. Let's call it 444 for the same of example. Next, you want to store the ID of your target in a variable for future use. You can do that easily with:

trigger1 = numtarget(444) && movehit
var(#) = target,ID
Now that you have the ID of your target, all you need to do is use a PosSet, to position the helper on the target, using their x and y positions. Like so:

trigger1 = playerIDExist(var(#)) ; If the player of your target's ID exists
x = playerID(var(#)),pos x
y = playerID(var(#)),pos y
ignorehitpause = 1
That's it. Now, you'll have your very own "Target Bind" without the needing an actual target. Pretty cool, huh?

Share this post


Link to post
Share on other sites
  • 0

well it didn't work good...

here's the explanation in code and on picture:

 

here's how I edit the code:
 
in state 810:
[state 1000, Varset]
type = varset
trigger1 = numtarget(444) && movehit
var(4) = target,ID
ignorehitpause = 1
 
[state 1000, 6]
type = HitDef
trigger1 = time = 0
attr = S, SA
animtype  = Hard
damage    = 50, 2
priority  = 5
hitflag = MAF
guardflag = MA
pausetime = 0,0
sparkxy = 0,0
hitsound   = 5,3
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -2,0
air.velocity = -4,0
 
[state 1200, Helper]
type = Helper
trigger1 = movehit 
helpertype = normal
name = "Bomb in the body"
id = 1574
pos = 0, -50
postype = P2
stateno = 1574
keyctrl = 0
 
 
in helper:
 
[state 1000]
type = posset
trigger1 = playerIDExist(var(4)) ; If the player of your target's ID exists
x = playerID(var(4)),pos x
y = playerID(var(4)),pos y
ignorehitpause = 1
 
picture:
8QZjinD.png
what i'm suposted to do?

Share this post


Link to post
Share on other sites
  • 0

You didn't give the HitDef an ID of 444. Also, why are you using "444?" It was just for my example. Next, in the helper, change var(4) to parent,var(4) or root,var(4). You're setting the variable in the root, so you have to access it from the root.

Share this post


Link to post
Share on other sites
  • 0

it worked :) but when 'explosive' hit the p2 it looks like that number of helpers are getting high on 18 and there will be always 18 explosions on p2...what I missed?

Share this post


Link to post
Share on other sites
  • 0

it worked :) but when 'explosive' hit the p2 it looks like that number of helpers are getting high on 18 and there will be always 18 explosions on p2...what I missed?

Change the trigger of your helper to be movehit=1 or add persistent=0 to it.

Share this post


Link to post
Share on other sites
  • 0

that's the thing? I should have known that before...anyway thanks for your help,You are credited again in my new future game ;) Today I learned something very important...

Share this post


Link to post
Share on other sites
  • 0

that's the thing? I should have known that before...anyway thanks for your help,You are credited again in my new future game ;) Today I learned something very important...

Glad to hear it. :) Good luck with your project!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...