So I tried creating my own simple dialogue system like the touhou games from 6-11.
As I put my variable 'g_obj_boss' for local format, as follows:
Stage part:
-At Plural Script 1, I set the boss variable to an object enemy boss.
when the boss health reaches to 0, the boss's position automatically sets to 0-0 coordinates as it proceeds to the next plural part (the Dialogue) where I created the variable boss as enemy.
-After the dialogue, the boss object's position automatically resets to 0-0 coordinates as it proceeds to the next plural part (the boss part). Still I'm running out of time before New Year...
Anyone can help explain this if you watch it and read it. Please Respond. ty.
===========================================================================================================================================
Edit: I assume why. As I misunderstood...
So I was creating a system for the dialogue event, and I might've ran into it so... here's what I did:
This is what the code for the stage looks like:
task TStage
{
wait(60);
StartScript(idScriptA);SetAreaCommonData("System", "BossInspiration", r[3]);
while(!IsCloseScript(idScriptA)) //Run plural-stg00e-mid.dnh - midboss event
{
yield;
}
StartScript(idScriptB);SetAreaCommonData("System", "BossInspiration", r[3]);
while(!IsCloseScript(idScriptB)) //Run plural-stg00e-talk.dnh - the dialogue event
{
yield;
}
wait(240);
CloseStgScene();
}
The idScriptA, which is the Midboss Event, as shown in the code above. I put the codes to initialize the boss to appear:
This is the variable for the boss object for format in (lib_variables_boss.dnh):
let g_obj_boss; //This is the variable to set to Enemy Boss in scripts.
@Initialize{
SetShotAutoDeleteClip(480,480,480,480);
g_obj_boss = ObjEnemy_Create(OBJ_ENEMY_BOSS); //The object as an Enemy Boss
ObjEnemy_Regist(g_obj_boss);
//Init_Boss_Aura(g_obj_boss,32,176,255,32,64,255,1);
Render_Boss_Anim(g_obj_boss,anim_HBKT);ObjEnemy_SetDamageRate(g_obj_boss, 0, 0);
ObjMove_SetDestAtFrame(g_obj_boss, trunc(GetCenterX()+rand(-96,96)), trunc((GetCenterY()/2)+rand(-16,16)), 30); //The coordinates of the Boss Object
StartSpell;
init_phase1;
TFinalize;
}
Then, the idScriptB, which is the Dialogue Event. I put the codes to initialize the boss to appear:
@Initialize{
g_obj_boss = ObjEnemy_Create(OBJ_ENEMY); //The object as an enemy during the dialogue. Still a boss.
ObjEnemy_Regist(g_obj_boss);
//Init_Boss_Aura(g_obj_boss,32,176,255,32,64,255,1);
ObjMove_SetDestAtFrame(g_obj_boss, trunc(GetCenterX()), trunc((GetCenterY()/2)+rand(-16,16)), 60); //The coordinates of the enemy object after the boss dies before the event dialogue.
Render_Boss_Anim(g_obj_boss,anim_Hika);ObjEnemy_SetDamageRate(g_obj_boss, 0, 0);
SetCommonData("event_dialogue",true);
SetShotAutoDeleteClip(480,480,480,480);
SetTalk;
CheckEventDia;
}
@MainLoop{
yield;
}
//Create Anything, heheh.
task SetTalk
{
wait(90);
DrawBorder;
SetText_Simple(chartype[1],charcolor_ubkt[0],charcolor_ubkt[1],charcolor_ubkt[2],"My...");
SetText_Simple(chartype[1],charcolor_ubkt[0],charcolor_ubkt[1],charcolor_ubkt[2],"I've been hardly noticed...");
SetText_Simple(chartype[0],charcolor_nemuno[0],charcolor_nemuno[1],charcolor_nemuno[2],"Well, not a bad problem.");
... ... ...
...
}
The Main Problem for the object as an enemy boss, which last time I rushed out to explain, is the Coordinates of the Enemy Boss object.
at idScriptA, the Coordinates for the boss at the start are (0,0) and the object will move to (GetCenterX(), ((GetCenterY()/2)+rand(-16,16)).
Then, as the boss dies (TFinalize), the idScriptA is closed and idScriptB is next (Dialogue). This time, the coordinates for the Enemy Object are automatically (0,0) and the object will move to (GetCenterX(), ((GetCenterY()/2)+rand(-16,16)).
Still... but why...?
And if I'm not mistaken... Here's the video based on the coordination problem:
https://www.youtube.com/watch?v=d9mNMiH1wx4Please respond immediately. ty. :X