Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-29-2006, 03:01 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
player's string problem

Ok, so, im trying to set another player's string to a value, but it wont work.


PHP Code:
with (findPlayer(this.target[1])) client.tradereq playero.id
this.target[1] equals the targets account name, so theres no problem there. What happens with this is that instead of setting the targets client.tradereq, it sets it on the current player.

PHP Code:
with (findPlayer(this.target[1])) player.chat "Trying to set your chat!"
That works perfectly fine, so theres no problem in accessing the player.. Ive had -alot- of player-to-player communication errors on Mythic, stuff that works on other servers wont work on there..

Any ideas about whats wrong?
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #2  
Old 12-29-2006, 03:08 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
findPlayer(this.target[1]).client.tradereq = player.id;
Reply With Quote
  #3  
Old 12-29-2006, 01:50 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
Normally also it is best to specify the object you are working with, i.e.
PHP Code:
with (findPlayer("Skyld"))
{
  
player.clientr.foo "bar";

__________________
Skyld
Reply With Quote
  #4  
Old 12-29-2006, 04:17 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 Yen View Post
findPlayer(this.target[1]).client.tradereq = player.id;
Didnt work.

Quote:
Originally Posted by Skyld View Post
Normally also it is best to specify the object you are working with, i.e.
PHP Code:
with (findPlayer("Skyld"))
{
  
player.clientr.foo "bar";

Didnt work.


I keep saying it, theres something wrong with the server.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #5  
Old 12-29-2006, 05:37 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 xXziroXx View Post
Didnt work.


I keep saying it, theres something wrong with the server.
How about using this.?
PHP Code:
with (findPlayer(foo))
{
  
this.clientr.bar baz;

__________________
Skyld
Reply With Quote
  #6  
Old 12-29-2006, 05:52 PM
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
I tried setting client flags on players remotely on his server. I've never tried this clientside but apparently it would work.

I did
PHP Code:
//#CLIENTSIDE
function onPlayerChats()
{
  if (
player.chat == "test")
  {
    
temp.findplayer("xXziroXx");
    
player.chat temp.e.client.testflag SPC temp.e.chat;
    
sleep(2);
    
temp.e.client.testflag "RawrTest";
    
player.chat temp.e.client.testflag SPC temp.e.chat;
  }

First time round my chat showed his chat then after 2 seconds i saw 'RawrTest' followed by his chat. When repeated, it showed 'RawrTest' in both phases.

Ziro couldn't read this clientflag that was set on him and when he reconnected it was gone. Kinda wierd

When i used serverside to set player.attr[5] though i could not read a client flag that was set through RC on him. I normally do this thing serverside but if it if supposed to work clientside that would be cool.
Reply With Quote
  #7  
Old 12-29-2006, 06:39 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
What? You're supposed to be able to work with client flags clientside.
Reply With Quote
  #8  
Old 12-29-2006, 06:40 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
You can't edit other players clientside, no matter if it are "client." flags.
__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
Reply With Quote
  #9  
Old 12-29-2006, 06:52 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by contiga View Post
You can't edit other players clientside, no matter if it are "client." flags.

I was talking about working with your own clientside. I would think it would be obvious that you can't edit other players clientside.
Reply With Quote
  #10  
Old 12-29-2006, 07:59 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 Gambet View Post
I was talking about working with your own clientside. I would think it would be obvious that you can't edit other players clientside.

Im pretty sure I have been able to set other clients cleitn. VARIABLE's clientsided in the past?
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #11  
Old 12-29-2006, 10:21 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by xXziroXx View Post
Im pretty sure I have been able to set other clients cleitn. VARIABLE's clientsided in the past?


You can try it and it wont work. Something like:

PHP Code:
//#CLIENTSIDE
function onPlayerChats() {
 if (
player.chat.starts("/test")) {
  
tokens player.chat.tokenize();
  
findplayer(tokens[1]).client.testvar tokens[2];
 }



It will only work if you set it to yourself, not anyone else.
Reply With Quote
  #12  
Old 12-30-2006, 03:49 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
This was the odd part Gambet. It saved my client string to the players object. I verified it was the same object as It showed the players chat as well. It may not have been stored as a client in the end but it was still there.
Reply With Quote
  #13  
Old 12-30-2006, 08:59 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by Twinny View Post
This was the odd part Gambet. It saved my client string to the players object. I verified it was the same object as It showed the players chat as well. It may not have been stored as a client in the end but it was still there.

Most likely just temporarily storing information for you to handle. None of it would be saved unless you sent the temporary information in a trigger over to the serverside to be set.
Reply With Quote
  #14  
Old 12-30-2006, 02:53 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 Gambet View Post
Most likely just temporarily storing information for you to handle. None of it would be saved unless you sent the temporary information in a trigger over to the serverside to be set.
Come to think about it, I never have been able to SET data for other clients clientsided, only ACCESS player attributes. Those temporary stored information strings blah blah must have confused me.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #15  
Old 01-08-2007, 10:07 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by xXziroXx View Post
Ok, so, im trying to set another player's string to a value, but it wont work.


PHP Code:
with (findPlayer(this.target[1])) client.tradereq playero.id
this.target[1] equals the targets account name, so theres no problem there. What happens with this is that instead of setting the targets client.tradereq, it sets it on the current player.

PHP Code:
with (findPlayer(this.target[1])) player.chat "Trying to set your chat!"
That works perfectly fine, so theres no problem in accessing the player.. Ive had -alot- of player-to-player communication errors on Mythic, stuff that works on other servers wont work on there..

Any ideas about whats wrong?
Bah. Just run it serverside.

PHP Code:
function onActionServerSide(cmd)
{

  switch(
cmd)
  {

    case 
"setchat":
    {
      
      
with(getplayer(params[1])) player.chat "Trying to set your chat!";

    break;
    
    }

  }

}

//#CLIENTSIDE
function onPlayerChats()
{

  if (
player.chat.starts("/find"))
  {

    
triggeraction(00"serverside"namesetchatplayer.chat.substring(6,-1));

  }


That should work
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 03:15 AM.


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