YesNoOk
avatar

Const240p, Const480p, & Const720p (Triggers) (Read 16875 times)

Started by Ricepigeon, September 15, 2015, 07:02:42 pm
Share this topic:
Const240p, Const480p, & Const720p (Triggers)
#1  September 15, 2015, 07:02:42 pm
  • *****
  • Thanks and God bless
    • USA
    • ricepigeon.neocities.org
Converts a value from the 240p, 480p, or 720p coordinate spaces to the player's coordinate space. The conversion ratio between coordinate spaces is the ratio of their widths.

Format:
    1.) Const240p(exprn)
    2.) Const480p(exprn)
    3.) Const720p(exprn)
Arguments:
    exprn
        Expression containing the value to convert. (float)
Return type:
    float
Error conditions:
    Returns bottom if exprn evaluates to bottom.
Notes:
    Non-zero position and velocity offset values in common1.cns should use one of the Const triggers to maintain consistency with characters from a different coordinate space.

Examples:
Code:
value = Const240p(3)
  Sets value 3 if the player has a coordinate space of 320x240 (240p).
  Sets value 6 if the player has a coordinate space of 640x480 (480p).
  Sets value 12 if the player has a coordinate space of 1280x720 (720p).
Code:
value = Const480p(6)
  Sets value 3 if the player has a coordinate space of 320x240 (240p).
  Sets value 6 if the player has a coordinate space of 640x480 (480p).
  Sets value 12 if the player has a coordinate space of 1280x720 (720p).
Code:
value = Const720p(12)
  Sets value 3 if the player has a coordinate space of 320x240 (240p).
  Sets value 6 if the player has a coordinate space of 640x480 (480p).
  Sets value 12 if the player has a coordinate space of 1280x720 (720p).

Additional Notes:
The player's coordinate space is the value defined by the localcoord= parameter in the character's def file.
Last Edit: September 18, 2015, 02:49:14 pm by Just No Point
Re: Const240p, Const480p, & Const720p (Triggers)
#2  September 15, 2015, 07:10:51 pm
  • *****
  • Thanks and God bless
    • USA
    • ricepigeon.neocities.org
From my own testing I noticed that a 240p character could place a 480p or 720p character into a custom state and be able to apply controllers such as velset without the need for these controllers with no adverse effects (eg, setting a velset of -3 within the custom state seems to replicate the behavior of -6 would in 480p space or -12 in 720 space, for those respective characters). Out of curiousity, are these triggers automatically applied to characters when placed in a custom state by a character with a different coordinate space?
Re: Const240p, Const480p, & Const720p (Triggers)
#3  September 19, 2015, 11:04:24 am
  • *****
  • Shame on you!
    • USA
I'm not 100% positive, but the way I've always understood Mugen to handle custom hit states was, It's actually P1 but it's posting sprites using P2's sff.
I think this is another reason why target, command = "x" will work 2 ways. 1 in a custom hit state and a regular hit state.
I dont think the velocities or anything get scaled for P2. P2 images get scaled to P1?
vVv Ryuko718 Updated 10/31/22 vVv
Re: Const240p, Const480p, & Const720p (Triggers)
#4  December 13, 2017, 09:24:19 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
Can anyone please explain a logical use for these triggers?
I would think any values you would want to plug in there would already be converted by MUGEN automatically.


**EDIT** OK - I did some testing and I have some insights that are not clear from Elecbyte's documentation:

The effect of Const240p/480p/720p is based on the current Stage's coordinate space
When using Const240p/480p/720p, it compares the current Stage's coordinate space against the player's coordinate space, and converts the value accordingly.
Refer to the examples in the OP.
To clarify: MUGEN maintains the stage's coordinate space, and adopts all the players code, sprites, etc to fit within it.


It can be useful to use Const240p/480p/720p when evaluating one's own Constants
When using the Const(*) trigger to check one's own constants (size.height, size.ground.front, velocity.walk.fwd.x, etc), the values returned are always exactly what is in the character's own CNS, regardless of what the Stage's coordinate space is...  UNLESS, you factor in Const240p/480p/720p - in which case the value returned WILL be converted to the current Stage's coordinate space.
Spoiler: EXAMPLE SCENARIO: A high res 720p character with a height of 165, playing on a 240p stage (click to see content)
Final note: By comparing the value of one of your Constants, against the same but with Const240p/480p/720p applied - the coordinate space of the stage can be determined.  This may be useful (?)


It's not useful to use Const240p/480p/720p with trigger redirections, to any other player
Quite interestingly, if you using trigger redirection with Const(*) to check another player's values, the values returned are always scaled to the coordinate space of the player who is doing the checking.
When evaluating another Player's Constants through redirection, the values will always be treated as if the other player is your own coordinate space.  Therefore, it is not possible to detect or determine what another Player's local coordinate space is
Spoiler: EXAMPLE SCENARIO: A low res 240p character checks a high res 720p character's height (who has a height of 165) in a 240p Stage (click to see content)

Last Edit: December 15, 2017, 04:43:31 pm by altoiddealer
Re: Const240p, Const480p, & Const720p (Triggers)
#5  March 22, 2019, 04:21:00 am
  • **
  • From Brazil! Why not?
    • Brazil
    • ryouwin.smeenet.org
.   Try check the ( enemy, const(size.head.pos.y)  ). It goes to original value of the char executing a throw.
- - - - -Hobby & Mugen (Smeenet version) - - - - - http://ryouwin.smeenet.org/               Last updates:
Agent Miner v.11,12,2022RoboCop S.Pack v.01,20,2022Eraya v.02,19,2022A.L.L.O.Y.(HD) v.12,25,2021