Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-26-2001, 03:17 PM
SkooL SkooL is offline
somebody to love
Join Date: Jun 2001
Location: bat country.
Posts: 3,446
SkooL is on a distinguished road
Send a message via AIM to SkooL
Unhappy Rain

I am trying to script rain. Here is what I used for one drop:
NPC Code:
if (created) {
setbackpal dusk7.png;
putnpc rainimage.gif,rain.txt,this.x = (random(0,64)),this.y = (random(0,64));
timeout=0.05;
}
if (timeout) {
putnpc rainimage.gif,rain.txt,this.x = (random(0,64)),this.y = (random(0,64));
timeout=0.05;
}



In rain.txt I have:
NPC Code:
if (created) {
sleep 0.05;
destroy;
}



I paste the NPC a couple times and the NPC is always on the coordinate (1,1). How can I fix this?
__________________
the sky is falling
Reply With Quote
  #2  
Old 06-26-2001, 04:06 PM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
NO NO NO NO!!!!!


if (created) {
setbackpal dusk7.png;
timeout=0.05;
}
if (timeout) {
this.x = (random(0,64));
this.y = (random(0,64));
putnpc rainimage.gif,rain.txt,this.x,this.y;
timeout=0.05;
}
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #3  
Old 06-26-2001, 04:21 PM
SkooL SkooL is offline
somebody to love
Join Date: Jun 2001
Location: bat country.
Posts: 3,446
SkooL is on a distinguished road
Send a message via AIM to SkooL
Ok, it works, but lags to hell. Does anyone have a different way of doing it?
__________________
the sky is falling
Reply With Quote
  #4  
Old 06-26-2001, 04:59 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Hmm...
NPC Code:
if (created) {
this.maxdrops=30;
setarray this.rainloc,this.maxdrops*2;
setarray this.rainstep,this.maxdrops;
setarray this.raintime,this.maxdrops;
for (this.i=0;this.i<this.maxdrops;this.i++) this.raintime=random(0,2);
}
if (playerenters||timeout) {
if (IsRaining) {
setbackpal dusk7.png;
for (this.i=0;this.i<this.maxdrops;this.i++) {
if (this.rainstep[this.i]==4) {
this.raintime[this.i]=random(0,2);
this.rainstep[this.i]=0;
}
if (this.raintime[this.i]<=0) {
if (this.rainstep[this.i]==0) {
this.rainloc[this.i*2]=random(0,64);
this.rainloc[this.i*2+1]=random(0,64);
this.rainstep[this.i]=1;
}
showimg this.i,splash#v(this.rainstep).gif,this.rainloc[this.i*2],this.rainloc[this.i*2+1];
changeimgvis this.i,0;
this.rainstop[this.i++];
}
else this.raintime[this.i]-=0.05;
}
}
timeout=0.05;
timereverywhere;
}

And now I want both of you to swear never to use putnpc again, thanks.
__________________

Reply With Quote
  #5  
Old 06-26-2001, 05:21 PM
SkooL SkooL is offline
somebody to love
Join Date: Jun 2001
Location: bat country.
Posts: 3,446
SkooL is on a distinguished road
Send a message via AIM to SkooL
Thanks, but it doesn't work =\
I set the flag IsRaining and went into the level, the backpal sets, but there isn't any rain =\
__________________
the sky is falling
Reply With Quote
  #6  
Old 06-26-2001, 06:53 PM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
*AlphaFlame*
Hrmm... I just usually use something like this for rain... (it's 8 a.m., I've been up for 15+ hours, I'll give a better script later :P, so shuddup :P)

if (israin){
timeout=.05;
this.dripy=(how many drops you want at any 1 time);
}
if (timeout){
for (this.i=0;this.i<this.dripy;this.i++) {
showimg this.i,(the rain gif),random(0,64),random(0,64);
}
if (this.i=this.dripy) this.i=0;
}


__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)

Last edited by entravial; 06-26-2001 at 07:02 PM..
Reply With Quote
  #7  
Old 06-26-2001, 07:13 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Quote:
Originally posted by SkooL
Thanks, but it doesn't work =\
I set the flag IsRaining and went into the level, the backpal sets, but there isn't any rain =\
I probably made a mistake, that often happens when I post scripts which I haven't tested and just typed in here.
__________________

Reply With Quote
  #8  
Old 06-27-2001, 02:31 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Quote:
Originally posted by Kaimetsu
Must... use... indexes>200...
I know, this was in the case of it being an NPC in the level.
__________________

Reply With Quote
  #9  
Old 06-27-2001, 02:54 PM
Marco2002 Marco2002 is offline
Registered User
Join Date: Jun 2001
Location: Germany
Posts: 77
Marco2002 is on a distinguished road
Send a message via ICQ to Marco2002
perhaps he just doesn't have the images splash1-x.gif
__________________
Reply With Quote
  #10  
Old 06-27-2001, 02:59 PM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
no i told him how to make it random and he put it in the wrong place
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #11  
Old 06-27-2001, 06:09 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Quote:
Originally posted by Kaimetsu


Still... >200... and timereverywhere.
And I forgot to mention that it was because I didn't script it in Graal, I always make such stupid mistakes when I do that.
__________________

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:05 AM.


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