YesNoOk
avatar

[Help] write LUA code to trigger (Read 1614 times)

Started by Ehnyd, February 20, 2024, 03:10:19 pm
Share this topic:
[Help] write LUA code to trigger
#1  February 20, 2024, 03:10:19 pm
  • *
  • Powered by VRG Productions
    • Chile
I recently started to convert part of the program's tag module to trigger, mainly because I want the characters' inputs/outputs to be somewhat more custom/animated by adding afterimages effects, sparks, or simulating teleports depending on the character.

With the exit animation it was no problem.

With the entry ones I'm a bit stuck, mainly because there is a LUA line that I don't know how to write down and that has me where I am.


Original Code
if time = 0 {
   if facing != playerId(getPlayerId(teamLeader)),facing {
      turn{}
   }



And how am I interpreting - probably wrong - the trigger.
trigger1 = Time = 0 && (facing != playerId(getPlayerId(teamLeader)),facing = (Turn=1))

Any idea what I did wrong? Any help is appreciated.
Re: [Help] write LUA code to trigger
#2  February 22, 2024, 02:48:07 pm
  • ******
    • Portugal
    • network.mugenguild.com/pots/
That looks like ZSS rather than Lua. It'd look like this in CNS:

Code:
[State Turn]
type = turn
trigger1 = time = 0
trigger1 = facing != playerId(getPlayerId(teamLeader)), facing


Since GetPlayerID is obsolete, you could also write it like this:

Code:
[State Turn]
type = turn
trigger1 = time = 0
trigger1 = facing != player(teamLeader), facing
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: [Help] write LUA code to trigger
#3  February 22, 2024, 08:16:46 pm
  • *
  • Powered by VRG Productions
    • Chile
I know. The truth is, I don't know what the original programmers of said module were thinking, not to mention that this section was like this in the original Ikemen module.

Either way. It's time to check how the code would look with this and I'll tell you how it went.

Thanks.
Re: [Help] write LUA code to trigger
#4  February 22, 2024, 09:21:35 pm
  • *
  • Powered by VRG Productions
    • Chile
I just did a couple of tests, and after causing an error and closing the program, it now fails successfully in game (the code was only implemented in Akuma).


I better leave the complete code as it is.

Spoiler, click to toggle visibilty


Spoiler, click to toggle visibilty