YesNoOk
avatar

p1 changestate based on helper (Read 522 times)

Started by sgn15, March 17, 2012, 01:55:35 pm
Share this topic:
p1 changestate based on helper
#1  March 17, 2012, 01:55:35 pm
  • ***
[State 410, 5]
type = ChangeState
; if helper does NOT hit successfully
trigger1 = helper(411),stateno = 413 && helper(411),animtime = 0

; if helper hit successfully
trigger2 = helper(411),stateno = 412 && helper(411),animtime = 0
value = 0
ctrl = 1

410: p1 calls helper 411
helper 411 has 3 states, 411 (start/grab attempt), 412 (hit successful), 413 (dodged or guarded)
410 changes to 0 if helper did not hit successfully or if hit successfully (412's animtime = 0)

the code above works like i wanted to, but i need to remove the debug mode spam.
"player in state 410: has no helper (411)"

help?
Re: p1 changestate based on helper
#2  March 17, 2012, 02:07:25 pm
  • **
  • "..."
    • Chile
The debug message is displayed because the triggers reference a helper when there isn't one (when your character hasn't created the helper yet). You have to add a check so it will only ask for the helper's state when there is such a helper;

[State 410, 5]
type = ChangeState
triggerall = NumHelper(411)
; if helper does NOT hit successfully
trigger1 = helper(411),stateno = 413 && helper(411),animtime = 0
; if helper hit successfully
trigger2 = helper(411),stateno = 412 && helper(411),animtime = 0
value = 0
ctrl = 1

Hope it helps!
Re: p1 changestate based on helper
#3  March 17, 2012, 03:06:49 pm
  • ***
thanks. i actually know the reason of the debug mode message (like you explained), but i never really thought about that solution. thanks again

edit: what does a message "state 5900: can't map palette from 1,1 to 1,2" mean? i only have 1 palette file and i never changed anything in state 5900?

edit2:
i also have a similar problem to the first problem, but a bit different
[State 430, 5]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = numhelper(438)
trigger2 = helper(438),time = 0 && p2stateno != 443
value = 445
ctrl = 1

430 calls helper 437
helper 437 sends p2 to custom state 443
helper calls helper 438
for guarded/dodged, i want to changestate to 0 when helper 438 time = 0 (meaning 437 missed)
for hit, i want to go to 0 when animtime = 0 of p1 (anim 430)

the changestate above does not work when 437 does not successfully hit p2. help?
Last Edit: March 17, 2012, 03:29:47 pm by sgn15
Re: p1 changestate based on helper
#4  March 17, 2012, 05:59:43 pm
  • **
  • "..."
    • Chile
I think it's because in the .def file you specified numbers different from 1 in the [Palette Keymap] section. I'm not sure about it though, as I solved that problem by creating a few palettes. Maybe someone else can explain it better.

About the helper problem... "Helper(438), Time = 0" is true only on the first tick of Helper 438: it will only be true if there IS a helper with ID 438. If you want the trigger to activate when there isn't a Helper with ID 438, you should use !NumHelper(438) or NumHelper(438) = 0. I'm not sure I understood the situation completely, though.
Last Edit: March 17, 2012, 06:10:54 pm by SilentProtagonist
Re: p1 changestate based on helper
#5  March 17, 2012, 06:14:12 pm
  • ***
  • Man of the highest caliber
    • USA
    • soldier.ucoz.net/
That palette error is when you're using 1.0, but you don't have state 5900 in your cns. I just assumed 5500 is also needed. Just put these states in your cns.

Code:
;---------------------------------------------------------------------------
; Continue?
[Statedef 5500]
type = S
ctrl = 0
anim = 5300
velset = 0,0

[State 5500, 1] ;Use continue animation if available
type = ChangeAnim
trigger1 = time = 0
trigger1 = SelfAnimExist(5500)
value = 5500

;---------------------------------------------------------------------------
[Statedef 5900]
type = S
sprpriority = -2

[State 5900, 1]
type = VarRangeSet
trigger1 = time = 0
trigger1 = roundsexisted = 0
value = 0

[State 5900, 2]
type = VarRangeSet
trigger1 = time = 0
trigger1 = roundsexisted = 0
fvalue = 0

; This controller is for when you're using SFFv2. It needs to be in state 5900 and state 190. You also need the [Palette Keymap] in your def file. If you're using the old SFF, you don't need to use this code.
[State 0, RemapPal]
type = RemapPal
trigger1 = Time = 0
source = 1,1
dest = 1,palno
ignorehitpause = 1

[State 5900, 3]
type = ChangeState
trigger1 = roundno = 1
value = 190

Here's the palette keymap.
Remove the "pal1=[Palette name here].act" lines from your def if you're using SFFv2 and replace it with the palette keymap.

[Palette Keymap]
x = 4 ;Press button X to select palette 1, etc.
y = 5
z = 6
a = 1
b = 2
c = 3
x2 = 10 ;Hold Start and press button X for palette 7, etc.
y2 = 11
z2 = 12
a2 = 7
b2 = 8
c2 = 9

For your changestate problem. You're saying it's not working when it's guarded?
Try this trigger.

trigger1 = (HitCount = 0) && (MoveGuarded)

For dodging, just have it changestate after a certain amount of time.
"There is nothing either good or bad, but thinking makes it so."
Last Edit: March 17, 2012, 06:19:43 pm by Noctis
Re: p1 changestate based on helper
#6  March 18, 2012, 05:46:26 am
  • ***
yeah i was using 1.0. i have states 5900 and 5500 and i never tinkered with anything on the common1.cns so far. that is why i am confused why there is a debug warning message. i also have the pal1 = char.act in the def. i am not using sffv2 though so i guess it is ok. so what should i do now? i have other chars but they never had this warning problem

for the other problem, i will tell how it was coded (but the question was also for p1's changestate based on helper):

430: p1 calls helper 437 (almost immediately after a long superpause for aesthetic purposes, just to make p2 not able to dodge it)

now,  after p1 calls 437, immediately, p1 disappears (invisible from the game screen via a long-timed blank animelem) until the end of the successful attack (which is why i need to go to state 0 instantly if the attack did not hit successfully, to avoid the long time p1 will not be in the game)

437 is an unguardable attack that sends p2 to custom state 443 (but when i used this while p2 is in lie down or get up, it does not hit, this is where the problem starts)

437 calls helper 438 at animelem = 8 (437 has 10 animelems in total)

what i want is by the time helper438 is created (and existing), if p2 was not hit (and therefore not in my custom state 443),

1.  the helper 438 will disappear (destroyself)
2. p1 will go back to stance (state 0) immediately

i was able to do number 1, number 2 is my problem

[State 430,  ChangeState]
type = ChangeState
trigger1 = AnimTime = 0 ;<-------------------this is when the attack hits and everything goes as planned/coded
trigger2 = numhelper(438) ;<-------------------this is for only checking when there is a helper 438 existing (similar to the original problem of this thread)
trigger2 = helper(438),time >= 0 && p2stateno != 443 ;<-------------------this is for checking if p2 is in my custom state when helper 438 is created and existing
value = 445
ctrl = 1

i tried my best in explaining. sorry if it is still confusing.
anyone can help me with both problems?
Last Edit: March 18, 2012, 03:03:46 pm by sgn15
Re: p1 changestate based on helper
#7  March 18, 2012, 07:00:01 am
  • ***
  • Man of the highest caliber
    • USA
    • soldier.ucoz.net/
I'm really tired so I'll do my best.
It didn't hit your opponent while they were falling or lying down because either your hitflag doesn't have FD in it, or your opponent can't be hit while falling or lying down.
The hitflag should look like this hitflag = MAFD
As for getting up, I don't think you can get hit while in the get up state. You'd have to change that yourself by removing the nothitby controller in state 5201.
Now, for when it doesn't hit your opponent at all...
Are you saying you want to go to state 0 if the HELPER doesn't hit?
Well, I tried testing something and could not get it to work to save my f'ing life, so I'm sorry. I can't help you there.
Maybe try using a projectile and a Projhit(ID of the Projectile here) = 0 for miss.
Or wait until someone can come and help you.
"There is nothing either good or bad, but thinking makes it so."
Re: p1 changestate based on helper
#8  March 19, 2012, 07:26:38 am
  • ***
ok thanks. the removing of nothitby in get up state will solve the problem only when i used the attack on p2 char which is the same char.

anyone else has a solution?  please help. thanks
Re: p1 changestate based on helper
#9  March 19, 2012, 07:28:44 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
you're still on the first page and i know you just reposted then deleted what was here before.

Don't do that again. Your help is no more important than anyone elses. I don't care if you haven't got it solved yet, if you are on page one you do not bump.


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: p1 changestate based on helper
New #10  March 22, 2012, 05:58:14 am
  • ***
i managed to solve the p1 changestate based on helper. can anyone help me with my palette problem (posted in previous posts here) ?

edit:
the message "state 5900: can't map palette from 1,1 to 1,2" suddenly disappeared. so that is ok now, but a new debug warning appeared

"info: player loading player in pre-1.0 compatible mode"

i don't think i did anything unusual in it and i used mugen 1.0 common1 file and never tinkered with it. i loaded the char in ff thru mugen 1.0.

you have any ideas on this?
Last Edit: March 22, 2012, 06:40:02 am by sgn15