BL Coding Calling StartAlleyFightMapEvent and gui error

正在查看此主题的用户

Kommissar

Recruit
I'm calling StartAlleyFightMapEvent, which works as expected. Two parties begin to fight (spawned party and a garrison). This is done just outside of a town.
Player can get involved, as they would with an alley fight - the option being to help the garrison or to not get involved.

If the player chooses to help the garrison and wins the fight, they are presented with a menu and a "continue" option, upon clicking of which I get a null exception error. I tracked the code to the following:
Sandbox.Source.Towns - CommonAreaCampaignBehavior
unknown.png


The highlighted variable is null, which causes an exception. Is there any way to call an alley fight in a different way, or at least to ensure such error will not be thrown?
C#:
Campaign.Current.MapEventManager.StartAlleyFightMapEvent(mob.Party, garrison.Party);
 
最后编辑:
Apologies as I don't know the answer to your question, but I'm very interested to know how you made your menu button call some code? I have a custom escape menu button and have been trying to make it do something, but have no idea how to link it to my C# code.
 
点赞 0
后退
顶部 底部