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 11-05-2005, 08:55 PM
SyLaTAC SyLaTAC is offline
<3
Join Date: Mar 2005
Location: Irwin Idaho (look it up you wont find it that easy!)
Posts: 64
SyLaTAC is on a distinguished road
Send a message via AIM to SyLaTAC
making a shop

ok im making a pizza shop and i need to figure out how to make an item that will work online all i have for it like all that i know is

NPC Code:
if (playerchats && strequals(#c,buy single)) {
if (playerrupees <=7) {
message you dont have enough money;
}
if (playerrupees >=7){
message Thank you!;
}


} {



thats all i have because i cant figure out how to make it
1) an item that does stuff
2) go into your inventory and take gralats away

will someone help me please?
Reply With Quote
  #2  
Old 11-05-2005, 09:16 PM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
read commands.rtf and npcprogramming.doc
plus use else as opposed to 2 if-statements
__________________
Reply With Quote
  #3  
Old 11-05-2005, 09:18 PM
SyLaTAC SyLaTAC is offline
<3
Join Date: Mar 2005
Location: Irwin Idaho (look it up you wont find it that easy!)
Posts: 64
SyLaTAC is on a distinguished road
Send a message via AIM to SyLaTAC
how do i use an else statement?
Reply With Quote
  #4  
Old 11-05-2005, 09:30 PM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
NPC Code:

if ( boolean ) { // your everyday if-statement
// if the boolean is true, do stuff here
} else {
// if the boolean is not true, do stuff here
}

__________________
Reply With Quote
  #5  
Old 11-05-2005, 09:43 PM
SyLaTAC SyLaTAC is offline
<3
Join Date: Mar 2005
Location: Irwin Idaho (look it up you wont find it that easy!)
Posts: 64
SyLaTAC is on a distinguished road
Send a message via AIM to SyLaTAC
ahh ok thx
Reply With Quote
  #6  
Old 11-05-2005, 10:04 PM
SyLaTAC SyLaTAC is offline
<3
Join Date: Mar 2005
Location: Irwin Idaho (look it up you wont find it that easy!)
Posts: 64
SyLaTAC is on a distinguished road
Send a message via AIM to SyLaTAC
i cant figure out how to make it take rupees =(
Reply With Quote
  #7  
Old 11-05-2005, 10:18 PM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
You want to change the variable:

playerrupees = playerrupees - 7;

or

playerrupees -= 7;
Reply With Quote
  #8  
Old 11-05-2005, 10:20 PM
SyLaTAC SyLaTAC is offline
<3
Join Date: Mar 2005
Location: Irwin Idaho (look it up you wont find it that easy!)
Posts: 64
SyLaTAC is on a distinguished road
Send a message via AIM to SyLaTAC
thx! alot
Reply With Quote
  #9  
Old 11-05-2005, 10:56 PM
SyLaTAC SyLaTAC is offline
<3
Join Date: Mar 2005
Location: Irwin Idaho (look it up you wont find it that easy!)
Posts: 64
SyLaTAC is on a distinguished road
Send a message via AIM to SyLaTAC
ok uhm i need to make a weapon that heals you and then dissapears how would i do that?

NPC Code:
If (weaponfired) {playerhearts =playerhearts +1}


then what?

and how do i make it add a weapon to your inventory because i put the weapon in RC named it the same but when i buy it it doesnt add it X.x
Reply With Quote
  #10  
Old 11-06-2005, 01:03 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
NPC Code:
destroy;



*I sense another excaliber*
__________________
Reply With Quote
  #11  
Old 11-06-2005, 01:06 AM
haunter haunter is offline
Registered User
haunter's Avatar
Join Date: Mar 2001
Posts: 7,989
haunter is on a distinguished road
Perhaps you should've learned a bit about scripting, and the other development areas in Graal before going ahead and wasting a hundred bucks on a server?
Reply With Quote
  #12  
Old 11-06-2005, 01:25 AM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Quote:
Originally Posted by SyLaTAC
ok uhm i need to make a weapon that heals you and then dissapears how would i do that?

NPC Code:
If (weaponfired) {playerhearts =playerhearts +1}


then what?

and how do i make it add a weapon to your inventory because i put the weapon in RC named it the same but when i buy it it doesnt add it X.x
I answered this question for you in one of your other threads
Quote:
Originally Posted by ZeLpH_MyStiK
*I sense another excaliber*

Oh common, i am SO not that bad. At least you can't fond the answers to my problems in the little box at the side of every NPC done offline
Reply With Quote
  #13  
Old 11-06-2005, 01:46 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Quote:
Originally Posted by excaliber7388
Oh common, i am SO not that bad. At least you can't fond the answers to my problems in the little box at the side of every NPC done offline
Nope, what you need is the little box of logic =D
__________________
Reply With Quote
  #14  
Old 11-06-2005, 01:57 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by excaliber7388

Oh common, i am SO not that bad. At least you can't fond the answers to my problems in the little box at the side of every NPC done offline
What you need is a box of sense.
Reply With Quote
  #15  
Old 11-06-2005, 02:09 AM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
It might be worth tutoring him in the basics of GS2, because I dread to see that much money go to total waste, like I've seen before.

I doubt it'd take much effort, heck, I could do it.
Reply With Quote
  #16  
Old 11-06-2005, 02:30 AM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Talking

Quote:
Originally Posted by Skyld
What you need is a box of sense.
;*( stop picking on me! waaaaah
Reply With Quote
  #17  
Old 11-07-2005, 08:00 PM
SyLaTAC SyLaTAC is offline
<3
Join Date: Mar 2005
Location: Irwin Idaho (look it up you wont find it that easy!)
Posts: 64
SyLaTAC is on a distinguished road
Send a message via AIM to SyLaTAC
X.x i didnt bu a server im a dev on another server...im not that stupid, i mean i pretty ggod at levels,graphics, and gani's , its just the scipting im litte rusty on so rather than diss on me it would be nicer if you helped me or directed me in the right direction..thats all i asked for, and thats kinda what this forum is for so please dont chastise me for no apparent reason....thanks....and codien thanks alot man i could really use yuor help in some things so yeah ill get ahold of jo0.
Reply With Quote
  #18  
Old 11-09-2005, 08:53 AM
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 SyLaTAC
ok im making a pizza shop and i need to figure out how to make an item that will work online all i have for it like all that i know is

NPC Code:
if (playerchats && strequals(#c,buy single)) {
if (playerrupees <=7) {
message you dont have enough money;
}
if (playerrupees >=7){
message Thank you!;
}


} {



thats all i have because i cant figure out how to make it
1) an item that does stuff
2) go into your inventory and take gralats away

will someone help me please?
Basically what you're saying is, if the player rupees is 7, then it will do both functions. In this case, it will do the latest function in the script. However this isn't exactly correct. Be sure to use one or the other.

Think about what you did:
playerrupees >= 7 (less then OR EQUAL to seven) "not enough money"
playerrupees <= 7 (greater then OR EQUAL to seven) "sold"

How could it be both?

Just for future reference when you get to more complex scripting. I think you should get into a habbit to doing this correctly so that they always work out right.
__________________
Knuckles
"They say 60% of the time, it works everytime!"
Reply With Quote
  #19  
Old 11-12-2005, 06:00 PM
prozac424242 prozac424242 is offline
Registered User
prozac424242's Avatar
Join Date: May 2001
Location: Gone crazy: back soon
Posts: 356
prozac424242 is on a distinguished road
Send a message via ICQ to prozac424242 Send a message via AIM to prozac424242
If you are making this for an online server,
you will need to make the playerhearts and rupees
adjustments happen serverside.
Hint: use a triggeraction on the npc
__________________

Useful links:
Graal Stats
Client Script Functions-GS1 to GS2
Serverside Script Functions-Gscript page
Particle Engine-Player Attributes
Server Options-Admin rights-Gmaps
Quote:
Originally Posted by Admins
Thanks for developing and improving playerworlds and such
Reply With Quote
  #20  
Old 11-12-2005, 07:25 PM
Riot Riot is offline
Delteria Management
Join Date: Nov 2003
Location: Seminole County, Florida
Posts: 280
Riot is on a distinguished road
Quote:
Originally Posted by prozac424242
If you are making this for an online server,
you will need to make the playerhearts and rupees
adjustments happen serverside.
Hint: use a triggeraction on the npc
or you can just do all of this serverside and not have any of it clientside.
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:56 PM.


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