[BNW] Is there any way to force the 'auto end turn' to turn off from lua?

Grandy

Chieftain
Joined
Mar 28, 2013
Messages
10
I'm making a mod that has pop up events (not using Sukitract's Events and Decisions because I wanted a different UI and also for the mod to not be dependant on the community patch in case people don't want it for w/e reason)

The UI works fine, but with auto-end turn on the turn will end before the player has actually chosen any option, and that sometimes leads to crashes.

What I have been doing is spawning a custom unit just as the pop up fires and then deleting it just as an option is chosen. Since the unit still has moves left, it stops the auto-end turn. But it's... kind of an ugly, patchwork solution? Also if the player presses space it puts the spawned unit into rest mode and the auto end turn kicks in again.
 
I believe this will require a DLL change. The Notifications code in the Community Patch DLL adds an event blocking type ENDTURN_BLOCKING_EVENT_CHOICE that forces a blocking end turn.
You can experiment with reusing an existing notification type that is configured to block end turns. Here is an untested example:

Code:
text = "My event title!"
heading = "My event name!"
player:AddNotification(NotificationTypes.NOTIFICATION_DIPLO_VOTE, text, heading);

NotificationTypes.NOTIFICATION_DIPLO_VOTE is configured to block the end turn until it is dealt with.

I think you are going to run into issues, however, because there is special code handling for that notification type. For example, it'll show up a diplo vote popup, which will fail. I don't know if there's a way to hi-jack that.

Most likely, your eventual answer will need to get into DLL changes, and at that point, you may want to use the Community Patch Project, instead.
 
Thanks, I'll try that

Y'know I appreciate how for a 15 year old game the civ 5 modding community is still alive
 
Back
Top Bottom