PDA

View Full Version : Item-4: Warp Machine



Nimono
03-04-2007, 10:49 AM
This is the REAL Item-4, but only Version 0.5 of it. ;) Copied-and-pasted from PureZC:

Well, this is my "secret script". Yes... Warp randomly across the screen now! Problems? It generally places you around the middle of the screen on the first few uses, but after that, it works PERFECTLY. Ignore the combo stuff for now- I haven't made code for them yet. But I have plans for them.... ;) Because I don't want to reveal their usage yet, I shall erase any mention of what they do so you can't expect them. :mischief: And now, the script. So far, only variable you should change is Magic, which, as you should know, is what holds the value for the amount of Magic the script should take away. DO THIS IN FULL CONTAINERS, AS THERE IS A BUG IN ALL BUILDS SO FAR THAT MAKES YOUR MAGIC METER ENDLESSLY LOOP IF YOU TRY TO USE ANYTHING LESS THAN A VALUE OF 32. :(

// Warp Machine- When used, this Item will warp Link to a random location on the current screen. If used on certain combos, however, this
// item will warp you to a specific location on the current screen, or to a new screen altogether, depending on the combo you're on.
// Variables:
// Magic- Magic required to use, in 32nds of a Container.

// LinkXOld- Link's X-coordinate before warping. Leave this alone.
// LinkYOld- Link's Y-coordinate before warping. Leave this alone, too.
// LinkXY- Self explanatory.
// RandomX- Randomized X-position. Changing this has no effect on anything. :P
// RandomY- Randomized Y-position. Leave this alone.
// RandomXY- Stay away from this.

import "std.zh"
item script Warper
{
int Magic = 128;
int ComboO1 = 0;
int ComboO2 = 0;
int ComboO3 = 0;
int ComboOE = 0;
int ComboOT1 = 0;
int ComboOT2 = 0;
int ComboOT3 = 0;
int ComboONS1 = 0;
int ComboONS2 = 0;
int ComboONS3 = 0;
int ComboD1 = 0;
int ComboD2 = 0;
int ComboD3 = 0;
int ComboDE = 0;
int ComboDT1 = 0;
int ComboDT2 = 0;
int ComboDT3 = 0;
int ComboDNS1 = 0;
int ComboDNS2 = 0;
int ComboDNS3 = 0;
int LinkXOld = 0;
int LinkYOld = 0;
int LinkXY = 0;
int RandomX = 0;
int RandomY = 0;
int RandomXY = 0;

void run()
{
if (Link->MP >= Magic)
{
LinkXOld = Link->X;
LinkYOld = Link->Y;
RandomX = Floor(Rand(1) * 241);
RandomY = Floor(Rand(1) * 161);
float remainder = RandomX % 16;
if (remainder <= 8)
{
RandomX = RandomX - remainder;
}
else
{
RandomX = RandomX + 16 - remainder;
}
float remainderY = RandomY % 16;
if (remainderY <= 8)
{
RandomY = RandomY - remainderY;
}
else
{
RandomY = RandomY + 16 - remainderY;
}
RandomXY = (RandomY & 240)+(RandomX>>4);
LinkXY = (LinkYOld)+(LinkXOld);
if (Screen->ComboD [LinkXY] != ComboO1 || Screen->ComboD [LinkXY] != ComboO2 || Screen->ComboD [LinkXY] != ComboO3 || Screen->ComboD [LinkXY] != ComboOE || Screen->ComboD [LinkXY] != ComboOT1 || Screen->ComboD [LinkXY] != ComboOT2 || Screen->ComboD [LinkXY] != ComboOT3 || Screen->ComboD [LinkXY] != ComboD1 || Screen->ComboD [LinkXY] != ComboD2 || Screen->ComboD [LinkXY] != ComboD3 || Screen->ComboD [LinkXY] != ComboDE || Screen->ComboD [LinkXY] != ComboDT1 || Screen->ComboD [LinkXY] != ComboDT2 || Screen->ComboD [LinkXY] != ComboDT3 || Screen->ComboD [LinkXY] != ComboONS1 || Screen->ComboD [LinkXY] != ComboONS2 || Screen->ComboD [LinkXY] != ComboONS3 || Screen->ComboD [LinkXY] != ComboDNS1 || Screen->ComboD [LinkXY] != ComboDNS2 || Screen->ComboD [LinkXY] != ComboDNS3)
{
if (Screen->ComboS [RandomXY] != 0)
{
Link->X = LinkXOld;
Link->Y = LinkYOld;
}
else if (Screen->ComboS [RandomXY] == 0)
{
Link->X = RandomX;
Link->Y = RandomY;
Link->MP -= Magic;
Quit();
}
}
}
}
}
If you feel taunted by the fact that I left the varaibles themselves in, then good. Let's see you ponder about what my plan could be for them.... :mischief:

And remember.....

IT'S A SECRET TO EVERYBODY.

The_Amaster
03-04-2007, 11:06 AM
Ummm...I'm still not sure what it does. Does it place you randomly somewhere on your current screen?

Nimono
03-04-2007, 11:12 AM
Ummm...I'm still not sure what it does. Does it place you randomly somewhere on your current screen?

Yep. How much more obvious could it get than that? :p After all.... IT SAYS THAT RIGHT ON THE VERY FIRST LINE OF THE SCRIPT! XD

_L_
03-04-2007, 11:20 AM
Thanks, Dr. Light! This reminds me of the teleportation move in that old "Daleks" computer game.

Nimono
03-04-2007, 11:25 AM
Thanks, Dr. Light! This reminds me of the teleportation move in that old "Daleks" computer game.

....My word. Why did you call me "Dr. Light"?

The_Amaster
03-04-2007, 12:11 PM
Mega Man referance?

And sorry, I didn't read the script, just your desc. in the post.

CastChaos
03-05-2007, 05:18 AM
I think I know what it will be, but if I'm right then you need to make a replica of a certain already existing item and attach this script to it. I I'm right this script will be even greater than the Cane of Somaria (a must have item for Misery Mire). However, this script looks very good even in this form.

I think I PM you on PureZC with my guess.

Thanks, S... Okay, I don't want to spoil my guess. ;)

Nimono
03-05-2007, 11:45 AM
I think I know what it will be, but if I'm right then you need to make a replica of a certain already existing item and attach this script to it. I I'm right this script will be even greater than the Cane of Somaria (a must have item for Misery Mire). However, this script looks very good even in this form.

I think I PM you on PureZC with my guess.

Thanks, S... Okay, I don't want to spoil my guess. ;)

And you were wrong. So there. :p

Keep guessing, guys- Even if you get it right, I won't tell. :mischief:

Nimono
03-06-2007, 03:45 PM
Copied-and-pasted from my post at PureZC, with some minor changes:



Olay, Update! Guess what? You get to find out what most of the variables do now!! Yay!!! But the rest will remain a secret until they're done. ;) And again, I'm erasing what those variables do, but not the variables themselves. OH, HOW FUN IT IS TAUNTING YOU GUYS WITH THIS SCRIPT! XD

// Warp Machine- When used, this Item will warp Link to a random location on the current screen. If used on certain combos, however, this
// item will warp you to a specific location on the current screen, or to a new screen altogether, depending on the combo you're on.
// Variables:
// Magic- Magic required to use, in 32nds of a Container.
// ComboO1- Special Warp Combo 1- Overworld Use. Warps to another combo on same screen.
// ComboO2- Special Warp Combo 2- Overworld Use. See above.
// ComboO3- Special Warp Combo 3- Overworld Use. Again, see above.
// ComboO4- Special Warp Combo 4- Overworld Use.
// ComboO5- Special Warp Combo 5- Overworld Use.
// ComboO6- Special Warp Combo 6- Overworld Use.
// ComboD1- Special Warp Combo 1- Dungeon Use. Same as Overworld Use.
// ComboD2- Special Warp Combo 2- Dungeon Use. See above.
// ComboD3- Special Warp Combo 3- Dungeon Use. Again, see above.
// ComboD4- Special Warp Combo 4- Dungeon Use.
// ComboD5- Special Warp Combo 5- Dungeon Use.
// ComboD6- Special Warp Combo 6- Dungeon Use.
// LinkXOld- Link's X-coordinate before warping. Leave this alone.
// LinkYOld- Link's Y-coordinate before warping. Leave this alone, too.
// LinkXY- Self explanatory.
// RandomX- Randomized X-position. Changing this has no effect on anything. :P
// RandomY- Randomized Y-position. Leave this alone.
// RandomXY- Stay away from this.

import "std.zh"
item script Warper
{
int Magic = 128;
int ComboO1 = 0;
int ComboO2 = 0;
int ComboO3 = 0;
int ComboO4 = 0;
int ComboO5 = 0;
int ComboO6 = 0;
int ComboONS1 = 0;
int ComboONS2 = 0;
int ComboONS3 = 0;
int ComboD1 = 0;
int ComboD2 = 0;
int ComboD3 = 0;
int ComboD4 = 0;
int ComboD5 = 0;
int ComboD6 = 0;
int ComboDNS1 = 0;
int ComboDNS2 = 0;
int ComboDNS3 = 0;
int LinkXOld = 0;
int LinkYOld = 0;
int LinkXY = 0;
int RandomX = 0;
int RandomY = 0;
int RandomXY = 0;

void run()
{

ffc FFC1 = Screen->LoadFFC(32);
ffc FFC2 = Screen->LoadFFC(31);
ffc FFC3 = Screen->LoadFFC(30);
ffc FFC4 = Screen->LoadFFC(29);
ffc FFC5 = Screen->LoadFFC(28);
ffc FFC6 = Screen->LoadFFC(27);
if (Screen->ComboD [LinkXY] != ComboO1 || Screen->ComboD [LinkXY] != ComboO2 || Screen->ComboD [LinkXY] != ComboO3 || Screen->ComboD [LinkXY] != ComboO4 || Screen->ComboD [LinkXY] != ComboO5 || Screen->ComboD [LinkXY] != ComboO6 || Screen->ComboD [LinkXY] != ComboD1 || Screen->ComboD [LinkXY] != ComboD2 || Screen->ComboD [LinkXY] != ComboD3 || Screen->ComboD [LinkXY] != ComboD4 || Screen->ComboD [LinkXY] != ComboD5 || Screen->ComboD [LinkXY] != ComboD6 || Screen->ComboD [LinkXY] != ComboONS1 || Screen->ComboD [LinkXY] != ComboONS2 || Screen->ComboD [LinkXY] != ComboONS3 || Screen->ComboD [LinkXY] != ComboDNS1 || Screen->ComboD [LinkXY] != ComboDNS2 || Screen->ComboD [LinkXY] != ComboDNS3)
{
if (Link->MP >= Magic)
{
LinkXOld = Link->X;
LinkYOld = Link->Y;
RandomX = Floor(Rand(1) * 241);
RandomY = Floor(Rand(1) * 161);
float remainder = RandomX % 16;
if (remainder <= 8)
{
RandomX = RandomX - remainder;
}
else
{
RandomX = RandomX + 16 - remainder;
}
float remainderY = RandomY % 16;
if (remainderY <= 8)
{
RandomY = RandomY - remainderY;
}
else
{
RandomY = RandomY + 16 - remainderY;
}
RandomXY = (RandomY & 240)+(RandomX>>4);
LinkXY = (LinkYOld & 240)+(LinkXOld>>4);
if (Screen->ComboD [LinkXY] != ComboO1 || Screen->ComboD [LinkXY] != ComboO2 || Screen->ComboD [LinkXY] != ComboO3 || Screen->ComboD [LinkXY] != ComboO4 || Screen->ComboD [LinkXY] != ComboO5 || Screen->ComboD [LinkXY] != ComboO6 || Screen->ComboD [LinkXY] != ComboD1 || Screen->ComboD [LinkXY] != ComboD2 || Screen->ComboD [LinkXY] != ComboD3 || Screen->ComboD [LinkXY] != ComboD4 || Screen->ComboD [LinkXY] != ComboD5 || Screen->ComboD [LinkXY] != ComboD6 || Screen->ComboD [LinkXY] != ComboONS1 || Screen->ComboD [LinkXY] != ComboONS2 || Screen->ComboD [LinkXY] != ComboONS3 || Screen->ComboD [LinkXY] != ComboDNS1 || Screen->ComboD [LinkXY] != ComboDNS2 || Screen->ComboD [LinkXY] != ComboDNS3)
{
if (Screen->ComboS [RandomXY] != 0)
{
Link->X = LinkXOld;
Link->Y = LinkYOld;
}
else if (Screen->ComboS [RandomXY] == 0)
{
Link->X = RandomX;
Link->Y = RandomY;
Link->MP -= Magic;
Quit();
}
}
}
}
if (Screen->ComboD [LinkXY] == ComboO1 || Screen->ComboD [LinkXY] == ComboD1)
{
Link->X = FFC1->X;
Link->Y = FFC1->Y;
}
else if (Screen->ComboD [LinkXY] == ComboO2 || Screen->ComboD [LinkXY] == ComboD2)
{
Link->X = FFC2->X;
Link->Y = FFC2->Y;
}
else if (Screen->ComboD [LinkXY] == ComboO3 || Screen->ComboD [LinkXY] == ComboD3)
{
Link->X = FFC3->X;
Link->Y = FFC3->Y;
}
else if (Screen->ComboD [LinkXY] == ComboO4 || Screen->ComboD [LinkXY] == ComboD4)
{
Link->X = FFC4->X;
Link->Y = FFC4->Y;
}
else if (Screen->ComboD [LinkXY] == ComboO5 || Screen->ComboD [LinkXY] == ComboD5)
{
Link->X = FFC5->X;
Link->Y = FFC5->Y;
}
else if (Screen->ComboD [LinkXY] == ComboO6 || Screen->ComboD [LinkXY] == ComboD6)
{
Link->X = FFC6->X;
Link->Y = FFC6->Y;
}
}
}

Okay, the ComboO(x) variables are overworld combos for warping to select locations. Take note that ComboOE, ComboDE, ComboOT1-T3, and ComboDT1-T3 are all missing. They have been replaced with ComboO4-6 and ComboD4-6. Yes, I know there would be seven of those combos of each type if I replaced them ALL. I simply dropped the "E" variables because they wouldn't really have an impact on anything. They were supposed to be Exit combos, but... Well, how would I be able to tell where they were? FFCs. The FFCs made the variables useless. The "T" ones were dropped because I had the HARDEST time trying to find a solution to making them work. I mean, they were supposed to be two-way warps, but the only way I could think of to make them work would be to place the FFC at Link's old position after warping, but...What if it was at your present location already? That would make for a nasty problem. Plus, you could achieve the same effect with the ComboO1-6 and ComboD1-6 variables anyways, so I just replaced them with more of the warp combos. :)

Now, the only bugs left are that sometimes, when you're on a Warp combo (That is, one of the "Combo" variables), you'll warp to the wrong FFC. And the other bug is that sometimes, when you're on a Warp combo, instead of warping to an FFC, you'll sometimes warp to a random location, which isn't supposed to happen. Perhaps changing the order of things would counteract that? I'll try, and if that works, then I'll edit this post to update that. ;) Anyways, have fun. Oh, and as for a test quest...

I uploaded one here (http://www.geocities.com/pikachu_fan_13/Test.zip) for some help here, but you can open it up and take a look at what I did with it. If you need more Magic, Level-1 cheat is 4. :D Have a nice day.

C-Dawg
03-07-2007, 12:09 PM
Just because I'm not posting in these threads doesn't mean I'm not impressed. Keep churning out scripts, my man. And get others to keep contributing.