YesNoOk
avatar

ID is not returning the actual char ID (Read 8510 times)

Started by SaltAddict, January 24, 2024, 11:08:51 am
Share this topic:
ID is not returning the actual char ID
#1  January 24, 2024, 11:08:51 am
  • avatar
  • ***
    • Portugal
I have no idea what's causing this, but using
Code:
fall.envshake.ampl = ID
to attach the attacker ID to the hitdef so the target can know what char hit it during custom states isn't returning the actual ID of the attacker. Instead it seems to return their ID - 1 for some reason (e.g if the attacker is p1 it should return 56 but returns 55 instead). Only happens in MUGEN, in IKEMEN it returns what you would expect. And I'm not using the other fall.envshake parameters in these hitdefs at all.

An example of the code in the custom states:
Code:
[State set speed]
type = velset
triggerall = PlayerID(GetHitVar(fall.envshake.ampl)), var(50) = 0
trigger1 = time = 0
x = (2 + ((random/999.0) * 1.0))*PlayerID(GetHitVar(fall.envshake.ampl)), fvar(10) ;2 plus a number between 0 and 1 added at random
y = -7*PlayerID(GetHitVar(fall.envshake.ampl)), fvar(11)

It makes me think its a MUGEN glitch but I haven't been able to find anyone having similar problems.
Re: ID is not returning the actual char ID
#2  January 24, 2024, 02:00:40 pm
  • ******
    • Portugal
    • network.mugenguild.com/pots/
Tried Mugen 1.0, 1.1 and Ikemen GO and they all seemed to work correctly.

Example:
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.
Re: ID is not returning the actual char ID
#3  January 24, 2024, 03:34:42 pm
  • avatar
  • ***
    • Portugal
Tried Mugen 1.0, 1.1 and Ikemen GO and they all seemed to work correctly.

Example:


Yeah it seems it doesn't happen on other characters. The problem is only with my MK2 Cage.
It definitely returns 55 on my end:


Seems to be a problem on the attacker's side?



I've tried removing all his helpers and envshakes but it still happens
Last Edit: January 24, 2024, 06:21:28 pm by SaltAddict
Re: ID is not returning the actual char ID
#4  January 24, 2024, 08:10:18 pm
  • ****
  • it's me
  • Bat's a Wrap.
    • Chile
    • koakoa@jabber.org
    • Skype - koakumadevil69
I figured out the problem, it's a rounding error that happens on characters with big enough horizontal localcoord on MUGEN. It seems characters with horizontal localcoord of at least 720 from my experiments experience this issue when returning values from fall.envshake.ampl.
Yeaaaah im shootign ducks wiht the paino
Re: ID is not returning the actual char ID
#5  January 24, 2024, 08:25:46 pm
  • ******
    • Portugal
    • network.mugenguild.com/pots/
It's probably that Mugen does the localcoord conversion then rounds the result down because the amplitude must be an integer. So 56 becomes 55. Maybe you can use a var that's a float? Like frequency?

Edit: On second thought that will probably have the same issues since you still need to round the result yourself.
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.
Last Edit: January 24, 2024, 08:49:09 pm by PotS
Re: ID is not returning the actual char ID
#6  January 25, 2024, 12:12:52 am
  • avatar
  • ***
    • Portugal
I figured out the problem, it's a rounding error that happens on characters with big enough horizontal localcoord on MUGEN. It seems characters with horizontal localcoord of at least 720 from my experiments experience this issue when returning values from fall.envshake.ampl.

It's probably that Mugen does the localcoord conversion then rounds the result down because the amplitude must be an integer. So 56 becomes 55. Maybe you can use a var that's a float? Like frequency?

Edit: On second thought that will probably have the same issues since you still need to round the result yourself.

Actually, switching to envshake.freq did fix it, even without rounding, so thank you both ;D

It's weird, I ended up having to use ceil(GetHitVar(fall.envshake.freq)) anyway when checking it to prevent integer truncated errors, so its definitely returning a decimal, but using either floor or ceil on it gives the same value. And the localcoord is only at 400.

Re: ID is not returning the actual char ID
#7  January 25, 2024, 07:26:28 am
  • ****


I have the same problem on my characters

it only having problem when im using a localcrood = 720p character on a 1080p mugen
on 720p mugen it's ok

ID always return correct ID. but the fall.envshake.ampl will alter it.

I got a workaround in all my 720p characters to make this to work.
is when set the ID.  I use ID * 2

when read the ID from a fall.envshake.ampl.  i use fall.envshake.ampl /2
Re: ID is not returning the actual char ID
#8  January 25, 2024, 09:58:39 am
  • ******
    • Portugal
    • network.mugenguild.com/pots/
These workarounds may fail when the localcoord conversion is something that needs floor instead of ceil, or vice-versa.
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.
Re: ID is not returning the actual char ID
#9  January 25, 2024, 10:20:53 am
  • ****
These workarounds may fail when the localcoord conversion is something that needs floor instead of ceil, or vice-versa.

true. so far it worked.

in both 720p and 1080p