Oh! You edited the script when I wasn't looking. I didn't see the magic additions.
I might fix my version later today to add that. I know it's seeming rather frustrating that I keep thrusting code at you (your code works, after all. All I'm doing is changing the processes a bit. I'm not trying to show you up or anything, as it's still your script), but I like doing stuff like this and there are not that many opportunities to do so here.
If you get too annoyed with me, just tell me to shut up and leave it alone.
Item-3: Desctruction Machine
Started by
Nimono
, Feb 14 2007 04:57 PM
20 replies to this topic
#16
Posted 15 February 2007 - 12:17 PM
#17
Posted 15 February 2007 - 12:25 PM
Oh! You edited the script when I wasn't looking. I didn't see the magic additions.
I might fix my version later today to add that. I know it's seeming rather frustrating that I keep thrusting code at you (your code works, after all. All I'm doing is changing the processes a bit. I'm not trying to show you up or anything, as it's still your script), but I like doing stuff like this and there are not that many opportunities to do so here.
If you get too annoyed with me, just tell me to shut up and leave it alone.
Yeah. I told you I figured out my problem. All those "Quit()"s for each if/else statement didn't help. XD
No, it's okay! Shorter code is fine as long as it has the same end result as my code. But seriously, I don't get how a ZScript could (or should) make a quest's file size larger. ....You know, I think an external file for storing compiled ZScripts would make a quest's filesize smaller, BUT.... Would anyone REALLY want to send those files with their quests?
#18
Posted 15 February 2007 - 03:42 PM
THANK YOU!!!
If you can make guys in the editor. Holy Finger, you gave me an idea.
If you can make guys in the editor. Holy Finger, you gave me an idea.
#20
Posted 15 February 2007 - 07:22 PM
I'm pretty sure you don't need all of those if statements.
Also, I changed if(Link->MP == Magic) to if(Link->MP >= Magic), which makes more sense.
And no, I am not going to test this for you.
CODE
// Destruction Machine- This item randomly kills one enemy in the current room.
item script Killer
{
int RandNum = 0;
int RandNPC = 0;
int Magic = 192;
void run()
{
if (Link->MP >= Magic)
{
int ScrnNPC = Screen->NumNPCs();
if (ScrnNPC == 0)
{
Quit();
}
else if (ScrnNPC >= 1 && ScrnNPC <= 10)
{
RandNum = 1+ Rand(ScrnNPC);
npc RandNPC = Screen->LoadNPC (RandNum);
RandNPC->HP = 0;
}
Link->MP = Link->MP - Magic;
}
}
}
item script Killer
{
int RandNum = 0;
int RandNPC = 0;
int Magic = 192;
void run()
{
if (Link->MP >= Magic)
{
int ScrnNPC = Screen->NumNPCs();
if (ScrnNPC == 0)
{
Quit();
}
else if (ScrnNPC >= 1 && ScrnNPC <= 10)
{
RandNum = 1+ Rand(ScrnNPC);
npc RandNPC = Screen->LoadNPC (RandNum);
RandNPC->HP = 0;
}
Link->MP = Link->MP - Magic;
}
}
}
Also, I changed if(Link->MP == Magic) to if(Link->MP >= Magic), which makes more sense.
And no, I am not going to test this for you.
#21
Posted 15 February 2007 - 07:31 PM
I'm pretty sure you don't need all of those if statements.
CODE
// Destruction Machine- This item randomly kills one enemy in the current room.
item script Killer
{
int RandNum = 0;
int RandNPC = 0;
int Magic = 192;
void run()
{
if (Link->MP >= Magic)
{
int ScrnNPC = Screen->NumNPCs();
if (ScrnNPC == 0)
{
Quit();
}
else if (ScrnNPC >= 1 && ScrnNPC <= 10)
{
RandNum = 1+ Rand(ScrnNPC);
npc RandNPC = Screen->LoadNPC (RandNum);
RandNPC->HP = 0;
}
Link->MP = Link->MP - Magic;
}
}
}
item script Killer
{
int RandNum = 0;
int RandNPC = 0;
int Magic = 192;
void run()
{
if (Link->MP >= Magic)
{
int ScrnNPC = Screen->NumNPCs();
if (ScrnNPC == 0)
{
Quit();
}
else if (ScrnNPC >= 1 && ScrnNPC <= 10)
{
RandNum = 1+ Rand(ScrnNPC);
npc RandNPC = Screen->LoadNPC (RandNum);
RandNPC->HP = 0;
}
Link->MP = Link->MP - Magic;
}
}
}
Also, I changed if(Link->MP == Magic) to if(Link->MP >= Magic), which makes more sense.
And no, I am not going to test this for you.
Whoops, you're right. XD But, uh.... That looks similar to something I tested a while ago. Wanna know the result? IT DID NOTHING. Oh well. Can't hurt to try this, right? But seriously, all those "if-else" statements ARE needed until a way to make it work in less code is found.
Edit: :O It... It didn't work!
Edited by Matthew, 15 February 2007 - 07:33 PM.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users