YesNoOk
avatar

Helper contact with Player (Read 1828 times)

Started by daraku, December 16, 2017, 11:56:19 pm
Share this topic:
Helper contact with Player
New #1  December 16, 2017, 11:56:19 pm
  • **
I've a bonus....a briefcase that reloads the bombs of Player. My problem is the contact between the helper and Player. It looks bug, and the helper don't destroy himself when it make contact with Player.

; reload Bombs
[Statedef 1091]
type = A
movetype = A
physics = N
juggle  = 0
velset = 0,8
ctrl = 0
anim = 1090



[State 0, Explod]
type = Explod
trigger1 = !time
id = 1091
anim = 1091
pos = 0,80
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
scale = 1,1
sprpriority = -1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = pos y >= 0
id = 1091

[State 0, Explod]
type = Explod
trigger1 = pos y >= 0
id = 1092
anim = 1092
pos = 0,80
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 8,0
accel = 3,0
random = 0,0
removetime = -2
scale = 1,1
sprpriority = -1



[State 0, VelSet]
type = VelSet
trigger1 = pos y >= 0
x = 0
y = 0

[State 0, VarSet]
type = parentVarSet
trigger1 = ParentDist X = 0 ; Probably this trigger is wrong...cause don't work well!
v = 25
value = 6

[State 220, HitDef]
type = HitDef
trigger1 = !time
attr = S,SP
damage = 72,1
animtype = High
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 2,2
sparkno = s8222
sparkxy = 0,0
guard.sparkno = s8001
hitsound = s1045,1
guardsound = S8000,6
ground.type = High
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -12,-1
air.type = Low
air.hittime = 18
air.velocity = -12,3
envshake.time = 2
envshake.ampl = 2
fall=1
palfx.time = 40
palfx.add = 240,50,0
palfx.mul = 250,224,120
palfx.sinadd = 110,55,85,5
Palfx.color = 0



[State 0, DestroySelf]
type = DestroySelf
trigger1 = movecontact
trigger2 = animtime = 0
trigger3 = ParentDist X = 0
Last Edit: December 21, 2017, 01:02:08 pm by daraku
Re: Helper contact with Player
#2  December 17, 2017, 01:57:19 am
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
Parentdist x=0 is too precise and will only trigger in a specific pixel position. Better use a range like parentdist x=[-15,15] to ensure the condition will trigger when the character is close to the helper
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: Helper contact with Player
#3  December 17, 2017, 11:25:22 pm
  • *****
  • Shame on you!
    • USA
You can also use

affectteam = team_type (string)  team_type specifies which team's players can be hit by this HitDef. Use B for both teams (all players), E for enemy team (opponents), or F for friendly team (your own team). The default is E.

in the hitdef. You can make 2 hitdefs, 1 for P1 and 1 for P2. B never seemed to work well for me.
vVv Ryuko718 Updated 10/31/22 vVv
Re: Helper contact with Player
#4  December 20, 2017, 04:30:36 pm
  • **
You can also use

affectteam = team_type (string)  team_type specifies which team's players can be hit by this HitDef. Use B for both teams (all players), E for enemy team (opponents), or F for friendly team (your own team). The default is E.

in the hitdef. You can make 2 hitdefs, 1 for P1 and 1 for P2. B never seemed to work well for me.

[State 220, HitDef]
type = HitDef
trigger1 = !time
attr = S,SP
damage = 0, 0
animtype = High
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 2,2
sparkno = s8222
sparkxy = 0,0
guard.sparkno = s8001
affectteam = F
p1stateno = 1100 ; in this case...this state should activate the player state if helper touched the player...right?
hitsound = s1045,1
guardsound = S8000,6
ground.type = High
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -12,-1
air.type = Low
air.hittime = 18
air.velocity = -12,3
envshake.time = 2
envshake.ampl = 2
Re: Helper contact with Player
#5  December 20, 2017, 05:36:38 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
p1stateno = 1100 ; in this case...this state should activate the player state if helper touched the player...right?
If this HitDef is in the Helper State, then the Helper is the one going into State 1100 on movehit.
If this HitDef is in the Player State, then the Player is the one going into State 1100 on movehit.