Graal Forums  

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

 
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 10-24-2001, 03:11 AM
Bravo_LAT-Admin Bravo_LAT-Admin is offline
Registered User
Join Date: Jun 2001
Location: banana
Posts: 165
Bravo_LAT-Admin will become famous soon enough
script question.

// NPC made by Pikaz (RC)

if (playerenters) {
this.berrycount=4;
drawunderplayer
}
if (playertouchsme) {
}

timeout=2;
if (timeout&&this.berrycount<4)
{
this.berrycount=this.berrycount+1;
if (this.berrycount=4)
{setimg bushred4.gif}
if (this.berrycount=3)
{setimg bushred3.gif}
if (this.berrycount=2)
{setimg bushred2.gif}
if (this.berrycount=1)
{setimg bushred1.gif}
if (this.berrycount=0)
{setimg bushred0.gif}
timeout=2;
}
if (actionberry&&this.berrycount>0) {
this.berrycount=this.berrycount-1;
if (this.berrycount=4)
{setimg bushred4.gif}
if (this.berrycount=3)
{setimg bushred3.gif}
if (this.berrycount=2)
{setimg bushred2.gif}
if (this.berrycount=1)
{setimg bushred1.gif}
if (this.berrycount=0)
{setimg bushred0.gif}
if (playerdir==0) { putleaps 0,playerx+0.5,playery-1; };
if (playerdir==1) { putleaps 0,playerx-2,playery+1; };
if (playerdir==2) { putleaps 0,playerx+0.5,playery+2.5; };
if (playerdir==3) { putleaps 0,playerx+3,playery+1; };
setstring client.berrycount,#v(strtofloat(#s(client.berrycou nt))+1);
}
//#CLIENTSIDE
if (created)
{
setgif bushred4.gif
}

i am having trouble getting this to work online. Any one have any tips. it doesn't seem to be performing the actionberry.
__________________

  #2  
Old 10-24-2001, 03:56 AM
ZORG1986 ZORG1986 is offline
Registered User
ZORG1986's Avatar
Join Date: Jul 2001
Location: England - Yes thats the small Island in Europe that Ownz you all.
Posts: 783
ZORG1986 is on a distinguished road
Send a message via ICQ to ZORG1986 Send a message via AIM to ZORG1986
Does it work offline?
because that
setstring client.berrycount,#v(strtofloat(#s(client.berrycou nt))+1);
Looks wrong on first glance.....
__________________


Zorg (Era Staff) - Contact : [email protected]
  #3  
Old 10-24-2001, 03:58 AM
Bravo_LAT-Admin Bravo_LAT-Admin is offline
Registered User
Join Date: Jun 2001
Location: banana
Posts: 165
Bravo_LAT-Admin will become famous soon enough
yep

yepperz works fine offline.
__________________

  #4  
Old 10-24-2001, 06:37 AM
KJS KJS is offline
The one, The only -
KJS's Avatar
Join Date: Apr 2001
Location: USA, Minnesota
Posts: 1,012
KJS is on a distinguished road
Send a message via AIM to KJS
#1 I dont think you can have putleaps, playerdir, playerx, playery server side I think they have to be clientside

#2 if (this.berrycount=0)

shouldn't it be

if (this.berrycount==0)

I am saying that for all the if thens
__________________
Thanks,
-KJL
  #5  
Old 10-24-2001, 07:02 AM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
Don't forget to add a semi-colon after ALL commands. And, I don't think timeout=2 should be out of a loop. If that npc gets activated before the 2 seconds are up, then it will reset the timeout to 2. Better put the timeout=2 in an if (playerenters) or in an if (created) clause.
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
  #6  
Old 10-24-2001, 07:07 AM
Bravo_LAT-Admin Bravo_LAT-Admin is offline
Registered User
Join Date: Jun 2001
Location: banana
Posts: 165
Bravo_LAT-Admin will become famous soon enough
// NPC made by Pikaz (RC)
if (created)
{
this.berrycount=4;
}
if (playerenters) {
this.berrycount=4;
drawunderplayer;
}
timeout=2;
if (timeout&&this.berrycount<4)
{
this.berrycount=this.berrycount+1;
timeout=2;
}
if (actionberry&&this.berrycount>0) {
this.berrycount=this.berrycount-1;
setstring client.berrycount,#v(strtofloat(#s(client.berrycou nt))+1);
}
//#CLIENTSIDE
if (actionberry&&this.berrycount>0)
{
if (playerdir==0) { putleaps 0,playerx+0.5,playery-1; };
if (playerdir==1) { putleaps 0,playerx-2,playery+1; };
if (playerdir==2) { putleaps 0,playerx+0.5,playery+2.5; };
if (playerdir==3) { putleaps 0,playerx+3,playery+1; };
}
timeout=2;
if (timeout)
{
if (this.berrycount==4)
{setimg bushred4.gif}
if (this.berrycount==3)
{setimg bushred3.gif}
if (this.berrycount==2)
{setimg bushred2.gif}
if (this.berrycount==1)
{setimg bushred1.gif}
if (this.berrycount==0)
{setimg bushred0.gif}
timeout=2;
}
if (created)
{
setgif bushred4.gif
}

ok here i switched it to this. now the image bushred0.gif keeps showing up even though i have it set as this.berrycount=4 at the begining. Also if hnage it to if (this.berrycount>-1) i get the leaps but this.berrycount doesn't subtract any or does the string add to it self.(of course as stated above this all does work offline)
__________________

  #7  
Old 10-24-2001, 10:30 PM
PresShinP2P PresShinP2P is offline
Registered User
Join Date: Oct 2001
Location: Screw it
Posts: 84
PresShinP2P is on a distinguished road
Send a message via AIM to PresShinP2P
needless to say you dont need strtofloat(#s(string)) only strtofloat(str)

methinks
__________________
President Shinra
  #8  
Old 10-25-2001, 06:19 AM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
Pikaz, just send me the script and I will fix it up for you. PM my board account with a zip of the level the script is in, and all the images you use for it.
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
 


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 09:58 PM.


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