Lua Scripts for IA Scenes - TheLeonX/NSC-Toolbox GitHub Wiki
I added few Lua scripts to be able to use normally in free battle.
ccFreeBattleIa_RestoreFreeBattleCamera
- This Lua script restore camera functionality in free battle.
ccFreeBattleIa_AllDispOff
- This Lua script hide all characters on scene.
ccFreeBattleIa_AllDispOn
- This Lua script unhide all characters on scene.
ccFreeBattleIa_BackgroundDrawOff
- This Lua script hide stage on scene.
ccFreeBattleIa_BackgroundDrawOn
- This Lua script unhide stage on scene.
ccFreeBattleIa_HudOn
- This Lua script hide HUD on scene.
ccFreeBattleIa_HudOf
- This Lua script unhide HUD on scene.
How to call scripts in IA Scene.
I created functions inside of game scripts so you could call them, this is how they look like, pretty much simple.
function IA_FB_RestoreFreeBattleCamera( frame, timing )
if( frame == ccIa_transform30Fps( timing ) ) then
ccFreeBattleIa_RestoreFreeBattleCamera()
end
end
function IA_FB_AllCharactersDisplayOff( frame, timing )
if( frame == ccIa_transform30Fps( timing ) ) then
ccFreeBattleIa_AllDispOff()
end
end
function IA_FB_AllCharactersDisplayOn( frame, timing )
if( frame == ccIa_transform30Fps( timing ) ) then
ccFreeBattleIa_AllDispOn()
end
end
function IA_FB_BackgroundDrawOff( frame, timing )
if( frame == ccIa_transform30Fps( timing ) ) then
ccFreeBattleIa_BackgroundDrawOff()
end
end
function IA_FB_BackgroundDrawOn( frame, timing )
if( frame == ccIa_transform30Fps( timing ) ) then
ccFreeBattleIa_BackgroundDrawOn()
end
end
function IA_FB_HudOn( frame, timing )
if( frame == ccIa_transform30Fps( timing ) ) then
ccFreeBattleIa_HudOn()
end
end
function IA_FB_HudOff( frame, timing )
if( frame == ccIa_transform30Fps( timing ) ) then
ccFreeBattleIa_HudOff()
end
end
Inside of IA Scene scripts you must to call them like that
x------------------------------------------------------------------
-- \author L0407-KUBOTA
-- \date 2023/04/04 16:31:50
------------------------------------------------------------------
function IA_SceneMain() local frame = ccIa_GetFrameCount();
-- γ³γγ³γ
-- γ’γγ‘γΌγ·γ§γ³
IA_createAnimation(frame,0,0,"data/ia/na_0600/na_0600_020.xfbin","d09_4010");
-- γ€γγ³γ
IA_enableDrawStage( frame, 0 );
IA_setCaption( frame, 36, 94, "TheTale_BT_009990" );
IA_FB_RestoreFreeBattleCamera( frame, 0 );
IA_FB_AllCharactersDisplayOff( frame, 0 );
IA_FB_AllCharactersDisplayOn( frame, 0 );
IA_FB_BackgroundDrawOff( frame, 0 );
IA_FB_BackgroundDrawOn( frame, 0 );
IA_FB_HudOn( frame, 0 );
IA_FB_HudOff( frame, 0 );
end;
------------------------------------------------------------------
-- EOF
------------------------------------------------------------------
frame value is current frame of scene. You don't need to change it, but 0 is value when function must be played, change it on whatever you need.
[!NOTE] Note that,
IA_FB_RestoreFreeBattleCamera must be played on last frame, cuz it requires restore camera with delay, so game could finish IA scene before restoring camera for free battle, that's important!