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
  #7  
Old 08-04-2008, 06:58 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
hmm, use public functions i suppose and just name the weapon?
Here's an example with an inventory kind of system

Weapon Name 1
HTML Code:
function onCreated() {
  Swords = this;
}

public function onEquip() {
  //Do stuff
}
From another NPC
HTML Code:
function onEquip() {
  //Some-how find out it's a sword type of weapon you're equipping, generally by reading a string
  Swords.trigger("Equip", "");
  //Or you could do 
  Swords.onEquip();
  //However, if you didn't use that method, you'd use this 
  findWeapon("Weapon Name 1").onEquip(); //Or the trigger etc
}
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 09:13 PM.


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