Jump to content
  • 0

Helper binding problem


Question

Posted
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?

7 answers to this question

Recommended Posts

  • 0
Posted

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?

 

51fd7dd1e8049.png

-[Все слова это только слова.]-

  • 0
Posted

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?
  • 0
Posted

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.

 

51fd7dd1e8049.png

-[Все слова это только слова.]-

  • 0
Posted

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?

  • 0
Posted

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.

 

51fd7dd1e8049.png

-[Все слова это только слова.]-

  • 0
Posted

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...

  • 0
Posted

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!

 

51fd7dd1e8049.png

-[Все слова это только слова.]-

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...