Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-01-2006, 11:08 AM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
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?
Reply With Quote
  #2  
Old 03-01-2006, 12:04 PM
SilentOne1988 SilentOne1988 is offline
Banned
Join Date: Feb 2006
Posts: 67
SilentOne1988 is on a distinguished road
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.
Reply With Quote
  #3  
Old 03-01-2006, 12:33 PM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
I do believe save[]'s are limited to integers greater than or equal to 0 and less than or equal to 220.
__________________
Reply With Quote
  #4  
Old 03-01-2006, 12:35 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
how about just making onActionClientSide for localnpcs(putnpcs2/putnpcs)
Reply With Quote
  #5  
Old 03-01-2006, 03:18 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
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.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #6  
Old 03-01-2006, 03:20 PM
Ajira Ajira is offline
Poont.
Join Date: Oct 2004
Location: NY, USA
Posts: 477
Ajira is on a distinguished road
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.
__________________
Liek omigosh.

Reply With Quote
  #7  
Old 03-02-2006, 05:32 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Also, if you set this.attr values serverside, they can be read clientside (won't work vice versa though).
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #8  
Old 03-02-2006, 11:12 AM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
yeah i used attr[20]
lol
__________________
Reply With Quote
  #9  
Old 03-03-2006, 09:25 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
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.
Reply With Quote
  #10  
Old 03-04-2006, 12:44 AM
Ajira Ajira is offline
Poont.
Join Date: Oct 2004
Location: NY, USA
Posts: 477
Ajira is on a distinguished road
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.
__________________
Liek omigosh.

Reply With Quote
  #11  
Old 03-04-2006, 12:57 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
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.
Reply With Quote
  #12  
Old 03-04-2006, 01:05 AM
Ajira Ajira is offline
Poont.
Join Date: Oct 2004
Location: NY, USA
Posts: 477
Ajira is on a distinguished road
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.
__________________
Liek omigosh.

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 05:13 PM.


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