YesNoOk
avatar

Lua modules for Ikemen GO 0.98.2 - By Wreq! (Read 16091 times)

Started by Wreq!, March 07, 2022, 08:00:42 AM
Share this topic:
Lua modules for Ikemen GO 0.98.2 - By Wreq!
#1  March 07, 2022, 08:00:42 AM
    • Argentina
So, I developed some lua modules for Ikemen GO and decided to release them for general use. Feel free to use them in your projects (with or without giving credits), modify them, or re-use code, it's fine. These modules are meant to be used with 0.98.2, I can't assure these mods will work with previous versions of the engine, though I'll try to update them for future versions.

I must clarify not 100% of the code is mine, some if has been taken and modified from default scripts, and that code belongs to Ikemen GO devs, of course.

How to install

To install these modules, you have to place them inside the folder external/mods in your Ikemen GO installation.

Alternatively, if you want to distribute these with a motif (screenpack), you can download an additional module from the downloads folder called modloader.lua. Just place that mod in the root of your screenpack folder and, after that, add the next line in system.def, inside [Files]:

Code:
[Files]
module = data/<yourscreenpackfolder>/modloader.lua

Finally, create a new folder inside your screenpack folder called "modules", and place all the modules you want to use there. Take in account you can only declare one module in your system.def file, so this lua code tries to make up for it by loading all modules from said folder.

For more information about this (and other ways to install external modules), check out this article at Ikemen GO wiki:
https://github.com/ikemen-engine/Ikemen-GO/wiki/Miscellaneous-info#external-modules


FADEDELAY
Version: 1.0
Compatible with: 0.98.2

This module modifies the function main.f_fadeAnim to allow simple fade delaying in all menu sections.

New system.def parameters:
  • fadein.delay: sets amount of time to delay fadein. Takes effect after fadein.anim animation.
  • fadeout.delay: sets amount of time to delay fadeout. Takes effect after fadeout.anim animation.
  • fadeout.exit.delay: sets amount of time to delay exit (esc) fadeout. Takes effect after fadeout.anim animation.

Example:
In system.def:
Code:
[Select Info]
fadeout.time = 5
fadeout.delay = 80

Results
(Comparison without fadeout delay)


QUICKCONNECT
Version: 1.0
Compatible with: 0.98.2

Adds a new menu item (assignable via system.def) that lets the user directly insert an IP and connect to a host. An alternative to default serverconnect.

For more info about menu items and submenus in Ikemen GO: https://github.com/ikemen-engine/Ikemen-GO/wiki/Screenpack-features#grouping-elements-submenus


New system.def parameters:
At [Title Info]:
  • menu.itemname.quickconnect = "name": creates a new menu/submenu item with a custom name.

Example:
Code:
[Title Info]
menu.itemname.menunetwork.quickconnect = "Join Game"

Results


MAPOPTIONS
Version: 1.0
Compatible with: 0.98.2

This mod lets you create options menu items that set up maps to all players when starting a new match (according to their values). These maps are named based on the item names, and you can use them to modify in-game behavior (via CNS/ZSS). For more info about maps: Map, Map (trigger), MapSet (SCTRL), MapAdd (SCTRL)

To use this mod, you have to declare some items inside [Option Info] using "menu.itemname.<optionName>" parameter. After that, you can modify them using the new parameters this mod offers. For more info about this: https://github.com/ikemen-engine/Ikemen-GO/wiki/Screenpack-features#grouping-elements-submenu

To make the save feature work, you have to modify options.lua in external/script. Just remove "local" from "local modified = false" and "local needReload = false", then save the file. This is only necessary for 0.98.2


New system.def parameters:
At [Option Info]:
  • mapoptions.save.filename = "filename.json": sets custom savefile for options created with mapoptions. If declared, all mapoptions' values will be saved here.
  • mapoptions.item.<optionName>.type: sets option type. Acceptable values: "bool" (yes/no) or "number". Must be a string.
  • mapoptions.item.<optionName>.default: sets option default value (1 or 0 for bool, any integer for "number").
  • mapoptions.item.<optionName>.rangestart: sets option range start (if option is number-type).
  • mapoptions.item.<optionName>.rangeend: sets option range end (if option is number-type).
  • mapoptions.item.<optionName>.save: sets if the option must load the value from custom savefile at game's start (1 or 0).
  • mapoptions.item.<optionName> = type, default, rangeStart (optional), rangeEnd (optional), save: alternative way to set option functionality (inline).

Example:
In system.def:
Code:
[Option Info]
mapoptions.save.filename = "custom.json" ; This is optional, of course :>

menu.itemname.menusecrets.disablejump = "Disable Jump"
mapoptions.item.disablejump.type = "bool"
mapoptions.item.disablejump.default = 0
mapoptions.item.disablejump.save = 1
;Alternative: mapoptions.item.disablejump = "bool", 0, 1

In CNS/ZSS (in this case, I'm using ZSS):
Code:
if map(disablejump) {
   if stateno = 40 {
      selfState{value: prevstateno}
   }
}

Results


MULTIPLEFACE2
Version: 1.01
Compatible with: 0.98.2

Renders background portraits (face2) for all members in a team, instead of only one like vanilla Ikemen GO does. Works with select screen and versus screen.
This module overrides the function start.f_drawPortraits.


New system.def parameters:
At [Select Info] or [VS Screen]:
  • p<pn>.face2.num: sets how many portraits can be rendered. If omitted or set to 1, later background portraits will override the previous ones when selecting characters in select screen (just like vanilla Ikemen GO behavior).
  • p<pn>.member<num>.face2.offset = x, y: sets horizontal and vertical offset values for background portrait position of a given team member.
  • p<pn>.member<num>.face2.window = posX, posY, width, height: sets background portrait window frame position and dimensions.

Example:
In system.def:
Code:
[Select Info]
p1.face2.num = 2
p1.face2.spr = 9000,1
p1.face2.scale = 0.5, 0.5
p1.face2.offset = 0, 19

p1.member1.face2.offset = 0, 0 ; Not necessary to do this, it is just to illustrate
p1.member2.face2.offset = 78, 0

Results


STAGETEXT
Version: 1.1
Compatible with: 0.98.2

Adds new parameters in system.def that allow rendering various stage info in select and versus screens.

New system.def parameters:
At [VS Screen]:
  • stage.text: "Stage %s": sets stage text. %s renders stage name. %i can additionally render stageNo.
  • stage.font: sets stage text font.
  • stage.pos: sets stage text position.
  • stage.scale: sets stage text scale.
At [Select Info] or [VS Screen]:
  • stage.author.text: "Author %s": sets stage author text. %s renders stage author. %i can additionally render stageNo.
  • stage.author.font: sets stage author text font.
  • stage.author.pos: sets stage author text position.
  • stage.author.scale: sets stage author text scale.
  • stage.description.text: "%s": sets stage description text. %s renders stage description (from stage .def file, inside [Info]). %i can additionally render stageNo.
  • stage.description.font: sets stage description text font.
  • stage.description.pos: sets stage description text position.
  • stage.description.scale: sets stage description text scale.

Example:
In system.def:
Code:
[Select Info]
stage.author.text = "Author: %s"
stage.author.font = 3,0,0
stage.author.pos = 160, 229

[VS Screen]
stage.text = "Next stage: %s"
stage.font = 3,5,0
stage.pos = 160, 210

stage.description.text = "%s"
stage.description.font = 3,0,0
stage.description.pos = 160, 220

In stage .def file:
Code:
[Info]
name = "Training Stage"
displayName = "Training Stage"
author = "Gacel"
description = "Great stage, play it...\nWhile you can!" ;New parameter to display with stage.description.text

Results


DOWNLOAD

Glue that faded photo on a worn-out journal page, it reads: "September come, please take this heart away."
Last Edit: April 07, 2022, 11:15:59 PM by Wreq!
Re: Lua modules for Ikemen GO 0.98.2 - By Laziness
#2  March 07, 2022, 01:13:52 PM
  • ****
  • WIP: Tons and tons of IKEMEN stages
Amazing! This is the sort of stuff we need. Mapoptions can be used for some really wicked ideas!

From the top of my head, real Kombat Kodes. :)
Current release: SF vs MK, fully interactive
https://www.youtube.com/watch?v=7bM9DpmVXOA
Re: Lua modules for Ikemen GO 0.98.2 - By Laziness
#3  March 07, 2022, 03:24:06 PM
  • ***
  • Verdant Accents
  • The Vincent from Romania
    • Romania
    • wf4123.neocities.org
This is epic.
Re: Lua modules for Ikemen GO 0.98.2 - By Laziness
#4  March 09, 2022, 02:47:16 AM
    • Argentina
  • Updated multipleface2 to version 1.01. Now there are two new parameters available: p<pn>.face2.num and p<pn>.member<num>.face2.window
  • Added new module: stagetext.

Amazing! This is the sort of stuff we need. Mapoptions can be used for some really wicked ideas!

From the top of my head, real Kombat Kodes. :)

Thanks for the words (and WF4123 too). Well. I don't think mapoptions can be used for Kombat Kodes per se (since it only works in Options menu, for now), but its functionality/logic could be adapted to another mod (or expanded in the same mod) to allow something like that in versus screen.
Glue that faded photo on a worn-out journal page, it reads: "September come, please take this heart away."
Re: Lua modules for Ikemen GO 0.98.2 - By Laziness
#5  March 09, 2022, 03:16:42 AM
  • **
  • Hi my name is Dave, i am a SFZ3 addicted
    • Brazil
amazing job, thank you for this.
any plans to add something like px.face2.done.spr/anim and px.memberx.face2.layerno to the multipleface2 module?
Re: Lua modules for Ikemen GO 0.98.2 - By Laziness
#6  March 09, 2022, 10:43:50 AM
    • Argentina
  • Updated stagetext to version 1.01. There are new parameters to display stage author in select screen and versus screen.

amazing job, thank you for this.
any plans to add something like px.face2.done.spr/anim and px.memberx.face2.layerno to the multipleface2 module?

Yes, I may add those. I'm also interested in expanding foreground portraits (face) functionality.

Glue that faded photo on a worn-out journal page, it reads: "September come, please take this heart away."
Re: Lua modules for Ikemen GO 0.98.2 - By Laziness
#7  March 10, 2022, 12:50:54 AM
  • ****
  • Retired
    • New Zealand
    • network.mugenguild.com/devon/
Thank you for fadedelay and stagetext, I'm gonna use the author field to add time, place and music info to my stages. Will \n in the author field work? lol
Re: Lua modules for Ikemen GO 0.98.2 - By Laziness
#8  March 10, 2022, 06:05:58 AM
    • Argentina
  • Updated stagetext to 1.1. Rewrote most of the code to optimize it and to allow easier updating in the future, fixing various bugs in the process (including one that messed up author text display order in select screen when leaving a match using the "Exit" option). I took advantage of this code update to add support for "\n" (line feed), stage number display in all strings (using %i), and a new "description" parameter for stage defs that should go inside [Info] and can be displayed on Select or VS Screen using stage.description.text.

Thank you for fadedelay and stagetext, I'm gonna use the author field to add time, place and music info to my stages. Will \n in the author field work? lol

With the new version I uploaded, it should work. Also, you might want to check that "description" text thing I added.
Glue that faded photo on a worn-out journal page, it reads: "September come, please take this heart away."
Re: Lua modules for Ikemen GO 0.98.2 - By Laziness
#9  March 10, 2022, 10:16:12 AM
  • ****
  • Retired
    • New Zealand
    • network.mugenguild.com/devon/
Absolutely awesome update, thanks!
Re: Lua modules for Ikemen GO 0.98.2 - By Laziness
#10  March 10, 2022, 07:13:26 PM
  • *****
  • I must continue my training...
This is revolutionary bro. You'll see the fruits of your labor from me soon enough...

Do your best to become stronger. Become stronger, so you can do your best.

Mugen is a way for me to remain nostalgic with all of the dream matches I cooked up as a kid. It's also what I call a "Digital Action Figure Collection."
MaxBeta link=topic=155656.msg1876950#msg1876950 date=13867
Vegaz_Parrelli...also known as The Lord of the Rings.
[/quote said:
Re: Lua modules for Ikemen GO 0.98.2 - By Laziness
#11  March 10, 2022, 08:35:22 PM
  • ***
    • www.mediafire.com/folder/bn6ymdvllj9lf/Mugen_Stages
Really thanks. Does anyone know if it have any chances to be incorporated in the main build in the future ?
Re: Lua modules for Ikemen GO 0.98.2 - By Laziness
#12  March 11, 2022, 03:20:19 AM
  • ****
  • WIP: Tons and tons of IKEMEN stages
Really thanks. Does anyone know if it have any chances to be incorporated in the main build in the future ?
They are really really easy to install, fortunately. You can make stuff and distribute these with any other files.
Current release: SF vs MK, fully interactive
https://www.youtube.com/watch?v=7bM9DpmVXOA
Re: Lua modules for Ikemen GO 0.98.2 - By Laziness
#13  March 11, 2022, 07:21:28 AM
    • Argentina
This is revolutionary bro. You'll see the fruits of your labor from me soon enough...

I hope so!

Really thanks. Does anyone know if it have any chances to be incorporated in the main build in the future ?

I guess that depends on the engine devs :T, if they want to use code or ideas from these mods, it's fine by me, though they would need to be cleaned up in that case, since my coding abilities suck.

Really thanks. Does anyone know if it have any chances to be incorporated in the main build in the future ?
They are really really easy to install, fortunately. You can make stuff and distribute these with any other files.

I also added a new alternative to load modules that's friendly with screenpack distribution (since most of these mods are screenpack-oriented), that should be helpful.
Glue that faded photo on a worn-out journal page, it reads: "September come, please take this heart away."
Re: Lua modules for Ikemen GO 0.98.2 - By Wreq!
#14  June 10, 2022, 03:29:49 PM
  • ***
    • Spain
    • oscarstg1@gmail.com
could you upload a screempack with all this already inserted?
Re: Lua modules for Ikemen GO 0.98.2 - By Wreq!
#15  June 11, 2022, 05:13:23 AM
    • Argentina
I'll consider it for next Ikemen GO version.
Glue that faded photo on a worn-out journal page, it reads: "September come, please take this heart away."
Re: Lua modules for Ikemen GO 0.98.2 - By Wreq!
#16  June 11, 2022, 12:13:06 PM
  • avatar
  • ***
  • ? Who?
ooh ... thanjks !!
Look?