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
I'm no scripter, but maybe this calls for an FFC that reacts to burning?
That would be impractical. I'll see what I can whip up tonight.
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
//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.
Thanks, looks like it should work great! 😊 I'll see how it works next build. -- Pteryx
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
I don't think it's defined in std.zh. Is that a function you made yourself, Joe?
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.
Thanks! 😊 Reports make it sound like this build is on the unstable side, so I'll wait again before trying to test it. -- Pteryx
Or just try the script in 910. It should work. That build is very stable.
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
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.
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.
Joe123 wrote: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
'Layer 2 is Background'?
Though that won't make layer 0 transparent.
Why do you need transparent bushes anyway?
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