Ok so I am working on a messenger system for a PW...great and dandy...
My major issue though seems to be how to generate a unique name and then call the proper one later.
The best I can describe it is here with pseudo code since it spans multiple scripts
Script 1
On Activate Messenger Whistle
Generate Messenger ID+1 (number is a simple database value that goes up +1 each time its called)
Set Messenger Entrance (location of nearest map entrance...set as a local value)
Spawn Messenger
Set Messenger ID
Initiate Conversation at PC location (run to from spawn location)
Script 2a, 2b, 2c (give items, leave happy, leave upset)
2a: OnOpen
Put items in bag (3 or less and less than 15 pounds)
2a: OnClose
Tell Messenger to grab bag contents (ExecuteScript(....))
2b: Leave happy (end all scripts)
Get Messenger spawn location from script 1 (run to)
Destroy after 10 seconds
2c:
Get Messenger Spawn location from script 1 (walk to)
Destroy after 10 seconds
Script 3
Store Messenger and inventory in case of crash
Script 4
Call messenger at delivery target PCs location and give them package
now the issue is that every time a PC calls a messenger the messenger ID goes up by one...how in the world do I allow for multiple NPCs to be spawned and refer back to their proper ID without getting mixed up with other messengers that get spawned after them and change the database variables?
Any help would be appreciated!