Server Totals
Elysia - (1)
Wilderness - (1)
Ferrell - (0)
Le'Or - (0)
M'Chek - (0)
Deglos - (0)
Visimontium - (0)
Underdark - (0)
Mikona - (0)
Total players: 2
Gallery

Links Menu

counting deaths

Moderators: Nighthawk4, Dungeon Masters

counting deaths

PostAuthor: apandapion » Wed Jun 22, 2005 5:57 am

I'd like to count creature deaths from encounters without modifying the creature themselves. Is there a good way to do this?

apandapion
Contributor
 
Posts: 1208
Joined: Fri Jan 14, 2005 6:10 pm

PostAuthor: fremen » Wed Jun 22, 2005 10:48 pm

Whenever a creature dies it speaks a silent string that you should be able to use GetListenPatternNumber(); function to retrieve. I'm not sure if this will work for what you want though, because as far as I know it would require an invisable creature and you can't determine the specific creature that died.

I believe the pattern number is 3, but you should check that yourself.

I'm also not positive on the range of this, I think one is ...SILENT_TALK and the other is ...SILENT_SHOUT. Either way the ListenPattern with the highest matching number is the only one that GetListenPatternNumber() will return.

fremen
Squire of Babble
 
Posts: 46
Joined: Fri Jul 02, 2004 6:53 pm

Re: counting deaths

PostAuthor: Aloro » Wed Jun 22, 2005 10:52 pm

apandapion wrote:I'd like to count creature deaths from encounters without modifying the creature themselves. Is there a good way to do this?


Not that I know of. We typically use the OnDeath event handler (note that UDE OnDeath events don't fire all the time, so you should not replace OnDeath handlers with UDEs).

- Aloro
Aleksandr Solzhenitsyn wrote:The meaning of earthly existence lies, not as we have grown used to thinking, in prosperity, but in the development of the soul.
User avatar
Aloro
Team Member; Retired with Honors
 
Posts: 12810
Joined: Sat Dec 28, 2002 5:11 am
Location: Rainbow's End

PostAuthor: Psyco » Wed Jun 22, 2005 11:19 pm

For what purpose?

If it is not actually going to be used ingame but instead is just going to be used for informational purposes to see what areas are being frequented then you can just parse the log file.

No need to modify any scripts IG.

If you actually plan on dynamically using that info IG, then the log file method is out unless you automate it and store the parse info in a database which is referenced in your ingame scripts.

Thats the only method I can think of that will involve no editing of current creatures or current scripts. I am not saying however that this is the best method.
Player Housing info - This answers most questions people have. Read this before asking.
User avatar
Psyco
Elder Sage
 
Posts: 3297
Joined: Mon Jun 30, 2003 10:05 pm
Location: New Zealand (NZDT, +12 GMT)

PostAuthor: apandapion » Wed Jun 22, 2005 11:27 pm

Psyco wrote:For what purpose?


I want to use the number of recent deaths of certain types of creatures to determine a global behavior.

apandapion
Contributor
 
Posts: 1208
Joined: Fri Jan 14, 2005 6:10 pm

PostAuthor: masterofchains » Sat Jul 02, 2005 6:27 pm

hey, I am working on a mini-game type deal, just a joke game, but this would come in handy with it. if anyone figures it out, let me know too, please.

oh...and only a hint on the mini-game..lots of penquins.. :twisted:
There is always something behind the madness.

masterofchains
Lord of Blithering Idiots
 
Posts: 111
Joined: Tue Jun 08, 2004 3:15 am
Location: Florida


Return to NWN Scripting

Who is online

Registered users: Bing [Bot], Google [Bot]