PDA

View Full Version : Deep Water Combos



Nimono
11-04-2007, 12:02 PM
Well, it's a semi-combo. It doesn't use any existing combos or flags to tell what combos are deep water. No, the FFC's arguments decide that. First 4 are normal water, second 4 are for Dive Warps.


// Deep Water- When Link steps on a certain combo without a certain item in his inventory, the combo turns into a Damage Combo. If he does, it becomes normal
// water. Simple. as. that. 4 combos for Water, 4 combos for Dive Warp. No Swim Warp, though. Unless you feel like making more variables. Set this script to
// each screen with the desired combo(s). Best not to use it anywhere else. Why? Well, it wouldn't really make sense. A waste of FFCs.
// 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.
// 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.
// damage- Which damage combo the deep water combos will turn into if you do not have the Level 2 Flippers. In case 1/2 Heart isn't enough for you.
// warp1-warp4- Which Dive Warp combo the 4 "dive" variables will turn into. They don't even need to be Dive Warp combos. In case you want more than one Dive
// Warp per screen, or if you've used some other warps. Hey, better safe than sorry. I need to make sure of your ideas! :(
// solidity- Solidity for the combos if you don't have Level 2 Flippers. Uses binary system. 0 = Walkable, 15 = Unwalkable.

import "std.zh"

const int level2flippers = 248;
const int damage = 31;
const int warp1 = 19;
const int warp2 = 19;
const int warp3 = 19;
const int warp4 = 19;
const int solidity = 0;

ffc script deepwater
{
void run(int water1, int water2, int water3, int water4, int dive1, int dive2, int dive3, int dive4)
{
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[level2flippers])
{
Screen->ComboT[cmbchk] = damage;
Screen->ComboS[cmbchk] = solidity;
}
else if(Link->Item[level2flippers])
{
Screen->ComboT[cmbchk] = 3;
Screen->ComboS[cmbchk] = 15;
}
}
if(Screen->ComboD[cmbchk] == dive1)
{
if(!Link->Item[level2flippers])
{
Screen->ComboT[cmbchk] = damage;
Screen->ComboS[cmbchk] = 0;
}
else if(Link->Item[level2flippers])
{
Screen->ComboT[cmbchk] = warp1;
Screen->ComboS[cmbchk] = 15;
}
}
if(Screen->ComboD[cmbchk] == dive2)
{
if(!Link->Item[level2flippers])
{
Screen->ComboT[cmbchk] = damage;
Screen->ComboS[cmbchk] = 0;
}
else if(Link->Item[level2flippers])
{
Screen->ComboT[cmbchk] = warp2;
Screen->ComboS[cmbchk] = 15;
}
}
if(Screen->ComboD[cmbchk] == dive3)
{
if(!Link->Item[level2flippers])
{
Screen->ComboT[cmbchk] = damage;
Screen->ComboS[cmbchk] = 0;
}
else if(Link->Item[level2flippers])
{
Screen->ComboT[cmbchk] = warp3;
Screen->ComboS[cmbchk] = 15;
}
}
if(Screen->ComboD[cmbchk] == dive4)
{
if(!Link->Item[level2flippers])
{
Screen->ComboT[cmbchk] = damage;
Screen->ComboS[cmbchk] = 0;
}
else if(Link->Item[level2flippers])
{
Screen->ComboT[cmbchk] = warp4;
Screen->ComboS[cmbchk] = 15;
}
}
}
Waitframe();
}
}
}

This is made for 357, so no drowning here. But have no fear, I finally got it to work in 635. So later today, I'll try to modify this script to work with drowning. Only problem is if you have Level 1 Flippers. How am I gonna take them away only when you're on the combo and BEFORE you start swimming? That's the main problem. I can't take them away if you're next to the combo, since you might... Y'know, be either on or next to a normal water Combo... :/ In any case...

D0-D3 are the normal "Deep Water" combos. You take damage if you try to walk on 'em without the Level 2 Flippers. Otherwise, they're normal water. D4-D7 are for if you want Dive Warps. I kept them seperate, though, in case you wanted all 4 combos to go to different locations. level2flippers tells what item ID is used for the Level 2 Flippers. damage tells the ID of the damage combo. For ease of use, don't check std.zh for this. Instead, place said combo on the screen, and press the "q" key twice. The numbers you see are the Combo IDs. 1/2 is 31. 1 is 32. 2 is 33. 4 is 34. Don't think that the higher ones are 35 and up, though. THOSE are in the 100's. So, anyways... The warp variables are for the Dive Warp Deep Water combos. They're all Dive Warp (A) by default... Change them as you see fit. And that's it. Have fun with it.

Edit: Changed the script so you can decide the solidity of the combo if you don't have Level 2 Flippers.

Din
11-04-2007, 03:00 PM
Item to FFC scripting! Anyway, there's the lava a certain someone is looking for!

Joe123
11-04-2007, 03:26 PM
Are you talking about me Din?
Because I scripted the Lava myself this morning :P


ffc script hole{
void run(int btrtx, int btrty, int warpx, int warpy, int tile){
int timer;
int x;
int y;
int invis = 131;
int sfx = 74;
int switch = 0;
if(warpx == 0 && warpy == 0){Waitframes(5); warpx = Link->X; warpy = Link->Y;}
if(tile == 0){tile = 9186;}
int orig = Screen->ComboT[ComboAt(warpx,warpy)];

while(true){
if((Link->X >= this->X) && (Link->Y >= this->Y) && (Link->X <= btrtx) && (Link->Y <= btrty) && Link->Z == 0){
for(timer = 0; timer < 40; timer++){
if(switch == 0){Game->PlaySound(sfx); switch = 1; x = Link->X; y = Link->Y;}
Link->Item[invis] = true;
Link->Item[I_CLOCK] = true;
Link->InputA = false;
Link->InputB = false;
Link->InputL = false;
Link->InputLeft = false;
Link->InputRight = false;
Link->InputUp = false;
Link->InputDown = false;
Screen->DrawTile(2, x, y, tile+Floor(timer/8), 1, 1, 6, 1, 0, 0, 0, 0, true, 128);
Waitframe();
}
for(timer = 0; timer < 2; timer++){
switch = 0;
Link->Item[I_CLOCK] = false;
Link->Item[invis] = false;
Link->X = warpx;
Link->Y = warpy;
Link->InputA = false;
Link->InputB = false;
Link->InputL = false;
Link->InputLeft = false;
Link->InputRight = false;
Link->InputUp = false;
Link->InputDown = false;
Screen->ComboT[ComboAt(warpx,warpy)] = 31;
Waitframe();
}
Screen->ComboT[ComboAt(warpx,warpy)] = orig;
}
Waitframe();
}
}
}

Apparently it's rather simmilar to what you have Matthew, although I think my script is more basic
(sorry &#172;_&#172;).

All mine does is check whether Link is within a certain square, make sure he's not jumping, then make him invisible and give him a clock, play an animation of him falling where he was standing and play a sound effect, then put him at the place where he entered the screen, remove the clock, make him visible and set the combo to a damage combo for 2 frames, then change it back.

I could easily make it so that you can negate the effect of it with flippers though, making it too into a deep water type effect.

Nimono
11-04-2007, 03:57 PM
Ummm... Joe, you coulda worded that better... When I read that, I took that as you trying to say that your script would be better than mine. (I seriously don't see the point in having two scripts to the same thing.) Yeah... I'd appreciate it if you wouldn't try to put your scripts in my release threads... Because that kinda makes me feel like you're trying to steal attention away from my scripts. (Don't ask, okay?)

Edit: Oh, and by the way, I'm nearly done making this script work with drowning. Only problem is, it won't give you back the Flippers once it takes them. (Has to do that, or you'll swim in the water instead of drown....) But if you leave the screen and come back, you get them back! How weird.

Joe123
11-04-2007, 04:24 PM
Nono, I wasn't saying it was better, I was saying it served a more simple function. It's just another script that does a simmilar thing, I only really posted it because of the coincidence that I happened to write it this morning.
I'm not trying to steal your attention or anything, it's just another way of doing it :shrug:

Nimono
11-04-2007, 04:35 PM
Nono, I wasn't saying it was better, I was saying it served a more simple function. It's just another script that does a simmilar thing, I only really posted it because of the coincidence that I happened to write it this morning.
I'm not trying to steal your attention or anything, it's just another way of doing it :shrug:
Of course. I knew you didn't mean that. I was just saying.

Anyways, back on-topic, has anyone seen any bugs with this or anything? ...Besides some odd effect where an excact 1/2 heart isn't taken away?

Is the script any good? Is there anything that could be done better?
Feed back appreciated.

Gleeok
11-04-2007, 05:33 PM
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.

Nimono
11-04-2007, 07:44 PM
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.


// 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.


// 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();
}
}
}


// 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. ;)