YesNoOk
avatar

Change constant values of character in game? (Read 295 times)

Started by Sheng Long, November 10, 2014, 01:15:19 am
Share this topic:
Change constant values of character in game?
#1  November 10, 2014, 01:15:19 am
  • *****
  • Video Game Veteran
    • USA
    • gcnmario.free.fr
I was wondering if you can change the player's [Movement] yaccel value in game depending if a variable has been changed?

I was thinking along the lines of 'accel = FVar(#)', or 'accel = 0.4 + FVar(#)'. While I'm at it, I would want to change their jump height in game as well to determine the type of character being played based on the new variable that is changed.

If not, maybe there is an alternative to this somehow?

"You must defeat my flaming
dragon punch to stand a chance."
Re: Change constant values of character in game?
#2  November 10, 2014, 02:43:37 am
  • ****
  • Hey.
    • Ukraine
    • mugencoder.com

  • Online
 No you cannot. They're called constants for a reason. ;)

Instead, you have your character run at a speed using a variable you set and then just change it as you want.

-[Все слова это только слова.]-
Re: Change constant values of character in game?
#3  November 10, 2014, 02:57:54 am
  • *****
  • Video Game Veteran
    • USA
    • gcnmario.free.fr
Nah... It's more like character 1 using normal gravity, character 2 using heavy armor type gravity, character 3 balloon type character etc.

I suppose what I COULD do is use a veladd controller in statedef -2, and just use different y velocities for each character that is jumping. XP
In other words, something like this:
Code:
[Statedef -3]

[State -3, Gravity]
type = VelAdd
triggerall = Pos Y < 0
triggerall = StateType = A
triggerall = MoveType != H
trigger1 = Name = "Ryu"
trigger2 = Var(55) <= 0
trigger3 = Var(55) >= 12
y = 0.3

[State -3, Gravity]
type = VelAdd
triggerall = Pos Y < 0
triggerall = StateType = A
triggerall = MoveType != H
trigger1 = Name = "E.Honda"
trigger2 = Var(55) = 1
y = 0.4

[State -3, Gravity]
type = VelAdd
triggerall = Pos Y < 0
triggerall = StateType = A
triggerall = MoveType != H
trigger1 = Name = "Vega"
trigger2 = Var(55) = 11
y = 0.575

Though they may not be accurate right now, but you get the idea. Although this does NOT help with how high they can jump. It just affects their gravity :(

"You must defeat my flaming
dragon punch to stand a chance."
Re: Change constant values of character in game?
#4  November 10, 2014, 03:05:45 am
  • ****
  • Hey.
    • Ukraine
    • mugencoder.com

  • Online
Hmm, so you're trying to make a global gravity system? Interesting. The best way to handle this would be override their states. Is this for a full game by any chance? If so, you have free reign with the common1.cns, so you could simply code your changes into the common states themselves.

-[Все слова это только слова.]-
Re: Change constant values of character in game?
#5  November 10, 2014, 03:28:30 am
  • ****
  • The Legend Will Never Die
    • Mexico
Why?
Twitter: @vans1belmont
1.1 AZRAEL #GDLK
amazon, pls
Re: Change constant values of character in game?
#6  November 10, 2014, 03:39:33 am
  • *****
  • Video Game Veteran
    • USA
    • gcnmario.free.fr
Not a full game per se... Thinking about picking back up one of my Street Fighter Character WIPs, which will have different jump values depending what the variable is. The different gravity setting I changed from what I posted before in statedef -3. But for the different jump heights I might have to mess around with, I guess. I don't know to be honest. Maybe just experiment a little here and there. XP

"You must defeat my flaming
dragon punch to stand a chance."
Re: Change constant values of character in game?
#7  November 10, 2014, 05:04:19 am
  • ******
  • [E]
    • Mexico

  • Online
make the yaccel 0 and code in -2 as necessary, hopefulyl that will break somebody's throws, that would be hilarious.
Re: Change constant values of character in game?
#8  November 10, 2014, 05:19:12 am
  • ****
  • The Legend Will Never Die
    • Mexico
I see, I was thinking that maybe you wanted to program a bonus game and force gravity values to other characters.

If all you want is to be able to change gravity on your own character then just program it manually with yaccels, the rule of thumb is that air code that relies too heavily on gravity controllers or physics = A is not a good idea when making conversions. More over, using an automated solution like the one you posted can cause problems and greatly restricts your options in terms of coding movement.

Consider a physics = N solution and try to study the game behavior a little bit more, you could kill two birds with one stone by implementing more accurate aerial movement.
Twitter: @vans1belmont
1.1 AZRAEL #GDLK
amazon, pls
Re: Change constant values of character in game?
#9  November 10, 2014, 05:36:30 am
  • *****
  • Video Game Veteran
    • USA
    • gcnmario.free.fr
That would be my next question. Although I wasn't sure whether to make another topic about it. Can I ask here?

Is there a condition or trigger to check for player Physics type? Like how there is 'trigger1 = StateType = _', and 'trigger1 = MoveType = _'. I don't know if there is one for Physics condition though to check if it's using A, or N.

Or maybe I should just make another topic for that?

"You must defeat my flaming
dragon punch to stand a chance."
Re: Change constant values of character in game?
#10  November 10, 2014, 06:18:56 pm
  • ****

  • Online
In SF2 gravity varies a lot depending on what exactly the character's doing. For my SF2 Akuma I set his yaccel constant as 0.28125, which is the standard gravity for midair hit reels (for all characters). So that's the gravity he'll use when he gets hit by an opponent who doesn't have a yaccel parameter set in their hitdef. For everything else I used physics type N and just implemented gravity with VelAdds in each state, the value of which varies from state to state. For example, during a jump it's 0.3125, but during a Shoryuken or the rising/falling part of a Hurricane Kick it's 0.375.

So yeah, I'll sort of echo what Vans has said. Implement your gravity manually for each state instead of using physics type A.
Re: Change constant values of character in game?
#11  November 11, 2014, 12:56:02 am
  • *****
  • Video Game Veteran
    • USA
    • gcnmario.free.fr
Okay, so what Ive done was just set the constant 'yaccel = 0', and for each character variable set their own y gravity in the override section statedef -3 for when their 'statetype = A' & 'movetype != H', and when they are using normal jumping attack statedefs (600-700 something, etc). For their moves that are statedef 1000 onward, just come up with different y velocities depending on their attacks. :)

As for jumping velocity, I just made a new statedef 40, and included everyone's own X and Y jump speeds so they don't share the velocities of one character constants. This also applies for their walking X speeds. :)

Well..... Thanks for the help anyway. I just did some alternatives for what I wanted to do. The only problem now is that all the characters I have included in one format will share the same mid.pos x,y and head.pos x,y offsets, but how much does that really matter?

"You must defeat my flaming
dragon punch to stand a chance."
Re: Change constant values of character in game?
#12  November 11, 2014, 08:11:43 am
  • ***
    • USA
It'll matter when they're thrown and other states.
Samus' homing missiles use midpoint and head position to track P2 down.