BL Coding Question on removing all parties

正在查看此主题的用户

-Andreas

Recruit
Hi,

Does anyone know if it's possible to remove all MobileParties found on the campaign? I know about MobileParty.All.GetEnumarator() to get a handle to all the parties, and thus call the MobileParty.RemoveParty() on each and everyone. They do get deleted, but as soon as I click anywhere on the map to move my own party around I get a null reference happening somewhere internally for the SandBox native module. So this leads me to think this might not be the right way to do it, but my goal is to have them all deleted and suppress them from spawning again to allow me to have full control over which parties are spawned at any given time.
Any suggestions?
 
New findings;
As I mentioned before simply calling RemoveParty() on each party instance would result in a null reference as soon as you unpause the time. I did however find the class DestroyPartyAction with the static method Apply(xParty,yParty) that will clean up a party properly as well as call the RemoveParty() when appropriate.
To achieve my goal simply grab all the mobileparties from MobileParty.All.GetEnumarator() and loop through them all and call Apply() method on each instance, thus deleting and removing everyone.

Many parties will respawn again, such as villages and looters as to what I've observed so far. I'm not sure on lords, caravans and so on.
 
点赞 0
后退
顶部 底部