Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 03-02-2003, 08:39 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 Torankusu

Example using your (melissa-whatever's) code:

NPC Code:

if (playertouchsme){
message Welcome to my room!;
sleep 3;
message Do you like punk?;
sleep 3;
if (playerchats && strequals(#c,yes)) {message Really? I LOVE punk!;
sleep 3;
message You got any liquor?;
sleep 3;
}
}


#c = chat, in case you didn't know.

strequals is really useful, as is strcontains and other things with "str" in them. I recommend looking them up and learning more about them. Check in newfeatures also. There are some pretty new commands there.
O.O, I don't think that would work.. >:P.
It would, accept you would have to say it EXACTLY on the 3rd second.

NPC Code:

if (playertouchsme) {
message Hi, whats up?;
sleep 1;
message Do you like punk?;
this.mode = 1; // Just pretend that this means 'if was talked to'
}

if (playerchats && strequals(#c,yes) && this.mode == 1) message Oh cool! Me too!;
// Noticed I added the && this.mode == 1.
// Thats to check if the NPC was talked to/touched

// Else if the player chats NO.. blah
else if (playerchats && strequals(#c,no) && this.mode == 1) message Ewww! I can't belive you don't like punk!;

__________________
Knuckles
"They say 60% of the time, it works everytime!"
Reply With Quote
 


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 02:56 AM.


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