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 08-28-2003, 04:11 AM
killaxjw_p2p killaxjw_p2p is offline
Banned
Join Date: Aug 2003
Posts: 7
killaxjw_p2p is on a distinguished road
Need help

What am i doing wrong???im trying to make it if a restraunt member says /sub a sub will appear and the other player can touch the sub and it will dissapear.

NPC Code:

// Food Script created by ...
if(created){
setstring this.foodtype,sub; }

if(playerchats&&strequals(#c,/#s(this.foodtype))){
putnpc2 playerx+.5+vecx(playerdir)*2,playery+1+vecy(player dir)*2,{
if(created){
setimg sub.png;
}
if(playertouchsme){
playerhearts=playerfullhearts;
}
}
}

Reply With Quote
  #2  
Old 08-28-2003, 04:14 AM
protagonist protagonist is offline
Banned
protagonist's Avatar
Join Date: May 2003
Location: CAW
Posts: 5,586
protagonist is on a distinguished road
Send a message via AIM to protagonist Send a message via MSN to protagonist
Well, one obvious thing is that the player has to say /#s(this.foodtype) before the NPC even tries to put down an NPC.
Reply With Quote
  #3  
Old 08-28-2003, 04:19 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
It irritates me that nobody bothers trying to debug their work before they go running to the forums for help.
__________________
Reply With Quote
  #4  
Old 08-28-2003, 04:26 AM
Tseng Tseng is offline
Sublime
Tseng's Avatar
Join Date: Jan 2003
Location: California
Posts: 0
Tseng is on a distinguished road
Posting just what it does wrong would be beneficial. For example, does the NPC not lay down, or does it not disappear, or what?

(I obviously can see that you have no destroy; after the playerhearts=playerfullhearts;, but that's beside the point. It's the principle of the thing.)

Quote:
Originally posted by protagonist
Well, one obvious thing is that the player has to say /#s(this.foodtype) before the NPC even tries to put down an NPC.
I hope you are not saying that Graal does not interpolate the string before comparing the two, because it does.
__________________
Funny Things:
Quote:
Originally posted by Stefan
I didn't ban you, I only played a little bit with my RC.
-----
Reply With Quote
  #5  
Old 08-28-2003, 05:02 AM
protagonist protagonist is offline
Banned
protagonist's Avatar
Join Date: May 2003
Location: CAW
Posts: 5,586
protagonist is on a distinguished road
Send a message via AIM to protagonist Send a message via MSN to protagonist
Quote:
Originally posted by Tseng

I hope you are not saying that Graal does not interpolate the string before comparing the two, because it does.
I would assume that if it checks if the chat string equalled /#s(this.foodtype) then it would expect that exact text to be input.
Reply With Quote
  #6  
Old 08-28-2003, 05:05 AM
Tseng Tseng is offline
Sublime
Tseng's Avatar
Join Date: Jan 2003
Location: California
Posts: 0
Tseng is on a distinguished road
Quote:
Originally posted by protagonist


I would assume that if it checks if the chat string equalled /#s(this.foodtype) then it would expect that exact text to be input.
It interpolates it. Try it out for yourself if you do not believe me.

(Otherwise, how could it interpolate #c to your chat text? )
__________________
Funny Things:
Quote:
Originally posted by Stefan
I didn't ban you, I only played a little bit with my RC.
-----
Reply With Quote
  #7  
Old 08-28-2003, 06:17 AM
protagonist protagonist is offline
Banned
protagonist's Avatar
Join Date: May 2003
Location: CAW
Posts: 5,586
protagonist is on a distinguished road
Send a message via AIM to protagonist Send a message via MSN to protagonist
Quote:
Originally posted by Tseng


It interpolates it. Try it out for yourself if you do not believe me.

(Otherwise, how could it interpolate #c to your chat text? )
Ah I see.
Reply With Quote
  #8  
Old 08-28-2003, 01:12 PM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
missing a ; at the end of the second to the last line.. putnpc2 is still a command, don't hate because it uses { }'s ;D
__________________

Reply With Quote
  #9  
Old 08-28-2003, 01:30 PM
Knuckles Knuckles is offline
Registered User
Join Date: Sep 2002
Location: New York
Posts: 580
Knuckles is on a distinguished road
Send a message via AIM to Knuckles
Re: Need help

Quote:
Originally posted by killaxjw_p2p
What am i doing wrong???im trying to make it if a restraunt member says /sub a sub will appear and the other player can touch the sub and it will dissapear.

NPC Code:

// Food Script created by ...
if(created){
setstring this.foodtype,sub; }

if(playerchats&&strequals(#c,/#s(this.foodtype))){
putnpc2 playerx+.5+vecx(playerdir)*2,playery+1+vecy(player dir)*2,{
if(created){
setimg sub.png;
}
if(playertouchsme){
playerhearts=playerfullhearts;
}
}
}

putnpc2 doesnt work offline, if thats where you trying it.
Quote:
missing a ; at the end of the second to the last line.. putnpc2 is still a command, don't hate because it uses { }'s ;D
Yes, but thats not the reason why its not working.
__________________
Knuckles
"They say 60% of the time, it works everytime!"
Reply With Quote
  #10  
Old 08-28-2003, 01:33 PM
Knuckles Knuckles is offline
Registered User
Join Date: Sep 2002
Location: New York
Posts: 580
Knuckles is on a distinguished road
Send a message via AIM to Knuckles
Quote:
Originally posted by Kaimetsu
It irritates me that nobody bothers trying to debug their work before they go running to the forums for help.
That's because its not his work.
You can tell from his other post.
__________________
Knuckles
"They say 60% of the time, it works everytime!"
Reply With Quote
  #11  
Old 08-28-2003, 01:35 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by Knuckles

That's because its not his work.
You can tell from his other post.
I think you're probably right.
__________________
Reply With Quote
  #12  
Old 08-28-2003, 11:43 PM
killaxjw_p2p killaxjw_p2p is offline
Banned
Join Date: Aug 2003
Posts: 7
killaxjw_p2p is on a distinguished road
...Thanks for helping i got it to work...

Last edited by killaxjw_p2p; 08-29-2003 at 12:04 AM..
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 05:17 PM.


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