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 10-10-2007, 01:54 AM
TalonShriner TalonShriner is offline
Levelsmith
TalonShriner's Avatar
Join Date: Feb 2006
Posts: 138
TalonShriner is on a distinguished road
Send a message via AIM to TalonShriner
Clientr.PROBLEM

I'm trying to figure out how to script it so that when a player logs on for the first time on my server (or thier account is reset) their clientr script flag will be: clientr.mud_nation= Neutral

I am a newb scripter and have no idea how to do this, so please be as specific as possible. ^_^ Thanks
__________________
Shall our paths cross on the road to where ever us humans are racing to, and lets walk instead.
Reply With Quote
  #2  
Old 10-10-2007, 03:18 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
PHP Code:
function onActionPlayerOnline() {
  if (!
clientr.mud_nation) {
    
clientr.mud_nation "neutral";
  }

__________________
Reply With Quote
  #3  
Old 10-10-2007, 03:24 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
PHP Code:
function onActionServerSide() {
  
with (findplayer(params[0])) {
    
clientr.mud_nation "Neutral";
  }
}
//#CLIENTSIDE
function onPlayerEnters() {
  if (
clientr.mud_nation == NULL) {
    
triggerserver("gui",this.name,player.account);
  }

Add this into your main-system. This, when you log on, check if you "clientr.mud_nation" is null (has nothing in it). If it comes out true, then it triggers the server-side which will turn your "clientr.mud_nation" to "Neutral". If it comes false, you go about normally.
If that doesn't work then I think it's because of "function onPlayerEnters()" but I believe it should work.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #4  
Old 10-10-2007, 03:26 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by Googi View Post
PHP Code:
function onActionPlayerOnline() {
  if (!
clientr.mud_nation) {
    
clientr.mud_nation "neutral";
  }

1) he wants it as "Neutral".

2) Talon, if you want to use that, you'd need to add it into your NPC-Control.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #5  
Old 10-10-2007, 03:38 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Uhm...if your NPC server doesn't have an onActionPlayerOnline() function already, all you need to do is
PHP Code:
function onActionPlayerOnline() {
  if (
clientr.mud_nation == NULL)
    
clientr.mud_nation "Nuetral";

Generally most servers have a lot of actions that go into that function in the NPC server.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #6  
Old 10-10-2007, 04:19 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
We can't use !clientr.var as a condition?
__________________
Reply With Quote
  #7  
Old 10-10-2007, 04:27 AM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
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
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by Googi View Post
We can't use !clientr.var as a condition?
Yes, we can.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #8  
Old 10-10-2007, 05:14 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
Need me to log on and help ya?
__________________
Deep into the Darkness peering...
Reply With Quote
  #9  
Old 10-10-2007, 05:45 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Googi View Post
We can't use !clientr.var as a condition?
You can, but some scripters (including myself) like to use 'clientr.blah == null' when dealing with strings and '!clientr.blah' when dealing with booleans.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.

Last edited by napo_p2p; 10-10-2007 at 07:21 AM..
Reply With Quote
  #10  
Old 10-10-2007, 06:44 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
I thought clientr.mud_<varname> was reserved?
__________________
Reply With Quote
  #11  
Old 10-10-2007, 07:18 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 Inverness View Post
I thought clientr.mud_<varname> was reserved?
no
__________________
Deep into the Darkness peering...
Reply With Quote
  #12  
Old 10-10-2007, 07:32 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Switch View Post
PHP Code:
function onActionServerSide() {
  
with (findplayer(params[0])) {
    
clientr.mud_nation "Neutral";
  }
}
//#CLIENTSIDE
function onPlayerEnters() {
  if (
clientr.mud_nation == NULL) {
    
triggerserver("gui",this.name,player.account);
  }

Although your method works perfectly fine, that way isn't the best way to go about doing this.

There are a few problems I see right off the bat:
1) For this sort of situation, it is better to use the Control-NPC.
2) That way you have it set up isn't totally secure. (People could potentially reset the nation of other players). You do not need to pass player.account and have it find the player again serverside.
3) You only have to check for the condition when the weapon is created, and not every time a player enters a level.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #13  
Old 10-10-2007, 10:18 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
You don't have to put it in the Control-NPC (You can use onPlayerLogin from any WNPC) but if you use WNPCs, just know that the player doesn't have to have the npc for the function to be called. It's very annoying when there something being done to the player when he logs in and you can't find the reason in the control-npc.
__________________
Do it with a DON!
Reply With Quote
  #14  
Old 10-10-2007, 11:40 AM
Zanzel Zanzel is offline
<insert title here>
Zanzel's Avatar
Join Date: Dec 2006
Posts: 35
Zanzel is on a distinguished road
I'd take what zero said an leave.
__________________
  • N-Pulse / N-Pulse Reborn Scripter
  • Graal Kingdoms Player
  • N-Pulse Player
Reply With Quote
  #15  
Old 10-10-2007, 03:27 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Quote:
Originally Posted by zokemon View Post
You don't have to put it in the Control-NPC (You can use onPlayerLogin from any WNPC) but if you use WNPCs, just know that the player doesn't have to have the npc for the function to be called. It's very annoying when there something being done to the player when he logs in and you can't find the reason in the control-npc.
My Main MUD control works that way. The player doesn't have it, but it still does stuff to the player. ;o
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
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 02:19 AM.


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