Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-23-2008, 10:59 AM
Raeiphon Raeiphon is offline
I never asked for this.
Join Date: Jun 2005
Posts: 855
Raeiphon is on a distinguished road
this.attr[#] not carrying across, triggerclient not working either

NPC Code:

function onCreated()
{
showcharacter();
this.target = findplayer(this.owner);
this.attr[2] = new[5][2];
setTimer(.3);
}
function onPlayerChats()
{
if (player.account == "raeiphon" && player.chat.starts("/destroy")) { this.destroy(); }
if (player.account == "raeiphon" && player.chat.starts("/show")) { this.chat = this.attr[2][0]; }
if (player.account == "raeiphon" && player.chat.starts("/halt")) { triggerclient(); }
}
function onTimeout()
{
if (this.attr[2].size() > 5) { this.attr[2] = this.attr[2].subarray(0,5); }
this.attr[2].insert(0, {this.target.x,this.target.y});
triggerclient(this.attr[2]);
setTimer(.05);
}
//#CLIENTSIDE
function onCreated()
{
//setTimer(.3);
}
function onTimeout()
{
this.x = this.attr[3][4][0];
this.y = this.attr[3][4][1];
setTimer(.3);
}
function onActionClientside(var)
{
this.attr[3] = var;
}




Originally this started out just setting this.attr[3] on the serverside, since I was told by Tig that it apparently carries across through clientside/serverside barriers and whatnot. That quickly turned out to be false, so I stuck a triggerclient in the timeout to simulate this being the case.

However, it doesn't work. Simply does not work. This.attr[3] is 0 always. Don't tell me that attrs can't hold arrays either, because they can - a echo on the variable on the serverside tells us this (see /show).

Any ideas?
__________________

I hope for nothing. I fear nothing. I am free.
Reply With Quote
 


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 01:01 PM.


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