Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-07-2007, 11:47 PM
bscharff bscharff is offline
Bloo
bscharff's Avatar
Join Date: Sep 2006
Location: San Antonio, Texas
Posts: 185
bscharff has a little shameless behaviour in the past
Send a message via AIM to bscharff Send a message via MSN to bscharff Send a message via Yahoo to bscharff
Control-NPC PM Responding

OK, I'm Making An Event System Similar To Era's, Without The GUI That Pops Up.
I Have The Weapon Finished and Working But I Just Need To Get The If Player PM The Server Saying "join" then it warps them to the level defined in serverr.event
I Have This:

if (pm){
if (strequals(#p(0),join)){
setlevel2 serverr.event[1],serverr.event[2],serverr.event[3];
}
}

I Have Also Tried

function onPM
if (params[0] == "join"){
setlevel2(serverr.event[1],serverr.event[2],serverr.event[3]);
}
}

Any Suggestions, Fixes, or Alternatives?
__________________
Trying to be nice now...
Reply With Quote
  #2  
Old 08-08-2007, 12:04 AM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
PHP Code:
function onPM(footext) {
  switch(
text) {
    case 
"join":
      
setlevel2(serverr.event[1], serverr.event[2], serverr.event[3]);
    break;
  }

__________________
Reply With Quote
  #3  
Old 08-08-2007, 12:41 AM
MegaSizzler MegaSizzler is offline
Registered User
Join Date: Jul 2004
Posts: 26
MegaSizzler is on a distinguished road
That doesn't work at all (I work on bscharff's server). We've tried many alterations, even made it as simple as:
NPC Code:

function onPM(foo, text) {
this.sendPM("HI!");
}


Nothing works, it just replies with the default "Hey I'm the NPC server and I control most of the NPC's". Any ideas?
__________________
Reply With Quote
  #4  
Old 08-08-2007, 12:48 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
And this is in the Control-NPC?
Reply With Quote
  #5  
Old 08-08-2007, 12:54 AM
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
function onPM no longer works since v5 was released.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #6  
Old 08-08-2007, 01:04 AM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by xXziroXx View Post
function onPM no longer works since v5 was released.
__________________
Reply With Quote
  #7  
Old 08-08-2007, 01:22 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by xXziroXx View Post
function onPM no longer works since v5 was released.
Zodiac seems to have it working. Try pm'ing it classtree. I doubt a new client release would effect the server
Reply With Quote
  #8  
Old 08-08-2007, 01:35 AM
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
That's odd. I know it stopped working on a lot of servers when v5 was released, you can even find several threads on the forum talking about it.

But yeah, it seems to be working on Zodiac..

PHP Code:
function onPM() {
  
sendPM("Thanks for PMing me!");

__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #9  
Old 08-08-2007, 04:51 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Quote:
Originally Posted by Chompy View Post
PHP Code:
function onPM(footext) {
  switch(
text) {
    case 
"join":
      
setlevel2(serverr.event[1], serverr.event[2], serverr.event[3]);
    break;
  }

What is foo?
__________________
Deep into the Darkness peering...
Reply With Quote
  #10  
Old 08-08-2007, 05:15 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
I think the player's account name, but in this case is not needed.
Reply With Quote
  #11  
Old 08-08-2007, 10:57 AM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by DustyPorViva View Post
I think the player's account name, but in this case is not needed.
yep
__________________
Reply With Quote
  #12  
Old 08-08-2007, 08:39 PM
bscharff bscharff is offline
Bloo
bscharff's Avatar
Join Date: Sep 2006
Location: San Antonio, Texas
Posts: 185
bscharff has a little shameless behaviour in the past
Send a message via AIM to bscharff Send a message via MSN to bscharff Send a message via Yahoo to bscharff
OK,
I Found out The Problem.
Since I Was Doing setlevel2 on it's own with no this. or player. it didn't know what to do.
So Mog put player.setlevel2(L,X,Y); it's works fine :P
Thanks Guys!
__________________
Trying to be nice now...
Reply With Quote
  #13  
Old 08-10-2007, 03:46 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Thought I'd nought, for onPM to be called, I'm pretty sure in the onCreated, or such function, you need setPM( NULL );
__________________
Reply With Quote
  #14  
Old 04-16-2008, 02:46 AM
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
Bump alert, but it might prevent similar threads in the future.

If you do NOT have setPM(""); in your Control-NPC, function onPM() will not be triggered.

So, if function onPM() doesn't work for ya, simply do setPM(""); in your Control-NPC's onCreated() function.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #15  
Old 04-16-2008, 05:47 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by xXziroXx View Post
Bump alert, but it might prevent similar threads in the future.

If you do NOT have setPM(""); in your Control-NPC, function onPM() will not be triggered.

So, if function onPM() doesn't work for ya, simply do setPM(""); in your Control-NPC's onCreated() function.
Why did we need to bump this?

I basically said put it in onCreated in the last post.
__________________
Reply With Quote
  #16  
Old 04-16-2008, 05:21 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
Quote:
Originally Posted by cbkbud View Post
Why did we need to bump this?

I basically said put it in onCreated in the last post.
I'm not known to read well or pay much of an attention at 4AM
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #17  
Old 04-16-2008, 07:49 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
setPM() in onCreated() doesn't help since onCreated() is not called on server restart (it will call onInitialized()). It's better to call setPM("") in onActionPlayerOnline.

The first line is the "advertising URL", not used for a long time but to stay compatible with scripts that expect to skip the first line it's still inserting an empty line.
Reply With Quote
  #18  
Old 05-16-2008, 03:22 AM
bscharff bscharff is offline
Bloo
bscharff's Avatar
Join Date: Sep 2006
Location: San Antonio, Texas
Posts: 185
bscharff has a little shameless behaviour in the past
Send a message via AIM to bscharff Send a message via MSN to bscharff Send a message via Yahoo to bscharff
Learn something new every day.
__________________
Trying to be nice now...
Reply With Quote
  #19  
Old 05-16-2008, 03:46 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by bscharff View Post
Learn something new every day.
Man, now you're back to bumping threads
__________________
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 09:59 AM.


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