Binx
04-30-2013, 05:20 AM
Ok, I already asked about this in a help thread, but for the sake of clarity, I was looking for a Ganon-like enemy script that would behave exactly like Ganon, but *not* be attached to a specific room type. and Zim was kind enough to give me this script:
import std.zh;
int HS;//Has Spawned.
void ES(int a, int b, int c,int d,int e,int f, int g) //ES stands for Enemy Spawn
{
if(Game->GetCurScreen()==d&&Game->GetCurDMap==e&&HS==f)
{npc En=Screen->CreateNPC(a);En->X=b;En->Y=c;}
if(Screen->NumNPCs>0)
{HS=g;
if(Link->HP==0){HS=f;}//This line is so that if Link dies on the screen HS returns to it's previous state so
//Ganon will spawn again if Link fails to defeat him.
}//resets HS to g, so that 1)Ganon won't spawn twice,
//2)so that HS can be reused on a different screen AFTER this num is changed.
//this function places NPC #A at coordinates (b,c) on Screen d of DMap e if HS is equal to f.
}
global script GANON
void run()
{
while(true)
{
ES(78,64,64,1,2,0,1);//Ganon's Enemy # is 78,
//so this script would Spawn Ganon at (64,64) x,y, on Screen 1, Dmap 2, while HS==F, resets HS to numeral g, and back to f if Link fails.
Waitframe(); //Waitframe is a must usually, or the game will freeze.
}
//the void ES itself could also fit into this space instead of out of the global script, making it exclusive to the global, which is not optimum
//if the scripter likes to use voids inside of other voids that aren't in the global itself.
}
Now, I haven't implemented it yet, for two reasons: A) I'm not that far into the quest, yet and B) I'm a little confused on how it works... Would this enemy be editable in the ordinary sense? Like could I alter its weaknesses, graphics or csets? or would it just give me the ability to use the "Ganon" enemy already present without a "Ganon" room? Ideally, I'd like to have 4 different final boss enemies, each with a weakness to a different type of weapon, rather than the silver arrow for all of them. I also plan to use Ganon himself, as an ultimate boss, but I wanted to upgrde his weakness to the golden arrow, since by that point in the game, the silver arrow would be almost weak.
Which brings me to the major point of this whole thread, and the reason I need all those questions answered: Assuming I CAN make an "Ultimate Ganon" with crazy hp and power, and different weaknesses, would it be possible to make a script that will connect THAT enemy with the "Ganon" room type?
EDIT: The demo is currently here:
http://armageddongames.net/showthread.php?95609-The-Legend-of-Zelda-Trials-of-the-Gods
if my rambling is unclear.
import std.zh;
int HS;//Has Spawned.
void ES(int a, int b, int c,int d,int e,int f, int g) //ES stands for Enemy Spawn
{
if(Game->GetCurScreen()==d&&Game->GetCurDMap==e&&HS==f)
{npc En=Screen->CreateNPC(a);En->X=b;En->Y=c;}
if(Screen->NumNPCs>0)
{HS=g;
if(Link->HP==0){HS=f;}//This line is so that if Link dies on the screen HS returns to it's previous state so
//Ganon will spawn again if Link fails to defeat him.
}//resets HS to g, so that 1)Ganon won't spawn twice,
//2)so that HS can be reused on a different screen AFTER this num is changed.
//this function places NPC #A at coordinates (b,c) on Screen d of DMap e if HS is equal to f.
}
global script GANON
void run()
{
while(true)
{
ES(78,64,64,1,2,0,1);//Ganon's Enemy # is 78,
//so this script would Spawn Ganon at (64,64) x,y, on Screen 1, Dmap 2, while HS==F, resets HS to numeral g, and back to f if Link fails.
Waitframe(); //Waitframe is a must usually, or the game will freeze.
}
//the void ES itself could also fit into this space instead of out of the global script, making it exclusive to the global, which is not optimum
//if the scripter likes to use voids inside of other voids that aren't in the global itself.
}
Now, I haven't implemented it yet, for two reasons: A) I'm not that far into the quest, yet and B) I'm a little confused on how it works... Would this enemy be editable in the ordinary sense? Like could I alter its weaknesses, graphics or csets? or would it just give me the ability to use the "Ganon" enemy already present without a "Ganon" room? Ideally, I'd like to have 4 different final boss enemies, each with a weakness to a different type of weapon, rather than the silver arrow for all of them. I also plan to use Ganon himself, as an ultimate boss, but I wanted to upgrde his weakness to the golden arrow, since by that point in the game, the silver arrow would be almost weak.
Which brings me to the major point of this whole thread, and the reason I need all those questions answered: Assuming I CAN make an "Ultimate Ganon" with crazy hp and power, and different weaknesses, would it be possible to make a script that will connect THAT enemy with the "Ganon" room type?
EDIT: The demo is currently here:
http://armageddongames.net/showthread.php?95609-The-Legend-of-Zelda-Trials-of-the-Gods
if my rambling is unclear.