Jump to content

Photo

Triforce Warp Script


  • Please log in to reply
18 replies to this topic

#1 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 02 September 2016 - 12:35 PM

I'm looking for a script that can warp me to a cutscene depending on the number of Triforces I have. 

 

The effect I want to create is something similar to A Link Between Worlds where cutscene triggers after defeating so many dungeons.

 

I'll need this script to have arguments that allow me to:

- Select How many Triforces before warp occurs.

- Where to warp when script is triggered.

 

These cutscenes will feature Link walking out of a dungeon then an event occuring, so it's important that if I collect the 2nd triforce in a 3rd dungeon, that the cutscene after the 2nd triforce will actually trigger outside of the 3rd dungeon instead, and thus the script must also warp to that cutscene. 

 

I would greatly appreciate it because this is the script I need to actually put some real story into TRIFORCE. 



#2 Jamian

Jamian

    ZC enthusiast

  • Members

Posted 03 September 2016 - 04:30 AM

What I'd do is have an FFC script that you'd place on each screen leading to a dungeon.

 

As you enter the screen (which is what'll happen when you leave a dungeon after collecting a Triforce piece), the script checks if you have the required amount of Triforce pieces. If you do, it records Link's current location, and warps you to the cut-scene. To give the player time to see what is happening, it'd first wait a certain amount of frames (I'd probably freeze Link and make him invincible for a short time, to ensure he doesn't leave the screen or die before the warp could take place).

 

Once the cut scene ends, another script placed there warps you back to where you were previously.

 

Is this what you want?

 

You'll need some sort of global variables (could be Link's misc attributes, or (less recommended) dummy items) to keep track of where Link needs to be warped back after the cut-scene, and keep track of which cut-scenes have already been watched.



#3 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 03 September 2016 - 06:48 AM

Well, i don't want it to warp you back as the cutscene could and will lead you somewhere else. Link will start the cutscene walking out of the dungeon where he'll encounter someone. This leads him to somewhere else where "story stuff happens". Link will have no reason to return to the dungeon.

#4 Jamian

Jamian

    ZC enthusiast

  • Members

Posted 03 September 2016 - 07:01 AM

Is the encounter cut-scene scripted, or will you create a different one using ZQ tricks for each possible location?



#5 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 03 September 2016 - 07:32 AM

The cutscene won't be scripted.

The script can check to see if Link has the required number of Triforce's when Link leaves the dungeon (the script will also prevent enemies from appearing on screen and stuff like that). If Link has the right amount of Triforces. I will warp Link to an identical screen where the cutscene begins.

The script won't be triggered by the triforce warp itself though as I plan on having the triforce item warp to mini unique cutscenes explaining the power of certain items before officially leaving. The script should trigger the moment you leave the dungeon after it does its Triforce count.

Edited by NewJourneysFire, 03 September 2016 - 08:06 AM.


#6 Jamian

Jamian

    ZC enthusiast

  • Members

Posted 03 September 2016 - 10:35 AM

Alright. In that case you shouldn't need to bother with preventing enemies from appearing, as you can have it be a seamless instawarp, and the script will trigger before enemies appear.

 

How many such cut-scenes will there be? If you want to set everything up via the arguments, then for each cut-scene you'll need an argument for the required amount of Triforce pieces, and the screen number to warp to (providing they're all on the same dmap, otherwise you'll need an argument for that too).

 

What do you plan on using to keep track of which cut-scenes have been triggered? It can be Link-Misc if you have an open slot there.



#7 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 03 September 2016 - 12:25 PM

I'm thinking 3 should be plenty, an event after every two triforce piece. So that'll be 2, 4, and 6 pieces. 


Edited by NewJourneysFire, 03 September 2016 - 12:27 PM.


#8 Jamian

Jamian

    ZC enthusiast

  • Members

Posted 05 September 2016 - 07:32 AM

It appears Link->Misc's variables are not saved from game to game, so here's a version using the first script counter.

 

You'll either want to have

 

Game->MCounter[CR_SCRIPT1]=3;

 

in a script that'll run at the beginning of the quest;

 

Or: give the player a dummy item in the init data that sets the maximum for said script counter. This is because the maximum is set at 0 by default, so you can't change the counter until you set a higher maximum. If you're playing with an already existing save, you can use the level 4 cheat to give yourself said dummy item.

 

The arguments list is:
D0 required amount of Triforce pieces for 1st scene

D1 screen number of 1st scene

D2 required amount of Triforce pieces for 2nd scene
D3 screen number of 2nd scene

D4 required amount of Triforce pieces for 3rd scene
D5 screen number of 3rd scene
 

ffc script TriforceWarp
{
    void run(int numTriforce1, int warpScreen1, int numTriforce2, int warpScreen2, int numTriforce3, int warpScreen3)
    {
        if(NumTriforcePieces()==numTriforce1 && Game->Counter[CR_SCRIPT1]==0)
        {
            Game->Counter[CR_SCRIPT1]++;
            Link->PitWarp(X,warpScreen1); // replace X with the cut-scene Dmap number
        }
        if(NumTriforcePieces()==numTriforce2 && Game->Counter[CR_SCRIPT1]==1)
        {
​            Game->Counter[CR_SCRIPT1]++;
            Link->PitWarp(X,warpScreen2); // replace X with the cut-scene Dmap number
        }
        if(NumTriforcePieces()==numTriforce3 && Game->Counter[CR_SCRIPT1]==2)
        {
​            Game->Counter[CR_SCRIPT1]++;
            Link->PitWarp(X,warpScreen3); // replace X with the cut-scene Dmap number
        }
    }
}

Place the script on every screen leading to a Triforce dungeon. I'm not sure if it's necessary, but you may have to check the "Run script at screen init" box if you briefly see enemies appearing.



#9 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 07 September 2016 - 06:22 AM

Considering that all scenes are included in these arguments, I assume that unless applied, all other arguments should be listed as 0 by default?

 

I just wanted to make sure I understand before I begin adding this in. 



#10 Jamian

Jamian

    ZC enthusiast

  • Members

Posted 07 September 2016 - 09:41 AM

The script only uses arguments from D0 to D5, so it doesn't matter how the other arguments are set. It won't even read the numbers you put for the other ones. So, you can leave them at 0.



#11 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 07 September 2016 - 11:27 AM

What I mean is if I'm using D0 and D1 for the first cutscene, I can thus leave D2, D3, D4, and D5 0 correct?

 

Also I've noticed that D1, D3, and D5 says screen number, but there isn't available screens on the overworld map to stick a cutscene screen to since I would be placing these ffcs outside of the dungeon entrance for them to trigger once I completed the dungeon. Wouldn't it be better for the script to warp to a dmap continue screen instead? I can just start the cutscene from there since the cutscenes will be on different maps & dmaps.

 

Also, wouldn't this script trigger every time I enter that screen or just once?


Edited by NewJourneysFire, 07 September 2016 - 11:29 AM.


#12 Jamian

Jamian

    ZC enthusiast

  • Members

Posted 07 September 2016 - 02:20 PM

From what you've described, I was under the impression that dungeons can be completed in a non-linear order, and you can thus obtain triforce fragments at any given point. Then you do need to fill in all arguments to take that into account.

 

You need to replace the X in the script with the Dmap number. I've marked those instances with the comments in red: "// replace X with the cut-scene Dmap number".

 

The script will trigger just once, this is why you need to use that script counter to keep track of which cutscenes have already been visited.



#13 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 07 September 2016 - 02:55 PM

Oh sorry, I missed the notes in the script where it states to replace the x.

As for triforce pieces. There are some exceptions that does force linearity.

Level 7 only available when cutscene 2 is triggered.
Level 8 only available when cutscene 3 is triggered.

So there are some linearity rules here but it shouldn't effect the nature of the script.

Edited by NewJourneysFire, 07 September 2016 - 02:57 PM.


#14 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 06 December 2016 - 03:51 PM

Okay, I'm about to add this script because I'm finally in a situation to put it into my quest, and I just realized "X for dmap" just might not be enough. I probably never explained things correctly, so let me try to explain again that's needed to be done. Technically the dmap of the cutscene will depend on the dmap of the actual dungeon entrance because most cutscenes will start at the dungeon entrances themselves and they include various palettes. For example:

 

- Exiting Level 2 normally would lead to Level 2 exit.

- Exiting Level 2 with script will lead to scene in a duplicate screen of the Level 2 entrance where a guy confronts Link to say something is happening, this continues the cutscene in the event that's unfolding.

 

So technically what I want the script to do is take Link from dungeon entrance screen to a mock dungeon entrance screen where cutscene begins. This can involve many dmaps because the dmap where Link will be warped to by the script will need to include the same palette as the dungeon entrance. 



#15 Jamian

Jamian

    ZC enthusiast

  • Members

Posted 06 December 2016 - 04:00 PM

edit the void run line to:

void run(int numTriforce1, int warpScreen1, int numTriforce2, int warpScreen2, int numTriforce3, int warpScreen3, int numDmap)

Replace X with numDmap inside the script

 

Then set up the Dmap as the D6 argument in your ffc.

 

 




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users