Advanced stage transition help needed.

Started by VGames, October 27, 2017, 02:54:58 AM

Previous topic - Next topic

VGames

Ok I'm trying to get the characters to enter a specific state at a certain time on a specific stage. Keep in mind I'm using the pos z trigger to detect what stage the characters are on. I've tried doing this in a lot of ways. Basically I just need somebody to tell me how to go about doing this to set me on the right path. I don't need code I just need direction. I also want to use the common1.cns as much as possible.

Where I'm at now is I have the character call on a helper in their statedef 190. The helper is coded in the common file. The helper simply sets var 23 to 0 when it spawns and then at time = 600 it sets variable 23 to 5678 and then immediately after it sets var 23 back to 0. In the characters statedef -2 there's a a state -2 changestate that is looking for var 23 to equal 5678 to initialize the state I want them to go to. It seems like it should work but the characters do nothing. I've also tried putting the helper code in the characters cns instead of the common.cns. No change.

If I can get the characters to jump as they should I'm gonna have the stage transition at the moment they're in the custom state I want them to change too at 600 ticks.

Please shed some light on this if u can.

altoiddealer

#1
Helpers get their own sets of Vars, so unless you are using "ParentVarSet" controller, it sounds like you might be setting a helper var, then evaluating the player's vars and of course not triggering anything.  You can also redirect triggers to the helper from State -2 such as "helper(1234),Var(23) = 5678"


Odb718

-edited- I misread.
Use ctrl+d and switch to the helper. Use displaytoclipboard in the helper to post the var's value. If you see it change you know it's not the helper.
vVv Gouken718 vVv SabreTooth718 vVv


VGames

I'll try both of these out for sure when I get home. But I think the "Helper(1234),Var(23) = 5678" is gonna do the trick. I knew there was something I was missing to link the var(23) in the character and the helper. I didn't realize they didn't share var even when the helper was called by the character.

Is there a document somewhere that shows triggers like "Helper(1234),Var(23)"? I see triggers being used in people's code like this but I can't find where they learned this stuff from.  I've tried mixing triggers like this to see what I get and usually get crashes instead.

altoiddealer

#4
MUGEN Class subforum is great.

You should probably just bookmark the stickied topic The MUGEN Docs Master Thread which has all the topics linked.

The one you're asking about specifically is Trigger Redirections.  These are relative to where the code is being used... so "parent," is worthless in the Player's code, but is used commonly in Helper states.  During the Win Pose phase, you can't use triggers like "P2Dist", "P2StateNo", etc, because MUGEN does not recognize the players for whatever reason... you have to instead resort to trigger redirections like using "enemy,pos x - pos x < 100", "enemynear,StateNo = 1000", etc.  "target," and "target(**)," redirections are very useful during hits.

Redirections are very useful in general :)  Tons of them in my Jailbot character's code.


VGames

Holy crap I hit the motherload now. Thanks for the link and tips. I'll get back to you guys ASAP on the stage transition problem.

While I got your attention I was asking ELECTR0 about something he pulled off on his Ult Hong Kong stage that I was unable to recreate. He has not responded yet so I figured I'd ask here since it's also stage related. Here was my question to him. Help if you can please.

Hey man I got a question about your Ult Hong Kong stage regarding the intro where the camera pans down from above the stage. I've tried doing this using a method found here: http://mugenguild.com/forum/topics/stage-sound-effects-151142.msg1776578.html#msg1776578

Its in the conversation between me a Liquid_Jake near the middle and bottom of the page. Anyways the camera pans down from the top as it should but it messes up the camera for the rest of the match. Having to adjust the zoffset for the stage to accommodate the camera panning down intro causes the camera to not go up as high as it should without the camera intro effect. The characters can't jump as high as they should and if they're knocked into the air the camera will follow but it will go to far up and expose the black or hot pink background behind that sky art. It really messes everything up. Could you shed some light on this issue? I cannot download anything right now so that's why I haven't been able to go through your stage def to see how you pulled it off.

altoiddealer

I only code for 1.0 (so far), so if this is a 1.1 question, I can't help you.

If this is for a "fullgame" you could use Screenbound controller for P1 and P2 (affectcamera =0 / movecamera = 0), and position a helper with Screenbound (affectcamera =1 / movecamera = 1) in the air at the beginning of the match which I imagine would snap the camera up... if the helper has statetype = A (air) it should just fall and bring the camera down, otherwise use StateType = N with a VelSet Y.

Not sure how else to pull that off.  I'm not sure how to handle such an effect using only the Stage's code.


VGames

Yes this is for my Guilty Gear XX game. None of my characters are 1.1 ready and they'll probably never be. They are 1.0 ready though so I could use this method instead of coding the intro camera into the stage. Would take care of all my problems with the stage itself. Another great tip from the master.

I'll test these both and get back to you. Thanks for the help.

altoiddealer

Glad to help when I can!

Things I'm not sure of:
-The helper may require a blue CLSN box to affect the camera
-The camera may not snap up if the helper is PosSet there - you may need to do something like Vel Y = -100 for 1 tick duration.


VGames

Ok so far I got the character to do the state I want when that var 23 is set to the value mentioned above. The character tracks the var properly. Thanks a lot. But another problem has come up. If u skip the charcter intro at any point the helper is removed. How do u keep the helper from going away?

VGames

Ok just found out helpers are removed if the vs intro is skipped. So stupid. And I can't think of a proper trigger in statedef 0 that would respawn the helper if it wasn't there just one time and only one time. Plus it would have to calculate how much time was skipped to make sure the custom state is activated on par with the stages transition. I guess I could just stress to all players they don't need to skip intros and if they do they need to hit shift + F4.

VGames

On a good note I went ahead and went with the stage implementation of the camera intro effect and realized I needed to link a dummy actor to the zoffsetlink. So it works as it should now. Of course u don't want to skip th intro before the camera is done moving. It'll still move to where it needs to be if u skip the intro but it will do this while the fight is starting.

Odb718

If you have an extra var laying around I think you can start a var in statedef 5900, and have all of your states add to it.
Then you'd check if helper(718) != 0, and check to see if the helper's var matches the player's var in statedef 0.
Make it have a check so that if the var >= 0 continue. And make a varset that sets the var to -718 so it stops the var add. It'll cut resources down.

For making sure a helper hasnt been deleted, do just that. In statedef spawn the helper. Check if Helper(718) = 0 and you should be good. Look into NumHelper too.

Since you're getting into some random stuff, you'll probably come across a ton of errors. This is a major bug squasher thread.
http://mugenguild.com/forum/topics/necessary-triggeralls-redirects-and-some-sctrls-debug-141934.0.html
bookmark ^^that^^ page. It comes in extremely handy.
vVv Gouken718 vVv SabreTooth718 vVv


VGames

Hey thanks man. I'll look into all of this. But my main issue is how do I get back the time that was lost for the helper when it is removed during the intro skip. It has to be respawned with its time starting at the same time it had when it was deleted. I think this is impossible.

altoiddealer

So I'm guessing that you don't want to just use "Gametime = 600" as a trigger in each player, because you need a helper to be affected by game pauses (like the stage animations), because Gametime keeps running.  Right?

Spawn the helper at State 5900.  Create a new helper at roundstate 2 if NumHelper(**) = 0.
If you're not worried about possible pauses in intro state, set one of the helper's parameters like "height" as "Gametime" so you capture that time... then you can use a trigger like "Time - const.size.height = 600".
To factor possible pauses, you can instead use a ParentVarAdd in the first helper... have the new helper factor that Var which will stop increasing if the intro gets skipped.


VGames

It'll still remove the helper if the intro is skipped though wouldn't it. I think I'll just have to stress to everybody not to skip intros. I really wish the removal of helpers when skipping intros wasn't a thing. Makes no sense.

altoiddealer

I'm saying you should have another Helper controller in State -2 or State 0 that checks if the Intro helper exists and if not, create a new one.  If you use the first one to ParentVarAdd the player will still have the counter saved when it got chopped off - the second helper can pick up where the first one left off.


VGames

Oh ok I understand. I'm sorry I misread what u said. I'll try it out. Get back to u ASAP. Thanks man.

VGames

Oh yeah one other thing. I've got all the characters calling on this helper. I've noticed that player 3 and 4 however don't react to the helpers var which should make them go into the custom state which is a really high jump. Only player 1 & 2 react to the helpers var. Why is this?

VGames

Ok I haven't gotten to the parentvaradd part yet because I can't keep the helper from spawning if it has already spawned once before and did it's job. I've tried using a var in the helper to let the player know that the helper has spawned once already and did it's job and does not need to be respawned again after it was removed. I'm really getting tired of this. I'm actually considering using explodes to make the stage transform.