troop_remove_gold and troop_remove_items, how to remove everything?

Users who are viewing this thread

With troop_remove_items and troop_remove_gold you can remove specific items or sums from the player, but how do you completely clear the inventory of all items with these functions?
Code:
(troop_remove_gold, "trp_player", 999999)
works for the money part, but that's a bit clumsy and ugly. I can't find any examples in the game code that accomplishes this, so I'm clueless.

Edit: Also, how do you edit the money and item loss from being captured by enemies? I've seen references to $g_player_surrenders in dialogs, but I have no idea where to locate and dissect that.
 
Last edited by a moderator:
I can't find any examples in the game code that accomplishes this, so I'm clueless.
Do not be helpless if you cannot find something in the code because no one did the same thing before you. store_troop_gold may be your friend (I do not remember anymore if it is a WSE-exclusive operation, probably yes though).
works for the money part, but that's a bit clumsy and ugly
If it works, it is fine.
how do you completely clear the inventory of all items with these functions?
troop_clear_inventory may be helpful (I do not remember anymore if it is a WSE-exclusive operation).
I have no idea where to locate and dissect that.
You have to dig deeper to find out; if you do not find anything, it probably is hardcoded.
 
Do not be helpless if you cannot find something in the code because no one did the same thing before you. store_troop_gold may be your friend (I do not remember anymore if it is a WSE-exclusive operation, probably yes though).

If it works, it is fine.

troop_clear_inventory may be helpful (I do not remember anymore if it is a WSE-exclusive operation).

You have to dig deeper to find out; if you do not find anything, it probably is hardcoded.
troop_clear_inventory worked, although it only clears the inventory itself, and does not remove equipped weapons, which is part of what I was after. Is there another way to accomplish that?

store_troop_gold seems to not be working, which is a shame, but as you said, if what I did previously does the job, I suppose it's fine.

As for the surrender thing, I guess I have to find a way around that. Thank you for your help.
 
Back
Top Bottom