YesNoOk
avatar

I can't figure out how to fix this code in ikemen go (Read 116682 times)

Started by DeoBrand0, July 29, 2022, 08:41:24 am
Share this topic:
I can't figure out how to fix this code in ikemen go
#1  July 29, 2022, 08:41:24 am
  • avatar
    • USA
So I am trying to use the unlock parameter in the newest version of ikemen go and it works but only if I set it to unlock a character after beating arcade mode a certain amount of times.Whenever I try to set it to unlock a character after beating arcade mode with a certain character it gives me the same error.I am using this line in the select.def to try the unlock parameter

(baki, hidden=2, unlock=stats.modes ~= nil and stats.modes.arcade ~= nil and stats.modes.arcade.clearcount ~= nil and stats.modes.arcade.clearcount.luigi >= 1)

and then the same thing but on a different character with a different name after clearcount and it also only gives me the error if I try to give two different characters that line at a time.it gives me the error

(<string>:1: attempt to compare number with nil stack traceback:
         <string>:1: in function < < string>:0>
         external/script/main.lua:3347: in function 'f_unlock'
         external/script/main.lua:4045: in main chunk
         [G]: ?)

Can somebody help me figure this out
Last Edit: July 30, 2022, 12:49:17 pm by DeoBrand0
Re: I can't figure out how to fix this code in ikemen go
#2  July 30, 2022, 08:48:52 am
  • **
It's because the character(s) you're trying to call on does not exist in the clearcount matrix.
You've probably noticed but any character who clears 'arcade mode' automatically get's added to the clearcount matrix but those who haven't are not.
stats.modes.arcade.clearcount.luigi for e.g. will only work if luigi is already in the matrix else it won't.

To make your hidden characters work with character run unlocks, you'd have to manually edit the stats.json file and add in the KEY characters you want into the clearcount matrix

E.g, in the stats.json file

    "arcade": {
      "playtime": 17.36, 
      "clear": 8, 
      "clearcount": {
        "ken": 0,     
        "ryu": 0,
        "terry": 0,

      },

Since only Ken,Ryu,Terry are in the matrix, you will only be able to attach them to the clearcount line of code as you did with luigi. 

Hope this helps. 
I've no idea how to write lua scripts/codes so if someone actually knows how to code what you're trying to do in select.def without externally modifying the stats.json file, the that'd be awesome.
Re: I can't figure out how to fix this code in ikemen go
#3  July 30, 2022, 12:51:03 pm
  • avatar
    • USA
Yes thank you that worked