Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   When bushes get destroyed (https://forums.graalonline.com/forums/showthread.php?t=77032)

Zanzel 10-04-2007 12:24 PM

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 :).

xXziroXx 10-04-2007 03:22 PM

There's no function for it.

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

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

bscharff 10-06-2007 02:49 AM

You Should Forward This Thread To Stefan, He May Be Able To Make A Function for It.

oo_jazz_oo 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

bscharff 10-06-2007 06:44 AM

Why Bother Making A Function?
Because It Makes It Easier on Us Scripters. :)

Angel_Light 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

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

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

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


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.