View Single Post
  #1  
Old 12-28-2012, 05:48 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Move Script to stop

So I'm using FP4's movement script for npcs (http://forums.graalonline.com/forums...ad.php?t=85370)
and I'm trying to let the actions be interrupted so the npc will stop to chat and other stuff, w/o it being set in the actions and instead by onPlayerTouchsMe, I've added these to the level npc (remember fp4's stuff is also there, these are just additions, I believe the way I'm triggering is probably the problem):

PHP Code:
function onCreated()
{
  
level.npc.jaqor this;
}
// Function to stop the walk of the npc when chatting with a player
function onStopWalk()
{
  echo(
"trigger");
  
// save this.actions
  
this.actionsSaved this.actions;
  
this.actions = {
    
"wait: 9000"
  
};
  
this.savActPos this.actionpos;
  
doAction(0);
}

// Function to resume original actions
public function onResume()
{
  echo(
"resume");
  
this.actions this.actionsSaved;
  
doAction(this.savActPos);
}
//#CLIENTSIDE
function onPlayerTouchsMe()
{
  
this.trigger("StopWalk");
  
findweapon("-System/NPCDialog").loadDialog(this.headthis.speakerthis.msgthis.options);

The weapon calling at the bottom eventuall sends to this serverside trigger in the weapon (and yes it does reach it)

PHP Code:
function onActionServerside()
{
  if (
params[0] == "moveNPC")
  {
    
//echo("server");
    
level.npc.(@params[1]).trigger("Resume");
  }
}
//#CLIENTSIDE
function doesntReallyMatter()
{
  
triggerserver("gui"this.name"moveNPC"this.speaker);

It seems it's not getting to either trigger on the lv npc at all. if I echo on the wep trigger to server action it does get to that though...
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote