YesNoOk
avatar

Const (*) (Triggers) (Read 8874 times)

Started by JustNoPoint, September 18, 2015, 04:20:57 pm
Share this topic:
Const (*) (Triggers)
New #1  September 18, 2015, 04:20:57 pm
  • ******
    • www.justnopoint.com/
Returns the value of one of the player's constants.

Format:
Const(param_name)

Arguments:
param_name

The name of the constant to check. Valid values are:
Return type:

Depends on specified hit parameter. See Details.

Error conditions: none

Details:
The following values of param_name return values specified in the [Data] group in the player's constants.

  • data.life: Returns value of the "life" parameter. (int)
  • data.power: Returns value of the "power" parameter. (int)
  • data.attack: Returns value of the "attack" parameter. (int)
  • data.defence: Returns value of the "defence" parameter. (int)
  • data.fall.defence_mul: Returns value of the defence multiplier, calculated as 100/(f+100), where f is the "fall.defence_up" parameter. (float)
  • data.liedown.time: Returns value of the "liedown.time" parameter. (int)
  • data.airjuggle: Returns value of the "airjuggle" parameter. (int)
  • data.sparkno: Returns value of the "sparkno" parameter. (int)
  • data.guard.sparkno: Returns value of the "guard.sparkno" parameter. (int)
  • data.KO.echo: Returns value of the "ko.echo" parameter. (int)
  • data.IntPersistIndex: Returns value of the "IntPersistIndex" parameter. (int)
  • data.FloatPersistIndex: Returns value of the "FloatPersistIndex" parameter. (int)
The following values of param_name return values specified in the [Size] group in the player's constants.

  • size.xscale: Returns value of the "xscale" parameter. (float)
  • size.yscale: Returns value of the "yscale" parameter. (float)
  • size.ground.back: Returns value of the "ground.back" parameter. (int)
  • size.ground.front: Returns value of the "ground.front" parameter. (int)
  • size.air.back: Returns value of the "air.back" parameter. (int)
  • size.air.front: Returns value of the "air.front" parameter. (int)
  • size.height: Returns value of the "height" parameter. (int)
  • size.attack.dist: Returns value of the "attack.dist" parameter. (int)
  • size.proj.attack.dist: Returns value of the "proj.attack.dist" parameter. (int)
  • size.proj.doscale: Returns value of the "proj.doscale" parameter. (int)
  • size.head.pos.x: Returns x-component of the "head.pos" parameter. (int)
  • size.head.pos.y: Returns y-component of the "head.pos" parameter. (int)
  • size.mid.pos.x: Returns x-component of the "mid.pos" parameter. (int)
  • size.mid.pos.y: Returns y-component of the "mid.pos" parameter. (int)
  • size.shadowoffset: Returns value of the "shadowoffset" parameter. (int)
  • size.draw.offset.x: Returns x-component of the "draw.offset" parameter. (int)
  • size.draw.offset.y: Returns y-component of the "draw.offset" parameter. (int)

The following values of param_name return values specified in the [Velocity] group in the player's constants.
  • velocity.walk.fwd.x: Returns value of the "walk.fwd" parameter. (float)
  • velocity.walk.back.x: Returns value of the "walk.back" parameter. (float)
  • velocity.run.fwd.x: Returns x-component of the "run.fwd" parameter. (float)
  • velocity.run.fwd.y: Returns y-component of the "run.fwd" parameter. (float)
  • velocity.run.back.x: Returns x-component of the "run.back" parameter. (float)
  • velocity.run.back.y: Returns y-component of the "run.back" parameter. (float)
  • velocity.jump.y: Returns y-component of the "jump.neu" parameter. Note: this is NOT "velocity.jump.neu.y". Only the "neu" parameters take a y-component value. (float)
  • velocity.jump.neu.x: Returns x-component of the "jump.neu" parameter. (float)
  • velocity.jump.back.x: Returns value of the "jump.back" paramamter. (float)
  • velocity.jump.fwd.x: Returns value of the "jump.fwd" parameter. (float)
  • velocity.runjump.back.x: Returns value of the "runjump.back" paramamter. (float)
  • velocity.runjump.fwd.x: Returns value of the "runjump.fwd" parameter. (float)
  • velocity.airjump.y: Returns y-component of the "airjump.neu" parameter. Note: this is NOT "velocity.airjump.neu.y". (float)
  • velocity.airjump.neu.x: Returns x-component of the "airjump.neu" parameter. (float)
  • velocity.airjump.back.x: Returns value of the "airjump.back" paramamter. (float)
  • velocity.airjump.fwd.x: Returns value of the "airjump.fwd" parameter. (float)
  • velocity.air.gethit.groundrecover.x: Returns x-component of the "air.gethit.groundrecover" parameter. (float)
  • velocity.air.gethit.groundrecover.y: Returns y-component of the "air.gethit.groundrecover" parameter. (float)
  • velocity.air.gethit.airrecover.mul.x: Returns x-component of the "air.gethit.airrecover.mul" parameter. (float)
  • velocity.air.gethit.airrecover.mul.y: Returns x-component of the "air.gethit.airrecover.mul" parameter. (float)
  • velocity.air.gethit.airrecover.add.x: Returns x-component of the "air.gethit.airrecover.add" parameter. (float)
  • velocity.air.gethit.airrecover.add.y: Returns x-component of the "air.gethit.airrecover.add" parameter. (float)
  • velocity.air.gethit.airrecover.back: Returns value of the "air.gethit.airrecover.back" parameter. (float)
  • velocity.air.gethit.airrecover.fwd: Returns value of the "air.gethit.airrecover.fwd" parameter. (float)
  • velocity.air.gethit.airrecover.up: Returns value of the "air.gethit.airrecover.up" parameter. (float)
  • velocity.air.gethit.airrecover.down: Returns value of the "air.gethit.airrecover.down" parameter. (float)

The following values of param_name return values specified in the [Movement] group in the player's constants.
  • movement.airjump.num: Returns value of the "airjump.num" parameter. (int)
  • movement.airjump.height: Returns value of the "airjump.height" parameter. (int)
  • movement.yaccel: Returns value of the "yaccel" parameter. (float)
  • movement.stand.friction: Returns value of the "stand.friction" parameter. (float)
  • movement.crouch.friction: Returns value of the "crouch.friction" parameter. (float)
  • movement.stand.friction.threshold: Returns value of the "stand.friction.threshold" parameter. (float)
  • movement.crouch.friction.threshold: Returns value of the "crouch.friction.threshold" parameter. (float)
  • movement.jump.changeanim.threshold: Returns value of the "jump.changeanim.threshold" parameter. (float)
  • movement.air.gethit.groundlevel: Returns value of the "air.gethit.groundlevel" parameter. (float)
  • movement.air.gethit.groundrecover.ground.threshold: Returns value of the "air.gethit.groundrecover.ground.threshold" parameter. (float)
  • movement.air.gethit.groundrecover.groundlevel: Returns value of the "air.gethit.groundrecover.groundlevel" parameter. (float)
  • movement.air.gethit.airrecover.threshold: Returns value of the "air.gethit.airrecover.threshold" parameter. (float)
  • movement.air.gethit.airrecover.yaccel: Returns value of the "air.gethit.airrecover.yaccel" parameter. (float)
  • movement.air.gethit.trip.groundlevel: Returns value of the "air.gethit.trip.groundlevel" parameter. (float)
  • movement.down.bounce.offset.x: Returns x-component of the "down.bounce.offset.x" parameter. (float)
  • movement.down.bounce.offset.y: Returns y-component of the "down.bounce.offset.y" parameter. (float)
  • movement.down.bounce.yaccel: Returns value of the "down.bounce.yaccel" parameter. (float)
  • movement.down.bounce.groundlevel: Returns value of the "down.bounce.groundlevel" parameter. (float)
  • movement.down.friction.threshold: Returns value of the "down.friction.threshold" parameter. (float)

Example:

Code:
trigger1 = Const(velocity.walk.fwd.x) > 4
  Triggers if the forward walking velocity is greater than 4.
Last Edit: May 04, 2018, 11:29:24 pm by Odb718
Re: Const (*) (Triggers)
#2  September 19, 2015, 04:14:12 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Also useful in custom states, or other things where you want to set a value to what the character normally uses. Generally walk or y.accel though.


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: Const (*) (Triggers)
New #3  October 29, 2015, 06:34:32 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
I was recently trying to debug an issue with my project, and gained some insight on this trigger in the process that might be helpful to others.  It isn't exactly specific to this trigger... however the behavior of this trigger was not as I would have assumed.

This information is important to know if you are using this trigger Const(*) to evaluate another player's constants through trigger redirection, OR if using Const(*) within a custom state.

If player 1 and player 2 have differing local coordinate space (LCS), the value being return is automatically "translated" (scaled up/down) based on the LCS of each player.
  • The value is always relative to the player performing the evaluation.
  • When used in custom state, the value of Const(*) is treated as if the "parent" (player 1) is performing the evaluation (the as if it was being used with trigger redirection)
  • It doesn't matter if MUGEN is running in 240p, 480p, or 720p.  It still works the same as described below.

EXAMPLE: Player 1 obtains a value of player 2 with the following trigger: enemynear,Const(size.height)
  • If P1's LCS is 240p and P2's LCS is 240p, the value returned will be exactly as it appears in player 2's CNS file.
  • If P1's LCS is 240p and P2's LCS is 480p, the value returned will be 1/2 of what appears in player 2's CNS file.
  • If P1's LCS is 240p and P2's LCS is 720p, the value returned will be 1/3 of what appears in player 2's CNS file.
likewise...
  • If P1's LCS is 480p and P2's LCS is 240p, the value returned will be 2X of what appears in player 2's CNS file.
  • If P1's LCS is 720p and P2's LCS is 240p, the value returned will be 3X of what appears in player 2's CNS file.

Last Edit: October 29, 2015, 06:38:08 pm by altoiddealer