General Useful Functions
Original guide by @z_u_ra on discord
This guide will go over stuff you need to know if you want to actually mod the game.This includes functions you can call to activate dialouge, give yokais, give items, and more.
Giving a Yo-kai
Function type: Reference function
Signature: AddPartyEx(paramID,unk,yokaiLevel,unk,unk,unk)
ParamIDs for YW1 ParamIDs for YW2 ParamIDs for YW3
Example:
// 0x79F3AA36 is Pandle, and it's given at Level 3.
$local1 = AddPartyEx(0x79F3AA36h,0,1,3,1,0);
Playing a Movie
Function type: Reference function
Signature: MovieRunEx2(moflexName,musicName,unk,unk,unk,unk,unk,unk,subtitleCfgBin)
Example:
//This plays ProjectNateOpening.moflex with the sound for ev50_2540 with no subtitles (NULL).
$local1 = MovieRunEx2("ProjectNateOpening", "ev50_2540", 15, 15, 0, 0, 0, -1, "NULL", 0);
Start Event
Function type : Reference function
Signature: RunEvent(eventID)
Example:
$local1 = RunEvent("ev01200");
Giving an Item
(contribution by @thewadi and Whisperito ) Function type: Reference function
Signature: AddItem(itemID,itemCount,isGivenExplicit,unk,unk,unk);
Example:
// 0x6B9A7A3D is the ItemID, and it gives the item corresponding to the ID once per call while showing the window
$local1 = AddItem(0x6B9A7A3Dh,1,1,1,1,0);
Getting the Player’s Gender
Function type: Engine function
Signature: get_player_type()
Example:
$local1 = get_player_type();
//local1 will be 2 if it's a girl, and another number if it's a boy.
//in YW2 and 1, being a girl means the player chose Katie. in YW3, it means the player is currently playing as Hailey.
Display Chapter Title
Function type: Engine function
Signature: display_chapter_title(unk,chapterNumber)
Example:
//will display the chapter title for chapter 2
$local1 = display_chapter_title(0,2);
Teleport to a Map
Function type: Engine function
Signature: reserve_jump_map(map id, x, z, y)
Example:
//will teleport the player to map t101i01 at pos 0,0,0
$local1 = display_chapter_title("t101i01",0,0,0);
Check Bitflag
Function type: Engine function Signature: get_global_bit_flag(flagID)
Example:
$local1 = get_global_bit_flag(0x23404481h);
Set Bitflag
Function type: Engine function Signature: set_global_bit_flag(flagID, value)
Value can be either 1 or 0. Example:
$local1 = set_global_bit_flag(0x23404481h, 1);