Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   How would I make a watering can thing? (https://forums.graalonline.com/forums/showthread.php?t=16421)

maximus_asinus 11-08-2001 03:36 PM

How would I make a watering can thing?
 
How would I go about making the watering can that I could make water plants/trees/NPCs? I want to make it for my server.I probably will use the gfx from g2k1 until I can make my own.
But please I need a bit of help over here.
(P.S. I actually tried math and made my timescript :)
I made some gfx for the bushes,they will shake where they get watered.
DANCE TREE,DANCE!

Python523 11-09-2001 01:15 PM

Triggeraction and ganis

KJS 11-09-2001 08:33 PM

humm try this

NPC Code:
if(weaponfired){
this.checkx = playerx + 1.5 + vecx(playerdir) * 2;
this.checky = playery + 1.5 + vecy(playerdir) * 2;
if(onwater(this.checkx,this.checky)){
setplayerani watercanfill,;
setstring client.water_sprays,4;
freezeplayer 2.5;
}elseif(strequals(#s(client.water_sprays),0)){
setplayerani watercan,;
freezeplayer 2.5;
}else{
triggeraction client.checkx,client.checky,water_sprays,;
setplayerani watercanspread,;
setstring client.water_sprays,#s(client.water_sprays)-1;
freezeplayer 1.4;
}
}



I haven't tested it or anything I just wrote it off the top of my head so there might be a few small bugs

Poogle 11-09-2001 08:40 PM

Quote:

Originally posted by KJS
humm try this

NPC Code:
if(weaponfired){
this.checkx = playerx + 1.5 + vecx(playerdir) * 2;
this.checky = playery + 1.5 + vecy(playerdir) * 2;
if(onwater(this.checkx,this.checky)){
setplayerani watercanfill,;
setstring client.water_sprays,4;
freezeplayer 2.5;
}elseif(strequals(#s(client.water_sprays),0)){
setplayerani watercan,;
freezeplayer 2.5;
}else{
triggeraction client.checkx,client.checky,water_sprays,;
setplayerani watercanspread,;
setstring client.water_sprays,#s(client.water_sprays)-1;
freezeplayer 1.4;
}
}



I haven't tested it or anything I just wrote it off the top of my head so there might be a few small bugs

Sorry but setplayerani dont work and it doesnt get empty when used.

KJS 11-09-2001 08:52 PM

NPC Code:
if(weaponfired){
this.checkx=playerx+1.5+vecx(playerdir)*2;
this.checky=playery+1.5+vecy(playerdir)*2;
if(onwater(this.checkx,this.checky)){
setani watercanfill,;
setstring client.water_sprays,4;
freezeplayer 2.5;
}elseif(strequals(#v(#s(client.water_sprays)),0)){
setani watercan,;
freezeplayer .5;
}else{
triggeraction client.checkx,client.checky,water_sprays,;
setani watercanspread,;
setstring client.water_sprays,#v(#s(client.water_sprays)-1);
freezeplayer 1.4;
}
}



there fixed...
well I can sure tell I am tired lol I forget commands lol

I said setplayerani insted of setani lol

maximus_asinus 11-10-2001 02:29 AM

Thankies!
 
I made a watering can but thi one is probably way better.Next time you might wanna leave a space between the else and strequals :)
Now I gotta make the seeds so when I through them on a hole the tree will appear.(I made the tree already)

TDO2000 11-10-2001 02:47 AM

use triggeractions then there is also an extra: 50% more scripting power ;D

no I think triggeraction should be an easy way to do this =)

maximus_asinus 11-10-2001 02:53 AM

This was a very helpful fprum :) I give it a thumbs up!
But since I am not to fimiliar with tiles how would I make the triggeraction occur when the tile is one of the holes?:)

Poogle 11-10-2001 06:07 AM

Quote:

Originally posted by KJS
NPC Code:
if(weaponfired){
this.checkx=playerx+1.5+vecx(playerdir)*2;
this.checky=playery+1.5+vecy(playerdir)*2;
if(onwater(this.checkx,this.checky)){
setani watercanfill,;
setstring client.water_sprays,4;
freezeplayer 2.5;
}elseif(strequals(#v(#s(client.water_sprays)),0)){
setani watercan,;
freezeplayer .5;
}else{
triggeraction client.checkx,client.checky,water_sprays,;
setani watercanspread,;
setstring client.water_sprays,#v(#s(client.water_sprays)-1);
freezeplayer 1.4;
}
}



there fixed...
well I can sure tell I am tired lol I forget commands lol

I said setplayerani insted of setani lol

Now you got it =)

nyghtGT 11-10-2001 06:18 AM

Quote:

Originally posted by Poogle

Now you got it =)

i have no idea who you are but you sure as hell are annoying ....

Xaviar 11-10-2001 06:30 AM

Quote:

Originally posted by nyghtGT

i have no idea who you are but you sure as hell are annoying ....

Indeed he is..But you are too ;)

Brad_Elven 11-10-2001 07:43 AM

Quote:

Originally posted by Xaviar


Indeed he is..But you are too ;)

poogle is but nyght is cool

nyghtGT 11-10-2001 07:51 AM

Quote:

Originally posted by Brad_Elven


poogle is but nyght is cool

lord helmut ownz j00 Xaviar !

Brad_Elven 11-10-2001 07:57 AM

Quote:

Originally posted by nyghtGT

lord helmut ownz j00 Xaviar !

Xaviar is cool too :)

nyghtGT 11-10-2001 08:04 AM

Quote:

Originally posted by Xaviar


Indeed he is..But you are too ;)

...


All times are GMT +2. The time now is 05:51 PM.

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