HeroOfFire
06-10-2007, 06:29 PM
I've made a bunch of Utility Scripts for quests. All have been last tested in Build 364.
Update: Last Tested In Build 478.
Script #1 Progress Checker
It checks for a requirement and changes all of one combo into another if the requirement is met.
//Various Scripts, by HeroOfFire
//NOTE: When I say activation of a script, I mean setting its CSet to 0.
//This is how I tell a script its been activated, triggered, etc.
import "std.zh"
//FFC Script ProgressChecker
//Script that tests to see if Link meets certain requirements
//If Link meets the requirement or activates the combo, all combos
//of one type are replaced by another combo
//It runs once unless it waits for activation
//Best Use: Replacing Trigger Enemies to Simulate Side Quests
//You can even have more than one per screen!
//Also not DMap Dependant! Another Plus!!!
//Can be used with other FFCs if set to Activation Requirement
//D0 = FFC Number (starts at 1)
//D1 = Requirement Type. 0 = Specific Item, 1 = Total Hearts, 2 = Total Magic, 3 = Slash, AnyOther = Activation
//D2 = Trigger value of requirement. Either item number, total hearts, or total magic
//This does not need to be set if combo is Slash Requirement or activated (Activation Requirement Type)
//D3 = The number of the combo that gets replaced
//D4 = The number of the new combo that replaces the old one
ffc script ProgressChecker {
void ChangeCombos(int tc, int nc) {
int cTile;
for (cTile = 0; cTile < 176; cTile++)
{
if (Screen->ComboD[cTile] == tc)
{
Screen->ComboD[cTile] = nc;
}
}
}
void run(float thisFFC, int triggerType, int triggerValue, int targetCombo, int newCombo) {
ffc this1 = Screen->LoadFFC(thisFFC);
while (true)
{
if (triggerType == 0)
{
if (Link->Item[triggerValue])
{
ChangeCombos(targetCombo, newCombo);
}
Quit();
}
else if (triggerType == 1)
{
if (Link->MaxHP >= triggerValue)
{
ChangeCombos(targetCombo, newCombo);
}
Quit();
}
else if (triggerType == 2)
{
if (Link->MaxMP >= triggerValue)
{
ChangeCombos(targetCombo, newCombo);
}
Quit();
}
else if (triggerType == 3)
{
if (Game->Generic[GEN_CANSLASH] == 1)
{
ChangeCombos(targetCombo, newCombo);
}
Quit();
}
else if (this1->CSet == 0)
{
ChangeCombos(targetCombo, newCombo);
this1->Data = 0;
Quit();
}
Waitframe();
}
}
}
For a quick overview:
This script has 5 parameters.
The first is the number of the FFC (the workaround for the this->bug).
The second is the kind of progress the script is checking.
0: Link has specific item.
1: Link has a number of hearts
2: Link has an amount of magic
Other: Link has activated the FFC (set its CSet to 0)
The third is the value of the progress.
This is either the item number or the amount of max life/max magic.
The fourth is the combo # you want to replace.
The fifth is the combo # you will be replacing the other combo with.
Basic Uses:
Change walkable combos into stair or pit combos and vice-versa.
Swap unwalkable combos for walkable combos and vice-versa.
Simply change walkable combos into other walkable combos that are used as a clue for puzzles.
Cool Things:
You can have many FFCs using this script per screen. That means one screen could change multiple times over a quest based on what each FFC is checking for.
The lens of truth cannot pick up these changes. You can hide secrets from the crafty player.
Enemies and secret combos are unneccessary! You can have the script test for an item while Link can kill all the enemies to activate the normal secrets.
DMap independent! No more needing extra DMaps so you can use those trigger enemies in boss rooms!
If combined with another script that changes its CSet to 0, you can use the activation requirement without needing the FFC to have a flag.
You can have multiple of these scripts looking for the exact same thing. Perhaps you want to raise all the red walls and lower all the blue ones when Link has a 'dummy' item of some sort in his inventory. Just have two FFCs checking for the same item.
Potential Applications:
Link can't get to the screen with the Magic Sword unless he has the White Sword.
Link can't get to the screen with the White Sword unless he has enough life.
Link can't get stuck because he lacks an item (for example, Link can't enter the room with Gannon unless he has the silver arrow).
Link can't attempt a trial without enough life (just like a cave in Majora's Mask).
Link can't progress unless he can read the ancient text by having the magic book (Link would normally get warped to a screen where an invisible guy gives you unreadable text. If he has the book, Link instead warps to a different screen where he 'reads' the text and the path is opened, just like in LTTP).
Update Complete: Script can now check if Link has the slash ability. Good if you want Link to have the slash ability before the spin attack.
Update: Last Tested In Build 478.
Script #1 Progress Checker
It checks for a requirement and changes all of one combo into another if the requirement is met.
//Various Scripts, by HeroOfFire
//NOTE: When I say activation of a script, I mean setting its CSet to 0.
//This is how I tell a script its been activated, triggered, etc.
import "std.zh"
//FFC Script ProgressChecker
//Script that tests to see if Link meets certain requirements
//If Link meets the requirement or activates the combo, all combos
//of one type are replaced by another combo
//It runs once unless it waits for activation
//Best Use: Replacing Trigger Enemies to Simulate Side Quests
//You can even have more than one per screen!
//Also not DMap Dependant! Another Plus!!!
//Can be used with other FFCs if set to Activation Requirement
//D0 = FFC Number (starts at 1)
//D1 = Requirement Type. 0 = Specific Item, 1 = Total Hearts, 2 = Total Magic, 3 = Slash, AnyOther = Activation
//D2 = Trigger value of requirement. Either item number, total hearts, or total magic
//This does not need to be set if combo is Slash Requirement or activated (Activation Requirement Type)
//D3 = The number of the combo that gets replaced
//D4 = The number of the new combo that replaces the old one
ffc script ProgressChecker {
void ChangeCombos(int tc, int nc) {
int cTile;
for (cTile = 0; cTile < 176; cTile++)
{
if (Screen->ComboD[cTile] == tc)
{
Screen->ComboD[cTile] = nc;
}
}
}
void run(float thisFFC, int triggerType, int triggerValue, int targetCombo, int newCombo) {
ffc this1 = Screen->LoadFFC(thisFFC);
while (true)
{
if (triggerType == 0)
{
if (Link->Item[triggerValue])
{
ChangeCombos(targetCombo, newCombo);
}
Quit();
}
else if (triggerType == 1)
{
if (Link->MaxHP >= triggerValue)
{
ChangeCombos(targetCombo, newCombo);
}
Quit();
}
else if (triggerType == 2)
{
if (Link->MaxMP >= triggerValue)
{
ChangeCombos(targetCombo, newCombo);
}
Quit();
}
else if (triggerType == 3)
{
if (Game->Generic[GEN_CANSLASH] == 1)
{
ChangeCombos(targetCombo, newCombo);
}
Quit();
}
else if (this1->CSet == 0)
{
ChangeCombos(targetCombo, newCombo);
this1->Data = 0;
Quit();
}
Waitframe();
}
}
}
For a quick overview:
This script has 5 parameters.
The first is the number of the FFC (the workaround for the this->bug).
The second is the kind of progress the script is checking.
0: Link has specific item.
1: Link has a number of hearts
2: Link has an amount of magic
Other: Link has activated the FFC (set its CSet to 0)
The third is the value of the progress.
This is either the item number or the amount of max life/max magic.
The fourth is the combo # you want to replace.
The fifth is the combo # you will be replacing the other combo with.
Basic Uses:
Change walkable combos into stair or pit combos and vice-versa.
Swap unwalkable combos for walkable combos and vice-versa.
Simply change walkable combos into other walkable combos that are used as a clue for puzzles.
Cool Things:
You can have many FFCs using this script per screen. That means one screen could change multiple times over a quest based on what each FFC is checking for.
The lens of truth cannot pick up these changes. You can hide secrets from the crafty player.
Enemies and secret combos are unneccessary! You can have the script test for an item while Link can kill all the enemies to activate the normal secrets.
DMap independent! No more needing extra DMaps so you can use those trigger enemies in boss rooms!
If combined with another script that changes its CSet to 0, you can use the activation requirement without needing the FFC to have a flag.
You can have multiple of these scripts looking for the exact same thing. Perhaps you want to raise all the red walls and lower all the blue ones when Link has a 'dummy' item of some sort in his inventory. Just have two FFCs checking for the same item.
Potential Applications:
Link can't get to the screen with the Magic Sword unless he has the White Sword.
Link can't get to the screen with the White Sword unless he has enough life.
Link can't get stuck because he lacks an item (for example, Link can't enter the room with Gannon unless he has the silver arrow).
Link can't attempt a trial without enough life (just like a cave in Majora's Mask).
Link can't progress unless he can read the ancient text by having the magic book (Link would normally get warped to a screen where an invisible guy gives you unreadable text. If he has the book, Link instead warps to a different screen where he 'reads' the text and the path is opened, just like in LTTP).
Update Complete: Script can now check if Link has the slash ability. Good if you want Link to have the slash ability before the spin attack.