Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Question: Bushes (https://forums.graalonline.com/forums/showthread.php?t=73751)

Chandler 04-29-2007 08:49 PM

Question: Bushes
 
Well, I noticed that the players weapons need to be enabled for a player to destroy a bush. I've tried hitobjects(pow, x, y) and it still doesn't destroy the bush!
I don't suppose anyone else has any other solutions? I don't want to use the default enableweapons for the player.

ff7chocoboknight 04-29-2007 08:57 PM

maybe change the gani so the player doesn't slash a sword

Chandler 04-29-2007 09:11 PM

Wouldn't alter anything, it's the enableweapons that destroys the bush

ff7chocoboknight 04-29-2007 09:19 PM

i thought u wanted to destroy the bush without slashing...
why would u need to destroy bushes?

cbk1994 04-29-2007 09:28 PM

Quote:

Originally Posted by Chandler (Post 1304303)
Well, I noticed that the players weapons need to be enabled for a player to destroy a bush. I've tried hitobjects(pow, x, y) and it still doesn't destroy the bush!
I don't suppose anyone else has any other solutions? I don't want to use the default enableweapons for the player.

Best way I can think of is to make a custom gani of a bush, with a gani script possibly.

Chandler 04-29-2007 10:21 PM

Which is something I don't want to do

Chompy 04-29-2007 11:21 PM

Quote:

Originally Posted by Chandler (Post 1304343)
Which is something I don't want to do

If you have a custom fighting system, and using a custom keydown() check on s button it won't destroy the bush, however:

If you make something like

PHP Code:

function onCreated()
  
setTimer(0.05);
function 
onTimeout()
{
  if (
player.ani == "sword") {
    
setani("punch""");
    
freezeplayer(0.255);
  }
  
setTimer(0.05);


Only thing is that you have to make sure weapons don't get disabled through
disableweapons() etc..

cbk1994 04-30-2007 01:20 AM

Quote:

Originally Posted by Chompy (Post 1304363)
If you have a custom fighting system, and using a custom keydown() check on s button it won't destroy the bush, however:

If you make something like

PHP Code:

function onCreated()
  
setTimer(0.05);
function 
onTimeout()
{
  if (
player.ani == "sword") {
    
setani("punch""");
    
freezeplayer(0.255);
  }
  
setTimer(0.05);


Only thing is that you have to make sure weapons don't get disabled through
disableweapons() etc..

Problem with not disabling weapons is if you use a custom firing system, it will get all messed up.

Chandler 04-30-2007 07:55 AM

Shouldn't hitobjects destroy a bush?

zokemon 04-30-2007 12:34 PM

Quote:

Originally Posted by Chandler (Post 1304513)
Shouldn't hitobjects destroy a bush?

Nope :(

cbk1994 04-30-2007 01:31 PM

You could do something with checking the tiles, and then if there are the bush tiles, change them to the dead bush tiles, then have some npc change it back after like 15 seconds ....

Chompy 04-30-2007 02:37 PM

Quote:

Originally Posted by cbkbud (Post 1304399)
Problem with not disabling weapons is if you use a custom firing system, it will get all messed up.

No.

Quote:

Originally Posted by cbkbud (Post 1304556)
You could do something with checking the tiles, and then if there are the bush tiles, change them to the dead bush tiles, then have some npc change it back after like 15 seconds ....

Good luck (Serverside)


Best would be to make a own bush class, or when sword ani starts you change the ani in a 0.05 timeout loop?

zokemon 04-30-2007 02:39 PM

Quote:

Originally Posted by cbkbud (Post 1304556)
You could do something with checking the tiles, and then if there are the bush tiles, change them to the dead bush tiles, then have some npc change it back after like 15 seconds ....

That is a lot of work :(
You could I guess script it to do a putnpc2 when it kills the bush and after 15 seconds the putnpc2 would change the tiles back and then destroy() it self.

Chandler 04-30-2007 08:01 PM

Still... going through way too much just to destroy a bush if you ask me...

Riot 04-30-2007 08:06 PM

Quote:

Originally Posted by cbkbud (Post 1304556)
You could do something with checking the tiles, and then if there are the bush tiles, change them to the dead bush tiles, then have some npc change it back after like 15 seconds ....

If you remove a bush by changing the tiles the server should automatically change them back. It does on Delteria Dev.

cbk1994 05-01-2007 01:33 AM

Quote:

Originally Posted by Riot (Post 1304619)
If you remove a bush by changing the tiles the server should automatically change them back. It does on Delteria Dev.

I'm going to have to make this system anyway, or something like it, so I'll release it when it's done.

Edit: My level editor is busted, so can somebody please tell me the tiles[x,y] numbers for the dead bush?

Chandler 05-01-2007 08:08 AM

{
0x2A5,0x2A6,
0x2B5,0x2B6
}

or

677, 678,
693, 694

[Top left, to bottom right]

cbk1994 05-01-2007 10:50 PM

Quote:

Originally Posted by Chandler (Post 1304819)
{
0x2A5,0x2A6,
0x2B5,0x2B6
}

or

677, 678,
693, 694

[Top left, to bottom right]

Thanks Chandler, <3

I have the code finished basicly, I just need to get the tile changing to work (stubborn NPC-Server). Once I finish it, I'll add it to the Code Gallery.

Edit: Done
http://forums.graal2001.com/forums/s...38#post1304938


All times are GMT +2. The time now is 08:30 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.