PDA

View Full Version : Magic Mirror



Russ
06-09-2008, 08:00 PM
Would it be possible for somebody to script a LttP style magic mirror? Basically, if your in the Dark World dmap, it warps you to the same screen of the Light World dmap, and if you land on an unwalkable combo, it warps you back. Would it be possible?

CJC
06-09-2008, 09:33 PM
Well... I tried.


(THIS IS INCOMPLETE! DON'T RIP IT!)


//Put This item script in your .z file
int Mirror;
bool isSolid;

item script Mirror{
void run(){
Mirror = 1;
}
}
//Attach it to a custom item class. There are no arguments required for the item.


global script HarvestToPlug{
void run(){

//Be sure to set game sound "160" to the warping sound.
//Plug this between your void run and while loop in your Slot 2 Global Script
int CurrentDmapCheck = Game->GetCurDMap();

int DarkWorldDmap1 = 12;
int DarkWorldDmap2 = 13;//Change #s to your darkworld dmaps.
int DarkWorldDmap3 = 14;//Make sure they correspond to the light world Dmaps of same number

int LightWorldDmap1 = 15;
int LightWorldDmap2 = 16;//Change #s to your lightworld dmaps.
int LightWorldDmap3 = 17;//Make sure they correspond to the dark world Dmaps of same number

int CurrentMapCheck = Game->GetCurMap();
int CurrentScreenCheck = Game->GetCurScreen();
//Stop here

while(true){

//Put this somewhere in your while loop in Global Script slot 2.
if(CurrentDmapCheck==DarkWorldDmap1 && Mirror==1){
Screen->Wavy = 4;
Link->PitWarp(LightWorldDmap1, CurrentScreenCheck);
Game->PlaySound(160);
}
else if(CurrentDmapCheck==DarkWorldDmap2 && Mirror==1){
Screen->Wavy = 4;
Link->PitWarp(LightWorldDmap2, CurrentScreenCheck);
Game->PlaySound(160);
}
else if(CurrentDmapCheck==DarkWorldDmap3 && Mirror==1){
Screen->Wavy = 4;
Link->PitWarp(LightWorldDmap3, CurrentScreenCheck);
Game->PlaySound(160);
}
else{
Mirror = 0;
}
//Finish Snipping here.
Waitframe();
}//End of While Loop
}//End of Void Run
}


It only works on DarkWorld Dmaps (12, 13, and 14, though you can change those easily). However, I can't seem to get it to stop warping (Or doing screen->wavy). Also, I can't figure out how to make it check solidity AFTER warping. Maybe this will give somebody else a jump-start to writing a functional script, though.

_L_
06-09-2008, 10:35 PM
What you should do is set Screen->Wavy, freeze Link in place for a couple frames, then Link->PitWarp him someplace.

Russ
06-09-2008, 10:38 PM
Thanks for helping. With that as a base, somebody will probably finish it.