Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Old Scripting Engine (GS1)
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-21-2006, 03:17 AM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
Help

How would I go about it so that if the player said something (eg. /help), the NPC Server sends a pre-set PM?
Reply With Quote
  #2  
Old 04-21-2006, 03:19 AM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
Check if the player says /help in a system weapon.
When it checks that they said /help, make it send a trigger to the serverside telling the NPC Server (or the system) to send the PM.
Reply With Quote
  #3  
Old 04-21-2006, 03:21 AM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
So in the system NPC -

NPC Code:
if (playerchats) {
if (strequals(#c,/help)) {
triggeraction 0,0,serverside,"NPC-Control",help;
}
}



And System NPC -

NPC Code:
if (actionserverside) {
if (strequals(#p(0),help)) {
sendpm Pre-defined PM;
}
}



EDIT: Replacing "NPC-Control" with the correct NPC name
Reply With Quote
  #4  
Old 04-21-2006, 02:07 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Or,

NPC Code:

function onPlayerChats()
{
if (player.chat == "/help") sendpm("All text here, HTML works!");
}



This is a serversided script.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #5  
Old 04-21-2006, 02:41 PM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
The more I see GS2 scripting, the more I hate it.

Heh. Thanks for your help
Reply With Quote
  #6  
Old 04-21-2006, 02:42 PM
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 Omini
The more I see GS2 scripting, the more I hate it.

Heh. Thanks for your help
I am not sure why - the new engine makes much more sense than the old one.
__________________
Skyld
Reply With Quote
  #7  
Old 04-21-2006, 03:00 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Same thing but in GS1 then:

NPC Code:

if (playerchats && strequals(#c,/help)) sendpm All text here, HTML works!;




GS1 sucks.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #8  
Old 04-21-2006, 03:46 PM
Raeiphon Raeiphon is offline
I never asked for this.
Join Date: Jun 2005
Posts: 855
Raeiphon is on a distinguished road
Why post for help in the gs2 forums then? =/
__________________

I hope for nothing. I fear nothing. I am free.
Reply With Quote
  #9  
Old 04-21-2006, 04:31 PM
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
Moved thread to the correct forum.
__________________
Skyld
Reply With Quote
  #10  
Old 04-21-2006, 04:41 PM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
Quote:
Originally Posted by xXziroXx
Same thing but in GS1 then:

NPC Code:

if (playerchats && strequals(#c,/help)) sendpm All text here, HTML works!;




GS1 sucks.
I tried that first and it didn't work, so I asked for help.

Quote:
Originally Posted by Skyld
I am not sure why - the new engine makes much more sense than the old one.
True, but I just get confused with all that stuff. Heh. Wait till Stefan makes a new scripting language in the future and call it GS3 - then I'll get the hang of GS2 (because I seem to be getting the hang of GS1... heh... perhaps a little GS2, but I don't really know).

Quote:
Originally Posted by Raeiphon
Why post for help in the gs2 forums then? =/
I posted it in the GS2 forum because my server is enabled for GS2, and I find that GS2 screws around with GS1 scripts sometimes.
Reply With Quote
  #11  
Old 04-21-2006, 06:38 PM
Raeiphon Raeiphon is offline
I never asked for this.
Join Date: Jun 2005
Posts: 855
Raeiphon is on a distinguished road
Alot of Developers still code in GS1, but I find GS2 to be far more efficent, and definately more fun to work with. It's also easier to read GS2 long, single lined statements, than GS2:

GS1 - if (playerchats && strequals(#c,/help)) sendpm All text here, HTML works!;
GS2 - if(player.chat=="/help") { sendpm("Blahstringblah"); }
__________________

I hope for nothing. I fear nothing. I am free.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 08:06 AM.


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