Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   bush script (https://forums.graalonline.com/forums/showthread.php?t=17326)

taki 11-19-2001 05:10 AM

bush script
 
how to make the classic graal bush? i made two versions, one has a bug with the 'thow-through' attribute (kinda alternates after you touch it) and the other's "supposed" to work using the setshape2 command
NPC Code:

Bush #1:
if (created){
canbecarried;
this.bushx=x; this.bushy=y;
this.mode=1;
timereverywhere;
timeout=0.05;
}
if (timeout){
if (abs((x+.5)-(playerx+.5))<=1&&abs((playery+.5)-(y+.5))<=1) this.mode=1;
else this.mode=0;
if (this.mode==0){
dontblock;
drawunderplayer;
} else{
blockagain;
drawunderplayer;
}
timeout=0.05
}
if (washit||exploded||wasthrown){
putleaps 0,x,y;
if (!wasthrown){
bushlay=int(random(0,9));
if (bushlay==0){lay2 heart,x,y;}
if (bushlay==1){lay2 bombs,x,y;}
if (bushlay==2){lay2 greenrupee,x,y;}
if (bushlay==3){lay2 bluerupee,x,y;}
}
hide;
sleep 9;
x=this.bushx; y=this.bushy;
show;
}

==================================

Bush #2
if (created){
canbecarried;
this.bushx=x; this.bushy=y;
setshape2 2,2,{20,20,20,20};
}
if (washit||exploded||wasthrown){
putleaps 0,x,y;
if (!wasthrown){
bushlay=int(random(0,9));
if (bushlay==0){lay2 heart,x,y;}
if (bushlay==1){lay2 bombs,x,y;}
if (bushlay==2){lay2 greenrupee,x,y;}
if (bushlay==3){lay2 bluerupee,x,y;}
}
hide;
sleep 9;
x=this.bushx; y=this.bushy;
show;
}


DoragonKoden_RC6 11-19-2001 05:13 AM

Bushes are not external NPCs. They are built-in!

Just place bush tiles and viola, BUSH!

Faheria_GP2 11-19-2001 05:16 AM

lmao, we got a bright one here!

taki 11-19-2001 05:18 AM

of course i knew that :p

I mean to have things "added" to them (for quests and stuff, that's what the base bush script's for), it wouldn't work with just plain level tiles

taki 01-25-2002 05:14 AM

So.. is the setshape2 command working yet? :rolleyes:
or anyone got a way around this?

royce 01-25-2002 07:39 AM

Quote:

Originally posted by taki
So.. is the setshape2 command working yet? :rolleyes:
or anyone got a way around this?

I dont use setshape2 ever so :rolleyes: :rolleyes:

nyghtGT 01-25-2002 07:41 AM

Quote:

Originally posted by royce


I dont use setshape2 ever so :rolleyes: :rolleyes:

i've used it once for like a chair
and a house

TDO2000 01-25-2002 04:37 PM

Quote:

Originally posted by taki
So.. is the setshape2 command working yet? :rolleyes:
or anyone got a way around this?

for me it always worked...

Saga2001 01-26-2002 12:08 AM

it works, but your doing it wrong, cause...well i am tired. night, i'll post about how to fix your many problems when i get on tonite at 9:00 Mountain Time...lol


All times are GMT +2. The time now is 01:42 PM.

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