Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Weapon Attr's Serverside to Clientside (https://forums.graalonline.com/forums/showthread.php?t=69163)

ZeroTrack 10-04-2006 08:41 PM

Weapon Attr's Serverside to Clientside
 
Umm shouldn't this work???

PHP Code:

function onActionserverside(){
  
returnval findnpc("temp1").test;
  
this.attr[1] = returnval;
}

//#CLIENTSIDE
function onCreated() { 
  
triggeraction(0,0,"serverside","Temp","");
  
checkReturn();
}

function 
checkReturn() player.chat findweapon("Temp").attr[1]; 


Even tried first to do this.attr[1] but it didn't read thats when i used findweapon... but i can read the attr serverside... This is supposed to work does it not?

KuJi 10-04-2006 09:06 PM

Quote:

Originally Posted by ZeroTrack (Post 1225925)
Umm shouldn't this work???

PHP Code:

function onActionserverside(){
  
returnval findnpc("temp1").test;
  
this.attr[1] = returnval;
}

//#CLIENTSIDE
function onCreated() { 
  
triggeraction(0,0,"serverside","Temp","");
  
checkReturn();
}

function 
checkReturn() player.chat findweapon("Temp").attr[1]; 


Even tried first to do this.attr[1] but it didn't read thats when i used findweapon... but i can read the attr serverside... This is supposed to work does it not?

I have never heard of weapons having attr's, but I am sure players do =o

ZeroTrack 10-04-2006 09:25 PM

Quote:

Originally Posted by KuJi (Post 1225936)
I have never heard of weapons having attr's, but I am sure players do =o

would be so much nicer if i could return values from triggers, cause i reallyyyy realllyyy dont want to have the sloppiness of client to server to client triggers for 1 string....

for now i suppose i'll use a player.attr unless anyone has a better CLEANER way of doing this

(For future improvements then...)
Err yeah come to think of it ... if they weapons have images and x,y positions, even though they are 0, they should have attributes

Chompy 10-04-2006 09:31 PM

would be nice if you could add attr's and strings to an weapon like you can with a dbnpc, like making a sword named "Swords/Test" in the weapon list
and in weapons list you could right click and it pops up a menu with like
"Edit Weapon/Gui Flags" and "Edit Weapon/Gui Script"
and double left click would default open the script

and a new button could appear like server flags but,
like an guitreeviewctrl like:

-Weapons
-Swords/Test
-weapon.name=Test Sword
-weapon.description=A mighty test sword.
-more weapons etc...

and you could like load the current weapon. strings in the current weapon/gui script, like in Swords/Test you could do like

temp.info = {weapon.name, weapon.description}; and it returned
temp.info = {"Test Sword", "A mighty test sword."};

^-- clientside, if the weapon. string doesn't exist,
it gives a error message in the rc window

Serverside you can do like
temp.stuff = findweapon("Swords/Test").loadVar(description); would return:
temp.stuff = "A mighty test sword." because it would look for weapon.description, and you can load the current weapon. strings of the current weapon serverside to, etc..

I just wrote this, I thought this would be a good idea or something,
I am thinking that I am writing this in the wrong thread/forum part
but I don't know if this is a good idea or not..

KuJi 10-04-2006 09:39 PM

PHP Code:

//#CLIENTSIDE
function onActionServerSide(action)
{
  switch (
action)
  {
    case 
"send":
    {
       
triggerclient("gui"this.name"return"150);
       break;
    }
  }
}

//#CLIENTSIDE
function onWeaponFired()
{
  
triggerserver("gui"this.name"send");
  
player.chat "SENT";
}

function 
onActionClientSide(action)
{
  switch (
action)
  {
    case 
"return":
    {
       
player.chat format("Recieved: %s"params[1]);
       break;
    }
  }


Like that?

ZeroTrack 10-04-2006 09:45 PM

*SMACK* Never!!! ew ... i'll never resort to that i entirely refuse.....

KuJi 10-04-2006 09:54 PM

Quote:

Originally Posted by ZeroTrack (Post 1225964)
*SMACK* Never!!! ew ... i'll never resort to that i entirely refuse.....

Then reserve a player attr or a clientr. string for such =o?

Chompy 10-04-2006 10:02 PM

would be funny to do like:

PHP Code:

function onActionServerside()
  return 
params[0];
//#CLIENTSIDE
function onCreated()
{
  
temp.info triggerserver("gui"name"blahblah");
  
player.chat temp.info;


or anything, I did try it before, my client crashed xd

ZeroTrack 10-05-2006 03:20 AM

LoL thats what i said =p i tried that first just to check lol my client didnt come close to crashing though lol

I just saved it to like the last player attr.... 29... but i would really like a better way to handle this and maybe , like cheetos brought up a good point, stefan should add lower level access like better socket support... would help A LOT

xAndrewx 10-05-2006 08:21 AM

HTML Code:

function onActionServerside()
{

}
//#CLIENTSIDE
triggerserver("weapon", this.name);


Chompy 10-05-2006 12:26 PM

Gotta try that! :p
 
I gotta try that :p
so my client don't get funny >_<
or weird, lol

ZeroTrack 10-05-2006 01:50 PM

Quote:

Originally Posted by xAndrewx (Post 1226235)
HTML Code:

function onActionServerside()
{

}
//#CLIENTSIDE
triggerserver("weapon", this.name);



Again not gonna do that ... lol don't want to have to client - server - client .... ew and i refuse

Chompy 10-05-2006 01:59 PM

hmm, would be cool too break through serverside from clientside and vice versa

liek:
PHP Code:

function bahOnServerside(textmorestuff)
  return (
text SPC more SPC stuff);
//#CLIENTSIDE
function onPlayerChats()
{
  if (
player.chat == "ommg")
  {
    
// text = 0  more = 1  stuff = 2              {     1    }  { 2 }  {  3  }
    
info getServersideFunction(bahOnServerside"parametres""lol""etc..");
    
player.chat info// would return "parametres lol etc..."
  
}


or something liek that

xAndrewx 10-05-2006 07:04 PM

Quote:

Originally Posted by Chompy (Post 1226273)
hmm, would be cool too break through serverside from clientside and vice versa

liek:
PHP Code:

function bahOnServerside(textmorestuff)
  return (
text SPC more SPC stuff);
//#CLIENTSIDE
function onPlayerChats()
{
  if (
player.chat == "ommg")
  {
    
// text = 0  more = 1  stuff = 2              {     1    }  { 2 }  {  3  }
    
info getServersideFunction(bahOnServerside"parametres""lol""etc..");
    
player.chat info// would return "parametres lol etc..."
  
}


or something liek that

yes it would o_O

Skyld 10-05-2006 07:09 PM

Quote:

Originally Posted by Chompy (Post 1226273)
hmm, would be cool too break through serverside from clientside and vice versa

Seems pointless when you can just organise your script so that it is not as badly affected by the serverside-clientside barrier.

Chompy 10-05-2006 09:23 PM

hm

ZeroTrack 10-06-2006 01:38 PM

Quote:

Originally Posted by Skyld (Post 1226358)
Seems pointless when you can just organise your script so that it is not as badly affected by the serverside-clientside barrier.

I would say pointless, i would say it would be a great add and would help anal retentive people , like me, feel better about the client server barrier

Chompy 10-06-2006 01:50 PM

I would say server-client side is like dark and light side..

well, would be more cool if you could decide if an command went serverside, like doing move on clientside, and show for all players and etc..
or doing play clientside and all players in the level could hear.. or something like that :o


All times are GMT +2. The time now is 01:11 AM.

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