YesNoOk
avatar

Problem with helpers (Read 399 times)

Started by SignificantSlice, May 31, 2012, 10:41:55 am
Share this topic:
Problem with helpers
#1  May 31, 2012, 10:41:55 am
  • avatar
  • *
    • Philippines
    • ulolako35@yahoo.com
i have a problem with helpers

Situation:
i have 3 helpers

the first helper can be summoned up to 5 times and has a time limit of 5 secs and because of this i can have up to 5 of this helper in the screen
the second helper is a helper that can be summoned by my character or by my first helper depends on the situation
the third helper is a changestate of my first helper when the second helper or another first helper colide with my first helper

Problem:
1. I need to know how to make my first helper changestate to my third helper when another first or second helper colide with the first      helper

P.S.
sorry if it's confusing

TNX in advance
Re: Problem with helpers
#2  May 31, 2012, 01:45:44 pm
  • ******
  • I hang out tough. I'm a real boss.
    • USA
    • litotichues.com/
Use a root variable to detect the state changes of all of its helpers that need their states checked, then read that variable by the helpers of the root who need to detect the root's other helper's state change.

For detectiing "collisions," you can store all the root's helpers' distances using root variables as well. So use the same logic as detecting their state changes.

Or you can use actual hitdefs with affectteam = F and hitoverriddes.
Last Edit: May 31, 2012, 01:53:41 pm by Rajaa

2OS

Re: Problem with helpers
#3  May 31, 2012, 01:50:44 pm
  • ****
  • Ich schicke dich zur HOELLE ! ¡ ! ¡
    • Egypt
    • deuceovspadez.webs.com/
affectteam


[ 052012 ] Inazumachi 181/256  /  deviantART   /  2OS Grafphicsxz  Dead Anims ( Orochi/Mizuchi )  /  608's FX Volume 3
Re: Problem with helpers
#4  May 31, 2012, 01:53:23 pm
  • ******
  • I hang out tough. I'm a real boss.
    • USA
    • litotichues.com/
Yeah, man.
Re: Problem with helpers
#5  May 31, 2012, 02:17:41 pm
  • avatar
  • *
    • Philippines
    • ulolako35@yahoo.com
gonna try both

btw, if i use affectteam = F, does that mean that even my teammate in team battle mode will be hit by the attack?
Last Edit: May 31, 2012, 02:25:06 pm by SignificantSlice
Re: Problem with helpers
#6  May 31, 2012, 08:45:00 pm
  • ****
    • Hungary
    • seravy.x10.mx/Wordpress
Quote
btw, if i use affectteam = F, does that mean that even my teammate in team battle mode will be hit by the attack?
Yes, and even your character will be hit by its own helper, too.
No need for variables for this, actually, nor hitting.
Give a unique ID to all your helpers, then you can check their distance to each other like this :
Type=Changestate
Trigger1=!Ishelper(900)
Trigger1=abs(Rootdist X-Helper(900),Rootdist X)<30
Trigger1=abs(Rootdist Y-Helper(900),Rootdist Y)<30
Trigger2=!Ishelper(901)
Trigger2=abs(Rootdist X-Helper(901),Rootdist X)<30
Trigger2=abs(Rootdist Y-Helper(901),Rootdist Y)<30
...add the same triggers for the other possible helper IDs, 902,903,904,etc up to the maximum number you can summon.
Will work when they get closer than 30 both horizontally and vertically, change those numbers as you need.

The only thing you have to be careful is that the helpers do need to have a unique ID, so when you spawn a new one, it needs to get an ID not currently in use, so you have to use Numhelper triggers to find an unused number.

Re: Problem with helpers
#7  June 01, 2012, 05:02:50 am
  • avatar
  • *
    • Philippines
    • ulolako35@yahoo.com
Quote
The only thing you have to be careful is that the helpers do need to have a unique ID, so when you spawn a new one, it needs to get an ID not currently in use, so you have to use Numhelper triggers to find an unused number.

how about i make the same id each helper with the same kind,

because what i'm trying to do with this :

Quote
the second helper is a helper that can be summoned by my character or by my first helper depends on the situation

is to make the second helper go to the nearest first helper (i want it to make it look like bouncing)

btw, how should i code the nearest helper with the same kind for my second helper?
Re: Problem with helpers
#8  June 01, 2012, 05:06:13 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
As another thought, please describe the effect you want to achieve. Right now this sounds needlessly complicated, why are helpers spawning new helpers so much when they could simply change state as it sounds like you don't even want them on the screen at the same time.


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.
Re: Problem with helpers
#9  June 01, 2012, 05:20:55 am
  • avatar
  • *
    • Philippines
    • ulolako35@yahoo.com
ok sir here is want i want to do:

when my character spawn helper A it floats in the air,but it will changestate depending on the situation
the situations:
1.) when p2 or another helper A colides with helper A it changestate to Helper C
2.) when my character spawn Helper B, it go straight to helper A, then helper A will change to Helper C but their must be no other helper A  on the screen because if their is another helper A on the screen it summons helper B and helper B will go to the nearest helper A from the helper A that summoned it

i want to make it look like helper B is bouncing to the helper A's on the screen and when their is no more helper A on the screen the last helper A will changestate to helper C

What i want to know:
how to make helper B go to the nearest helper A
how to make helper A changestate when helper A collides with it, because i don't know the trigger to make it look like coliding

P.S.
sorry if it's confusing again
Re: Problem with helpers
#10  June 01, 2012, 10:46:11 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
You make this more confusing by referring to helper C. You have 2 helpers

A and B. Helper A will changestate from A to C, no additional spawning, you include a stateno != C in all your triggering.

Establishing the distance between helpers is difficult yet possible. As seravy says each helper needs a unique ID. How about we simply get all 5 spawning with different ID's first, and make sure that if one reaches it's limit and blows up, the next one is spawned with that ID rather than simply incrementing again?

Then we can work on distances and stuff with some actual values for helper B yes?

That last bit looks mean as well, if you have 5 only the last A changes state to C? Not any of the others as mentioned in 1.)?


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.
Re: Problem with helpers
#11  June 01, 2012, 11:05:12 am
  • ******
  • I hang out tough. I'm a real boss.
    • USA
    • litotichues.com/
I swear when I tested to see if child helpers of the root could use redirection triggers for other child helpers of the root, it didn't work, now it does.

This changes everything.

Sorry for the complication with variables for distance. :(
Re: Problem with helpers
#12  June 01, 2012, 03:03:05 pm
  • avatar
  • *
    • Philippines
    • ulolako35@yahoo.com
@rajaa

what do you mean?
Re: Problem with helpers
#13  June 01, 2012, 03:05:59 pm
  • ****
    • Hungary
    • seravy.x10.mx/Wordpress
So you want something like this, I think (animations, etc not included) :
Code:
[Statedef 900, Spawn helper A]

[State]
Type=Varset
Trgger1=1
var(0)=899

[State]
Type=Changestate
Trigger1=1
value=901

[Statedef 901, Spawn helper A, second part]

[State]
Type=Varadd
Trgger1=1
var(0)=1

[State]
Type=Changestate
Trigger1=Numhelper(var(0))>0
value=901

[State 901]
Type=Helper
Trigger1=1
name="Helper A"
Stateno=910
ID=var(0)
...

[State 901]
Type=Changestate
Trigger1=1
value=... ; wherever you want to return after spawning the helper

[Statedef 905, Spawn helper B]

[State 905]
Type=Changestate
Trigger1=Numhelper(900)+Numhelper(901)+Numhelper(902)+Numhelper(903)+Numhelper(904)=0
value=900 ; Spawn helper A instead if there aren't any.

[State 901]
Type=Helper
Trigger1=1
name="Helper B"
Stateno=920
ID=920
...

[Statedef 910] ; Helper A state

[State 910]
Type=Changestate
Trigger1=abs(P2dist X)<30 ; P2distance
Trigger1=abs(P2dist Y)<30
Trigger2=!Ishelper(900)
Trigger2=abs(Rootdist X-Helper(900),Rootdist X)<30 ; Other helper A distances
Trigger2=abs(Rootdist Y-Helper(900),Rootdist Y)<30
Trigger3=!Ishelper(901)
Trigger3=abs(Rootdist X-Helper(901),Rootdist X)<30
Trigger3=abs(Rootdist Y-Helper(901),Rootdist Y)<30
Trigger4=!Ishelper(902)
Trigger4=abs(Rootdist X-Helper(902),Rootdist X)<30
Trigger4=abs(Rootdist Y-Helper(902),Rootdist Y)<30
Trigger5=!Ishelper(903)
Trigger5=abs(Rootdist X-Helper(903),Rootdist X)<30
Trigger5=abs(Rootdist Y-Helper(903),Rootdist Y)<30
Trigger6=!Ishelper(904)
Trigger6=abs(Rootdist X-Helper(904),Rootdist X)<30
Trigger6=abs(Rootdist Y-Helper(904),Rootdist Y)<30
Trigger7=abs(Rootdist X-Helper(920),Rootdist X)<30 ; Helper B distance
Trigger7=abs(Rootdist Y-Helper(920),Rootdist Y)<30
value=930; state C

[Statedef 920, Helper B state]

[State]
Type=Varset
Trgger1=1
var(0)=899

[State]
Type=Changestate
Trigger1=1
value=921

[Statedef 921, Helper B state part 2]

[State]
Type=Varadd
Trgger1=1
var(0)=1

[State x]
Type=Destroyself
Trigger1=var(0)>=905 ; There are no A type helpers to follow so B is destroyed

[State]
Type=Changestate
Trigger1=Numhelper(var(0))=0
value=921

[State]
Type=Changestate
Trigger1=1
value=922

[Statedef 922, Helper B following first helper A]

[State 921]
Type=Velset
Trigger1=1
X=0.05*(Helper(var(0)),Rootdist X-Rootdist X)
Y=0.05*(Helper(var(0)),Rootdist Y-Rootdist Y)
Re: Problem with helpers
#14  June 02, 2012, 01:01:28 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Seravy: Not quite. He wants to be able to summon helper A up to 5 times.

Helper B is a seperate helper altogether that will travel to the nearest helper A and make it blow up.

By the sounds of it if there is MORE than one helper A out, helper B will travel between all of them only blowing up on the last one and picking the one nearest to root each time.

Helper C is a stupid reference to what should be a changestate for helper A. It actually sounds a little like ukitakes' Orbs in bleach DS 2.


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.
Re: Problem with helpers
#15  June 02, 2012, 04:14:26 am
  • ****
    • Hungary
    • seravy.x10.mx/Wordpress
Quote
Seravy: Not quite. He wants to be able to summon helper A up to 5 times.
That's exactly what my code does except that he is responsible for not calling the new helper generation state when there already are 5 of them if he doesn't want to. The rest of the code assumes there are at most 5 of them created.

Quote
By the sounds of it if there is MORE than one helper A out, helper B will travel between all of them only blowing up on the last one and picking the one nearest to root each time.
Reading it again, this part isn't really clear.
I guess he wants helper B to travel between all of them, and all helper A it reaches should blow up except the last one which changes the state to C.
In that case, my code does that except he needs to code state C to make the helper destroyself itself if it's not the last one alive if he wants that to happen. It's also not clear what should happen when the helper meets another helper A or P2, so in all cases it just changes to state C. If he wants something else, he can replace changestate with destroyself or something else.
Helper B destroying itself if there are no more helper As is included in the code (although it will treat a Helper A in state C as still existing. If that's not desired, instead of a changestate, make helper A spawn a new helper directly in state C)
Last Edit: June 02, 2012, 04:20:28 am by Seravy
Re: Problem with helpers
#16  June 02, 2012, 04:19:29 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
I got the impression spawning helper B was a totally seperate command, not something that happened as a result of helper A. In addition rather than providing a failsafe where B becomes A, you would simply disallow helper B being created if there were no helper A's available.


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.
Re: Problem with helpers
#17  June 02, 2012, 04:21:45 am
  • ****
    • Hungary
    • seravy.x10.mx/Wordpress
It is. Calling state 900 spawns a new helper A, calling state 905 spawns a new helper B (or A if there are no As spawned yet).
To be honest I have no idea what should happen if there are multiple helper Bs and I also didn't bother to move helper B to the nearest helper A, it goes to the one with the lowest ID. If he wants more accuracy than that, he should add a sorting algorythm for the distance.
Last Edit: June 02, 2012, 04:24:56 am by Seravy
Re: Problem with helpers
#18  June 05, 2012, 02:38:27 pm
  • avatar
  • *
    • Philippines
    • ulolako35@yahoo.com
sorry for the late reply

Quote
Seravy: Not quite. He wants to be able to summon helper A up to 5 times

already done this, i already made my char to summon 5 helper A's with different ids

Quote
Seravy: Not quite. He wants to be able to summon helper A up to 5 times

yeah this is correct

Quote
I guess he wants helper B to travel between all of them, and all helper A it reaches should blow up except the last one which changes the state to C.

this is correct also

Quote
To be honest I have no idea what should happen if there are multiple helper Bs

there will only be one helper B at a time, because helper A will just spawn helper B when another helper or helper A reaches its time limit.

the only thing left to finish this attack is the velset of helper b to travel to another helper A, and i can't still do that  :(
Last Edit: June 05, 2012, 02:43:38 pm by SignificantSlice
Re: Problem with helpers
#19  June 05, 2012, 03:13:12 pm
  • ****
    • Hungary
    • seravy.x10.mx/Wordpress
Quote
the only thing left to finish this attack is the velset of helper b to travel to another helper A, and i can't still do that

This code should be doing that (sets velocity to 1/20th of the distance to the helper A with the lowest ID, checking helper IDs from 900 to 904, change the numbers 899 and 905 if you use other IDs).

Quote
[Statedef 920, Helper B state]

[State]
Type=Varset
Trgger1=1
var(0)=899

[State]
Type=Changestate
Trigger1=1
value=921

[Statedef 921, Helper B state part 2]

[State]
Type=Varadd
Trgger1=1
var(0)=1

[State x]
Type=Destroyself
Trigger1=var(0)>=905 ; There are no A type helpers to follow so B is destroyed

[State]
Type=Changestate
Trigger1=Numhelper(var(0))=0
value=921

[State]
Type=Changestate
Trigger1=1
value=922

[Statedef 922, Helper B following first helper A]

[State 921]
Type=Velset
Trigger1=1
X=0.05*(Helper(var(0)),Rootdist X-Rootdist X)*(1-2*(facing!=root,facing)
Y=0.05*(Helper(var(0)),Rootdist Y-Rootdist Y)
Re: Problem with helpers
#20  June 05, 2012, 03:19:46 pm
  • avatar
  • *
    • Philippines
    • ulolako35@yahoo.com
but i thought with this code, helper b will only travel to the helper A with the lowest variable/ID and not the nearest helper A from the helper A that summon helper B

pls correct me if im wrong

BTW, tnx for the code it bacame my basis of what i should do  :)
Last Edit: June 05, 2012, 03:24:24 pm by SignificantSlice