Chucl

Member
ServUO Version
Publish Unknown
Ultima Expansion
None
Then somewhere inside the mobile i add a string, everything works fine,

what i want to do is to each mobile has his own string history

If i spawn 2 mobiles they both share the same gump & strings, not sure if i explain myself good enough
 
Last edited:
It's because the list is in a static context, meaning it only exists once and everything that references it will be sharing the same list.
You need to store the History list on the PlayerMobile itself so each player has their own list, it cannot be defined as 'static'.

If you are logging speech, you don't actually need to code this custom, you can use the existing SpeechLog and SpeechLogGump


Another option, if you don't need the entire SpeechLog mechanic, is to replace List<string> with List<SpeechLogEntry> and just use SpeechLogEntry for this custom purpose.
Keep the static context in this case.

SpeechLogEntry will store all the info you need.
 
Ah, well the mobiles are BaseCreature so i just have to store it there i guess, thank you so much.

Btw is not logging speech, its a custom strings i wanted to add to a gump for each mobile then it can be loaded and check later.

I added the code i pasted, to BaseCreature and every BaseCreature shows the same gump history
 
Last edited:

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back