View Full Version : When bushes get destroyed

10-04-2007, 12:24 PM
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 :).

10-04-2007, 03:22 PM
There's no function for it.

10-04-2007, 09:02 PM
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.

10-05-2007, 11:33 AM
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.

10-06-2007, 02:49 AM
You Should Forward This Thread To Stefan, He May Be Able To Make A Function for It.

10-06-2007, 03:00 AM
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

10-06-2007, 06:44 AM
Why Bother Making A Function?
Because It Makes It Easier on Us Scripters. :)

10-06-2007, 06:54 AM
Meh Dusty gave a good formula for detecting tiles, it aint that hard if your a good scripter :P

10-06-2007, 07:21 AM
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.

10-07-2007, 02:42 AM
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.

10-08-2007, 12:18 PM
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.