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-04-2006, 08:41 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
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?
__________________

Reply With Quote
  #2  
Old 10-04-2006, 09:06 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by ZeroTrack View Post
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
Reply With Quote
  #3  
Old 10-04-2006, 09:25 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Quote:
Originally Posted by KuJi View Post
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
__________________


Last edited by ZeroTrack; 10-04-2006 at 09:37 PM..
Reply With Quote
  #4  
Old 10-04-2006, 09:31 PM
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
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..
__________________
Reply With Quote
  #5  
Old 10-04-2006, 09:39 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
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?
Reply With Quote
  #6  
Old 10-04-2006, 09:45 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
*SMACK* Never!!! ew ... i'll never resort to that i entirely refuse.....
__________________

Reply With Quote
  #7  
Old 10-04-2006, 09:54 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by ZeroTrack View Post
*SMACK* Never!!! ew ... i'll never resort to that i entirely refuse.....
Then reserve a player attr or a clientr. string for such =o?
Reply With Quote
  #8  
Old 10-04-2006, 10:02 PM
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
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
__________________
Reply With Quote
  #9  
Old 10-05-2006, 03:20 AM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
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
__________________

Reply With Quote
  #10  
Old 10-05-2006, 08:21 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
HTML Code:
function onActionServerside()
{

}
//#CLIENTSIDE
triggerserver("weapon", this.name);
__________________
Reply With Quote
  #11  
Old 10-05-2006, 12:26 PM
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
Gotta try that! :p

I gotta try that
so my client don't get funny
or weird, lol
__________________
Reply With Quote
  #12  
Old 10-05-2006, 01:50 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Quote:
Originally Posted by xAndrewx View Post
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
__________________

Reply With Quote
  #13  
Old 10-05-2006, 01:59 PM
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
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
__________________
Reply With Quote
  #14  
Old 10-05-2006, 07:04 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Quote:
Originally Posted by Chompy View Post
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
__________________
Reply With Quote
  #15  
Old 10-05-2006, 07:09 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 Chompy View Post
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.
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 10:13 PM.


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