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
  #6  
Old 11-26-2015, 04:09 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by cbk1994 View Post
You can't do point-triggers to clientside, though.
You can since V6, I have a lot of scripts which work as follows:

PHP Code:

function onUpdate(temp.val) {
  
this.attr[4] = int(timevar2);
  
this.attr[5] = temp.val;
  
triggeraction(this.1this.1"Update""");
}

//#CLIENTSIDE
function onCreated()
  
this.setshape(13232);

function 
onPlayerEnters()
  if (
this.updatetTime != this.attr[4])
    
this.onActionUpdate();

function 
onActionUpdate() {
  
this.updatetTime this.attr[4];
  echo(
"New value is " this.attr[5]);

Looking at -

Quote:
Originally Posted by Kirko View Post
PHP Code:
function onLayerChange(){
  
this.trigger("Update");
  
//this.chat = "test1";//this worked
  //this.layer = params[2];//can only be changed in clientside
  
this.triggeraction(this.x+.5,this.y+.5,"LayerChange2","");//doesnt work

this.triggeraction() won't work as it is not an NPC function, but a level function. Change it to one of just triggeraction(), level.triggeraction() or this.level.triggeraction(). The NPC needs a Clientside setshape() in order to receive the triggeraction as well.
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 06:31 PM.


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