Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Getting Information Clientside (https://forums.graalonline.com/forums/showthread.php?t=64468)

projectigi 03-01-2006 11:08 AM

Getting Information Clientside
 
Ok now whats a good way to give information of a putnpc2 from serverside to clientside?
are save[]'s still limited to 255?
if so is there any other good way?

SilentOne1988 03-01-2006 12:04 PM

It'd be nice to be able to transfer information between client and server with classes.... You can probably store the npc's number and then have a triggeraction in the weapon that placed said class to clientside telling it to find x npc and set whatever you need to though.

ZeLpH_MyStiK 03-01-2006 12:33 PM

I do believe save[]'s are limited to integers greater than or equal to 0 and less than or equal to 220.

projectigi 03-01-2006 12:35 PM

how about just making onActionClientSide for localnpcs(putnpcs2/putnpcs)

ApothiX 03-01-2006 03:18 PM

PHP Code:

public function TransferToClientside(abc) {
  
client.classclientside_abc abc;
  
client.classclientside_transfer true;
}

//#CLIENTSIDE
function onCreated() {
  
setTimer(0.05);
}

function 
onTimeout() {
  if(
client.classclientside_transfer) {
    unset(
"client.classclientside_transfer");
    
player.chat client.classclientside_abc;
    unset(
"client.classclientside_abc");
  }

  
setTimer(0.05);


Probably not the best way to do it, but I think it works :P

I'm not sure if you can use npc.trigger() or npc.triggerclient() or something to trigger to clientside or not.

Ajira 03-01-2006 03:20 PM

Quote:

Originally Posted by ApothiX
I'm not sure if you can use npc.trigger() or npc.triggerclient() or something to trigger to clientside or not.

If I remember correctly, which I think I do, trigger()s are received on both the server and clientside. Trigger()ing the npc should work.

napo_p2p 03-02-2006 05:32 AM

Also, if you set this.attr values serverside, they can be read clientside (won't work vice versa though).

projectigi 03-02-2006 11:12 AM

yeah i used attr[20]
lol

jake13jake 03-03-2006 09:25 PM

yea, I wish I knew how triggerclient and triggerserver worked for this kindof NPC. I don't know if they'd work for regular NPCs, (but it would be a very very good idea.

Ajira 03-04-2006 12:44 AM

Quote:

Originally Posted by jake13jake
yea, I wish I knew how triggerclient and triggerserver worked for this kindof NPC. I don't know if they'd work for regular NPCs, (but it would be a very very good idea.

I know on Graal3D servers, triggerclient and server worked as triggerclient("npc", "npc name", "action", "params") and it is called with function onActionName(). I wish it worked the same on 2D.

jake13jake 03-04-2006 12:57 AM

Quote:

Originally Posted by Ajira
I know on Graal3D servers, triggerclient and server worked as triggerclient("npc", "npc name", "action", "params") and it is called with function onActionName(). I wish it worked the same on 2D.

waittt a second.
npc-->npc name? would that mean the first string is the type of object the action is pointing to? I'd rather just pass it any object.

Ajira 03-04-2006 01:05 AM

Quote:

Originally Posted by jake13jake
waittt a second.
npc-->npc name? would that mean the first string is the type of object the action is pointing to? I'd rather just pass it any object.

Yessir. That's how it is on 3D. On 2D you can just do obj.trigger("action", "params"); and it calls onAction(). I think that is better imo.


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

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