-Andreas
Recruit
Hi,
I've been trying to find an event to subscribe to whenever a MobileParty is given a new goto order.
This includes the methods:
SetMoveGoToPoint(), SetMoveGoToSettlement(), SetMoveGoAroundParty(), SetMoveEscortParty(), SetMovePatrolAroundPoint(), SetMovePatrolAroundSettlement(), SetMoveRaidSettlement(), SetMoveBesiegeSettlement(), SetMoveDefendSettlement(), SetMoveGoAroundParty(), SetMoveEngageParty() and finally SetMoveModeHold().
The player and Ai logic is seperated, as the player is obviously giving his orders himself by clicking around on the map using a mouse. The Ai on the other hand, gets his next order based on some internal Ai logic. I've traced the goto calls for the player's MobileParty to the class MapScreen.cs from one of the native modules, SandBox. The MapScreen class is implementing the interface IMapStateHandler, that requires the BeforeTick() method. The implemented logic of BeforeTick() determines if some camera animation is playing, and if there's none, HandleMouse() inside MapScreen.cs is invoked. HandleMouse() will be responsible for figuring out what the player has actually clicked on the campaign map. This information is passed to HandleLeftMouseButtonClick(), that orders the player's MobileParty to either engage, goto settlement or point etc. based on the actual parameters passed.
This essentially means there's no events associated with moving MobileParty's around, as far as I can tell. Somewhat of a solution could be to include the Harmony library, and actually inject a bit of code to all of the methods mentioned above. But ... That doesn't provide the actual MobileParty in question, but only that some party were given a new order, not a handle to the party in question.
Does anyone have any suggestion as to listen to all of these methods for both the Ai parties as well as the player's party?
Any comment is appreciated at this point, thanks.
(You must excuse me if this is the wrong place for this. I consider this research, and not an actual modding question so having posted on the 'Modding Q&A board' limits any discussion on the subject)
/Andreas
I've been trying to find an event to subscribe to whenever a MobileParty is given a new goto order.
This includes the methods:
SetMoveGoToPoint(), SetMoveGoToSettlement(), SetMoveGoAroundParty(), SetMoveEscortParty(), SetMovePatrolAroundPoint(), SetMovePatrolAroundSettlement(), SetMoveRaidSettlement(), SetMoveBesiegeSettlement(), SetMoveDefendSettlement(), SetMoveGoAroundParty(), SetMoveEngageParty() and finally SetMoveModeHold().
The player and Ai logic is seperated, as the player is obviously giving his orders himself by clicking around on the map using a mouse. The Ai on the other hand, gets his next order based on some internal Ai logic. I've traced the goto calls for the player's MobileParty to the class MapScreen.cs from one of the native modules, SandBox. The MapScreen class is implementing the interface IMapStateHandler, that requires the BeforeTick() method. The implemented logic of BeforeTick() determines if some camera animation is playing, and if there's none, HandleMouse() inside MapScreen.cs is invoked. HandleMouse() will be responsible for figuring out what the player has actually clicked on the campaign map. This information is passed to HandleLeftMouseButtonClick(), that orders the player's MobileParty to either engage, goto settlement or point etc. based on the actual parameters passed.
This essentially means there's no events associated with moving MobileParty's around, as far as I can tell. Somewhat of a solution could be to include the Harmony library, and actually inject a bit of code to all of the methods mentioned above. But ... That doesn't provide the actual MobileParty in question, but only that some party were given a new order, not a handle to the party in question.
Does anyone have any suggestion as to listen to all of these methods for both the Ai parties as well as the player's party?
Any comment is appreciated at this point, thanks.
(You must excuse me if this is the wrong place for this. I consider this research, and not an actual modding question so having posted on the 'Modding Q&A board' limits any discussion on the subject)
/Andreas