Originally Posted by
Gleeok
Hey, that's pretty neat. I just might use this for trap combos and lava, ooh poison swamp gas maybe. Good work. I did notice two things you were using for this. ComboS [ComboAt] ...or ComboS[int] = 15?! I have to say that I like to understand every script I use. I'm guessing ComboS = 15 is walkable...which is the opposite I would of thought. I thought it was used like 1111, 0100 etc. Can you explain this a little for me? Great script though.
Sure. ComboAt returns "(y & 240)+(x>>4)". Basically, takes the given x and y position, and returns what combo position is there. Good for combining Link's X and Y, or an FFC's X and Y to find out what combo is at those positions. ComboS.... Like I say every time I use it, it uses the binary system. But the value you enter is DECIMAL! So it's like this. Binary is read right to left. So 0001 is 1. 0010 is 2. And so on. From right to left, the bits are as such: Solidity Top-Left, Top-right, bottom-left, bottom-right. I think. You'll have to check. 1111 = 15, so 15 = fully unwalkable. Also. A special treat. I got Deep Water 2 working finally.
Code:
// Deep Water 2- When Link steps on a certain combo without a certain item in his inventory, he drowns. If he has the Level 1 Flippers, they are temporarily
// taken away from him so he will drown. If you want Lava, change the item to one you can never get.
// Constants/Variables:
// water1-water4- D0 through D3. Control what combos to make "Deep Water" combos.
// dive1-dive4- D4 through D7. Control what combos to make "Deep Water (Dive)" combos.
// level2flippers- What item ID will be used for the Level 2 Flippers. And please, remember to set the item in the Flippers Itemclass. It makes it better.
// hold- Item ID for the item to replace Link's Flippers with so he can drown. He can't drown if he has the Flippers! He gets his Flippers back eventually.
import "std.zh"
const int level2flippers = 255;
const int hold = 254;
ffc script deepwater2
{
void run(int water1, int water2, int water3, int water4, int dive1, int dive2, int dive3, int dive4)
{
while(true)
{
while(!Link->Item[level2flippers])
{
int loc = ComboAt(Link->X, Link->Y);
if(Link->Item[51])
{
Link->Item[hold] = true;
}
if(Screen->ComboD[loc] == water1 || Screen->ComboD[loc] == water2 || Screen->ComboD[loc] == water3 || Screen->ComboD[loc] == water4 || Screen->ComboD[loc] == dive1 || Screen->ComboD[loc] == dive2 || Screen->ComboD[loc] == dive3 || Screen->ComboD[loc] == dive4)
{
Link->Item[51] = false;
Waitframes(21);
}
if(Link->Item[hold])
{
Link->Item[51] = true;
}
Link->Item[hold] = false;
Waitframe();
}
Waitframe();
}
}
}
It works with Link Drowns in Walkable Water, so be sure that you're using 635 when using this... It gives you a "dummy" item when you walk in deep water without the Level 2 Flippers, so... Be sure to set this item as Equipment Item, Level >0, and set it to look like the Level 1 Flippers. Why? Well, do you REALLY want it to show that the Flippers were actually taken away? Someone might pause when they start drowning. That'd reveal NO FLIPPERS. Therefore... Eh, you get the idea. Also, #2... I made 2 Lava Combo scripts. One for Drowning, one for normal Damage. Just 'cause. Again, for Lava Combo 2, set hold2's item to look like Level 2 Flippers. And give it Level 2. Maybe set it to be of the same Item Class as hold1.
Code:
// Lava Combo- Damages Link unless he has the Lava Suit.
// Constants/Variables:
// water1-water4- D0 through D3. Control what combos turn into water.
// dive1-dive4- D4 through D7. Will be used for Dive Warp instead of Water.
// 2flippers- What item ID will be used for the Level 2 Flippers. And please, remember to set the item in the Flippers Itemclass. It makes it better.
// Is renamed to avoid conflict with Deep Water 1 and 2, and Lava Combo 2...
// lvasut- Item ID for the Lava Suit.
// damage- Which damage combo the lava combos will turn into if you do not have the Lava Suit. In case 1/2 Heart isn't enough for you.
// chngcmb- What combo the Lava Combos will turn into if you DO have the Lava Suit.
// chngsld- Solidity of the Lava Combos when you have the Lava Suit
import "std.zh"
const int 2flippers = 248;
const int lvasut = 252;
const int damage = 31;
const int chngcmb = 3;
const int chngsld = 15;
ffc script deepwater
{
void run(int lava1, int lava2, int lava3, int lava4)
{
while(true)
{
for (int cmbchk = 0; cmbchk < 176; cmbchk++)
{
if(Screen->ComboD[cmbchk] == water1 || Screen->ComboD[cmbchk] == water2 || Screen->ComboD[cmbchk] == water3 || Screen->ComboD[cmbchk] == water4)
{
if(!Link->Item[lvasut])
{
Screen->ComboT[cmbchk] = damage;
Screen->ComboS[cmbchk] = 0;
}
else if(Link->Item[lvasut])
{
Screen->ComboT[cmbchk] = chngcmb;
Screen->ComboS[cmbchk] = chngsld;
}
}
}
Waitframe();
}
}
}
Code:
// Lava Combo 2- It's just a modification of Deep Water 2 so you drown no matter WHAT level of Flippers you have. Of course, I'm sure there are people who may
// like to have swimmable lava if you have a certain item. Well... I have your solution. Lava Suit. If you have that item, you can swim in this lava. This
// lava doesn't kill you, though.
// Constants/Variables:
// lava1-lava2- D0 through D3. Controls what combos are Lava Combos.
// flippers2- The Level-2 Flippers item ID, just in case you want to use this script along with Deep Water 1 or 2. Needs a different name than before...
// It conflicts with the Deep Water scripts, so it gets renamed here.
// lavasuit- The item ID for the item that allows you to swim or walk in lava. If you have this, this script does nothing, thus the combo acts like it does
// normally.
// hold1- Item ID for the item to replace Link's Flippers with so he can drown. He can't drown if he has the Flippers! He gets his Flippers back eventually.
// Like with flippers2, this name conflicts with the Deep Water scripts...
// hold2- Item ID for the item to replace Level 2 Flippers with. Same as above, but for the Level 2 Flippers. You get 'em back eventually.
import "std.zh"
const int flippers2 = 255;
const int lavasuit = 252;
const int hold1 = 254;
const int hold2 = 253;
ffc script lavacombo
{
void run(int lava1, int lava2, int lava3, int lava4)
{
while(true)
{
while(!Link->Item[lavasuit])
{
for (int cmbchk = 0; cmbchk < 176; cmbchk++)
{
if(Screen->ComboD[cmbchk] == lava1 || Screen->ComboD[cmbchk] == lava2 || Screen->ComboD[cmbchk] == lava3 || Screen->ComboD[cmbchk] == lava4)
{
Screen->ComboT[cmbchk] = 3;
}
}
int loc = ComboAt(Link->X, Link->Y);
if(Link->Item[51])
{
Link->Item[hold1] = true;
}
if(Link->Item[flippers2])
{
Link->Item[hold2] = true;
}
if(Screen->ComboD[loc] == lava1 || Screen->ComboD[loc] == lava2 || Screen->ComboD[loc] == lava3 || Screen->ComboD[loc] == lava4)
{
Link->Item[51] = false;
Link->Item[flippers2] = false;
Waitframes(21);
}
if(Link->Item[hold1])
{
Link->Item[51] = true;
}
if(Link->Item[hold2])
{
Link->Item[level2flippers] = true;
}
Link->Item[hold] = false;
Link->Item[hold2] = false;
Waitframe();
}
Waitframe();
}
}
}
Have fun! Also, if you require a test quest... PM me or something.
Edit: Oh dear, I forgot. I also set the Lava Combos to not damage you if you have a certain item in your inventory, the Lava Suit.