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-18-2014, 05:37 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Catching cross server guilds on login?

This might be confusing but..

Is it possible, for example for me to set my nickname to my global guild when I login. And catch that on a server that has global guilds disabled? I wan't to try and get the guild before it takes it away. The reason is this could be nice if servers with scripted guilds could automatically reconnect after a player reconnects or gets disconnected.

I was thinking maybe theres a GUI control that can catch the event already? Can't remember.
Reply With Quote
  #2  
Old 08-18-2014, 06:42 AM
shrimps shrimps is offline
Butterscotch Pudding
shrimps's Avatar
Join Date: Aug 2005
Location: Red Bank, Tennessee
Posts: 1,127
shrimps is a splendid one to beholdshrimps is a splendid one to beholdshrimps is a splendid one to beholdshrimps is a splendid one to behold
Ahh, for example if I'm on Zodiac with *shrimps (Steele) and I log into Kingdoms, I get to keep the *shrimps (Steele) with the Clan system on Kingdoms? Instead of having to put my tag back on?
Reply With Quote
  #3  
Old 08-18-2014, 03:11 PM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by shrimps View Post
Ahh, for example if I'm on Zodiac with *shrimps (Steele) and I log into Kingdoms, I get to keep the *shrimps (Steele) with the Clan system on Kingdoms? Instead of having to put my tag back on?
Or kingdom tag for example. Would be pretty cool. I only ask because I notice sometimes it takes a second before it removes my tag. So if theres a way to catch it that would be cool. Not sure if Nico would use it but other servers might.

Edit:

Apparently using onActionPlayerOnline() in the Control-NPC will works. But it could be confusing. I will explain.

PHP Code:
function onActionPlayerOnline(){
  echo(
"result:" SPC player.guild);

This is the code I used to test. I logged on my server and set my nick to Scriptless (Canavi) via script knowing it would remove my tag when I reconnected. When I reconnected the rc echo'd that nick and guild. So success. However, when I logged on GK and put my kingdom tag on then logged back onto my server it read my nickname as the last nickname used on my server. So anyone got any ideas on if it's possible to check what your last guild tag was while logging on a server before it gets removed?

Also, while I can read the variable to a client flag, I still cannot get it to automatically set the tag. Any ideas on that would be great.

Last edited by scriptless; 08-19-2014 at 07:45 AM..
Reply With Quote
  #4  
Old 08-21-2014, 02:45 AM
Restraint Restraint is offline
NaS
Join Date: Jan 2014
Posts: 21
Restraint will become famous soon enough
Did you try something like...

PHP Code:
function onPlayerLogout(pl) {
  
pl.clientr.lastGuild pl.guild;

combined with:

PHP Code:
function onPlayerLogin(pl) {
  
pl.guild pl.clientr.lastGuild;

If that doesn't work, try a simple delay on the onPlayerLogin, such as:

PHP Code:
function onPlayerLogin(pl) {
  
scheduleEvent("fixGuild"1pl);
}
function 
onFixGuild(pl) {
  
pl.guild pl.clientr.lastGuild;

Reply With Quote
  #5  
Old 08-22-2014, 03:50 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by Restraint View Post
Did you try something like...

PHP Code:
function onPlayerLogout(pl) {
  
pl.clientr.lastGuild pl.guild;

combined with:

PHP Code:
function onPlayerLogin(pl) {
  
pl.guild pl.clientr.lastGuild;

If that doesn't work, try a simple delay on the onPlayerLogin, such as:

PHP Code:
function onPlayerLogin(pl) {
  
scheduleEvent("fixGuild"1pl);
}
function 
onFixGuild(pl) {
  
pl.guild pl.clientr.lastGuild;

That would force a guild tag change when player logs on even if they want to use another tag. Which is a bad idea. This kinda worked. (Sorry didn't copy from my server tried typing it from memory)

Control-NPC
PHP Code:
function onActionPlayerOnline(){
  
player.clientr.lastguild player.guild;

WNPC
PHP Code:
function onPlayerNickChanges(obj){
  
obj.guild obj.clientr.lastguild;

Reply With Quote
  #6  
Old 08-22-2014, 05:03 PM
Restraint Restraint is offline
NaS
Join Date: Jan 2014
Posts: 21
Restraint will become famous soon enough
Ah okay. Didn't understand what you were trying to do.

So you want to always preserve the player's guild through nickname changes unless they set a new guild?

Then your function looks correct, minus giving players the ability to specify a new guild tag. What's wrong with it?
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:22 PM.


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