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 08-28-2011, 10:47 PM
Astram Astram is offline
Era iPhone PR
Astram's Avatar
Join Date: Aug 2010
Posts: 324
Astram can only hope to improve
Send a message via AIM to Astram
NPC Help

I know this is a horrible question for me, since I have been scripting for a little while now, but I just noticed I've never noticed how to transfer data from serverside to clientside in level npcs.
__________________
-Toad
The worlds biggest Toad fan...
Era iPhone FTW!


Reply With Quote
  #2  
Old 08-28-2011, 10:52 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
What/How kind/much data are you trying to send the client-side?

You can easily use attributes to make strings of data available on the client-side. I.e:

PHP Code:
function onCreated() {
  
this.attr[2] = "Hello world!";
}

//#CLIENTSIDE

function onPlayerEnters() {
  
this.chat this.attr[2]; // NPC will chat "Hello World!"

You may encounter issues if your setting data that is longer than 200 characters, but that's still a fair chunk available and there's still 30 (or 31?) attributes available.

If you need something more complicated you'll need to triggerclient to a weapon, and set it in the NPC.
__________________
Quote:
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 06:44 AM.


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