PDA

View Full Version : Custom burn flag



Pteryx
01-15-2009, 04:01 AM
Here's a pretty basic functionality I'd like to have: a Burn -> Next type of flag, as opposed to the usual "burn to permanently reveal a secret" deal. Basically, I'd like burning unimportant bushes to be treated much like slashing grass normally is. When you burn a bush that has this flag as opposed to the normal Burn flags, you reveal a stump. When you leave the screen, the states of tiles with this flag are not saved, so the bushes are back again when you return. Burning a bush with this flag on it does not count as revealing a secret, and does not play any extra sound that suggests such.

Why? Because pyromania is fun! ;) -- Pteryx

CaRmAgE
01-15-2009, 09:50 AM
I'm no scripter, but maybe this calls for an FFC that reacts to burning?

pkmnfrk
01-15-2009, 11:56 AM
That would be impractical. I'll see what I can whip up tonight.

Pteryx
01-18-2009, 01:31 PM
I appreciate the effort; I gather you've either been busier than anticipated or the project is a lot harder than you counted on? -- Pteryx

Joe123
01-18-2009, 03:58 PM
//Burn->Next type combos
const int CT_BURNNEXT = 35;
ffc script BurnNext{
void run(int sfx,int type){
if(type == 0) type = CT_BURNNEXT;
while(true){
for(int i=1;i<=Screen->NumLWeapons();i++){
lweapon check = Screen->LoadLWeapon(i);
if(check->ID != LW_FIRE) continue;
for(int j=0;j<176;j++){
if(Abs(check->X-ComboXY(j,true)) > 8
|| Abs(check->Y-ComboXY(j,false)) > 8
|| Screen->ComboT[j] != type) continue;
Screen->ComboD[j]++;
Game->PlaySound(sfx);
}
}
Waitframe();
}
}
}

D0: SFX to play
D1: Combo-type to use. Default is 'centre statue'. If you want to change the default value, set the constant at the top of the script.

If you want any kind of 'leaves' effect or anything like the Slash->Next combos, you'll have to let me know.
I've got a bit of code that does that floating around, but it involves using the global script.

Pteryx
01-19-2009, 11:50 AM
Thanks, looks like it should work great! :) I'll see how it works next build. -- Pteryx

Pteryx
02-20-2009, 03:04 PM
Oddly, I get compile errors insisting that the function ComboXY is undeclared. I did remember to add import "std.zh". Am I doing something wrong in compiling it? -- Pteryx

CaRmAgE
02-20-2009, 03:26 PM
I don't think it's defined in std.zh. Is that a function you made yourself, Joe?

Joe123
02-21-2009, 07:33 AM
Ah.

int ComboXY(int ComboAt,bool x){
if(x) return ComboAt%16*16;
else return ComboAt-ComboAt%16;
}

//Burn->Next type combos
const int CT_BURNNEXT = 35;
ffc script BurnNext{
void run(int sfx,int type){
if(type == 0) type = CT_BURNNEXT;
while(true){
for(int i=1;i<=Screen->NumLWeapons();i++){
lweapon check = Screen->LoadLWeapon(i);
if(check->ID != LW_FIRE) continue;
for(int j=0;j<176;j++){
if(Abs(check->X-ComboXY(j,true)) > 8
|| Abs(check->Y-ComboXY(j,false)) > 8
|| Screen->ComboT[j] != type) continue;
Screen->ComboD[j]++;
Game->PlaySound(sfx);
}
}
Waitframe();
}
}
}

Yes, it turns the location array back into a x,y coordinates.

Pteryx
02-22-2009, 12:34 AM
Thanks! :) Reports make it sound like this build is on the unstable side, so I'll wait again before trying to test it. -- Pteryx

Joe123
02-22-2009, 06:42 AM
Which reports?

lucas92
02-22-2009, 10:50 AM
Or just try the script in 910. It should work. That build is very stable.

Pteryx
02-23-2009, 11:54 PM
Decided to try it in the current build. Looks to work fine, but only if both the FFC and the bush are on layer 0. Any way to make it work on another layer? -- Pteryx

pkmnfrk
02-24-2009, 01:29 AM
1. FFCs don't have layers.

2. No, scripts can only access layer 0. It is unknown as to when this un-feature will be fixed.

Joe123
02-24-2009, 08:03 AM
Yeah, bushes on layer 0, sorry.
It's not that much of an inconvenience.

We can now access solidity on layers 1 and 2 though!

And what layer the ffc is on is completely irrelevant, it should have a transparent graphic.
It's just a way to apply the script, the ffc itself isn't involved.

Pteryx
02-24-2009, 02:32 PM
Yeah, bushes on layer 0, sorry.
It's not that much of an inconvenience.

Except that I'd have to rebuild part of my tileset-in-progress around it... :uhoh: I liked the transparent-bush-plantable-anywhere functionality. Oh well... -- Pteryx

Joe123
02-24-2009, 05:06 PM
'Layer 2 is Background'?
Though that won't make layer 0 transparent.
Why do you need transparent bushes anyway?

Pteryx
02-25-2009, 03:50 PM
Not so much need as see the potential flexibility of. Losing that functionality is really just an "aw, man; oh, well" rather than a dealbreaker. -- Pteryx

Joe123
02-25-2009, 04:37 PM
Oh ok. Well sorry.