Thread: Global Trigger
View Single Post
  #4  
Old 12-02-2009, 12:41 AM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Quote:
Originally Posted by cbk1994 View Post
Unfortunately, no, though it would be very useful and would be a nice addition to the scripting language.

You can, however, do stuff like

PHP Code:
temp.importantDatabases = {(@ "Control-NPC"), DB_PlayerStatsDB_Bank};
temp.lists = {this.level.npcsplayer.weaponsimporantDatabases};

for (
temp. list : lists) {
  for (
temp.obj : list) {
    
obj.trigger("myFunction""...");
  }

for most cases
I'll probably whip something up. It'll be a bit more complex because I need it the object list to dependent on what ever is in the Weapons/NPCs lists, and update automatically when weapons are added and removed (for server triggers).

I could scan the weapons/* folder, but that'd be so insecure.

Another possibility is a global register of weapons and NPCs and that a requirement is to have a class joined to every created weapon/npc.

Either way isn't a totally ideal solution. I'll just experiment.
Reply With Quote