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 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
 


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 03:09 AM.


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