![]() |
When bushes get destroyed
Is there any possible functions for when you destroy a bush ?
Or would I just have to use an index with an image ? It has been pondering me for a few hours now, and I am tying to figure it out, if you could guide me as to what I should start with that'd be great :). |
There's no function for it.
|
I suppose you could script your own by checking the tiles directly in front of you when slashing your sword, and if they're the bush tiles, do stuff.
|
Scripting my own sounds best at this point :)
I had change of plans for a servers Halloween system so I will just script my own I guess, thanks. |
You Should Forward This Thread To Stefan, He May Be Able To Make A Function for It.
|
Why bother making a function?
All you need to do is find the tiles where the player is slashing (or doing w/e) and look for bush tiles, then make a loop to find the top left corner tile of those bushes, and change those 4 tiles to the destroyed bush tiles. Then the server will automaticaly regenerate that bush... I did it on a system before lol |
Why Bother Making A Function?
Because It Makes It Easier on Us Scripters. :) |
Meh Dusty gave a good formula for detecting tiles, it aint that hard if your a good scripter :P
|
Hmm, well my formula for tiles was for tiles[x,y]>pics1.png, not really for detecting tiles(unless you're talking about my hammer script). It's a lot simpler to detect tiles when it's just checking the tiles in the level(as easy as making an array and checking if the tiles[x,y] is in the array).
But... the problem is it's most likely going to be difficult to script one that is in sync with the default bush checking. The other option could be detecting leaps(if you can even do that, I don't remember), and if it's a bush leap execute whatever script you want. |
there's obviously more than one way of doing something. sometimes the most efficient way takes the harder route, but i would agree with Jazz.
|
I got it working, I just made it detect when a player slashes
a bush it has a random chance to drop whatever, in this case, 1 of 5 random types of candy. Although a function would be handy, I found it easier to script a hit detection. |
| All times are GMT +2. The time now is 11:47 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.