ConsumeX command for nations aren't yet at war?

A forum to discuss custom scenarios, campaigns and modding in general.

Moderators: Slitherine Core, The Lordz

Post Reply
Kossatx
Administrative Corporal - SdKfz 232 8Rad
Administrative Corporal - SdKfz 232 8Rad
Posts: 157
Joined: Wed Nov 27, 2013 3:27 pm

ConsumeX command for nations aren't yet at war?

Post by Kossatx » Sat Dec 28, 2019 8:10 am

Hi again, is it possible to use the ConsumeProductionPoints command for nations aren't yet at war? I've tried to write it for the KaisersGold event in game_diplomacy.lua but it don't works fine. Looking at Potzblit mod I've seen THE GREAT ROBOTRON don't use this command in game_diplomacy.lua for KaisersGold event, but he wrote this at game_events.lua in Function DOWSerbia:

Code: Select all

if game.turn == 3 and GetEvent("KaiserGold") >0 then
	  germany:ConsumeProductionPoints(10)
end
What I've to do?

Robotron
Lieutenant Colonel - Panther D
Lieutenant Colonel - Panther D
Posts: 1282
Joined: Tue Nov 23, 2010 3:35 pm

Re: ConsumeX command for nations aren't yet at war?

Post by Robotron » Sat Dec 28, 2019 12:34 pm

Oh, that's a leftover from the time when events were not selectable yet. The whole DOWserbia event is just a wild concoction of stuff to check variables or to help the AI. It should work fine if you put the production command into the KaiserGold diplomacy script because adding/reducing of resources definitely works on neutrals.

*testing*

In fact I just ran a test and it worked fine, no clue why it seemed not to work for you, what did you write?
Slitherine's Commander the Great War on steroids: POTZBLITZ mod!
http://www.slitherine.com/forum/viewtopic.php?f=218&t=77884&p=662610#p662610

Kossatx
Administrative Corporal - SdKfz 232 8Rad
Administrative Corporal - SdKfz 232 8Rad
Posts: 157
Joined: Wed Nov 27, 2013 3:27 pm

Re: ConsumeX command for nations aren't yet at war?

Post by Kossatx » Sat Dec 28, 2019 6:47 pm

I wrote the script this way in game_diplomacy.lua:

Code: Select all

			if eventname == "KaiserGold" then
				if GetEvent("ItalyLeaves")  == 0 then
					ChangeFactionAlignment(game:GetFactionById(8), italy.alliance, 2)
				end	
				
				germany:ConsumeProductionPoints(10)			
			
				PutinCP("Goeben")
				Discard("TurkBB")	
				SetEvent("TurkBB", -1)		
			end
When the event triggered, Germany lossed a lot of PP, even negative. But after deleting "KaiserGold" event in DOWserbia event, it works fine :roll:

Robotron
Lieutenant Colonel - Panther D
Lieutenant Colonel - Panther D
Posts: 1282
Joined: Tue Nov 23, 2010 3:35 pm

Re: ConsumeX command for nations aren't yet at war?

Post by Robotron » Sat Dec 28, 2019 7:09 pm

I've no clue what else you've changed in your meta-mod so I'll not comment on any weird results.
Slitherine's Commander the Great War on steroids: POTZBLITZ mod!
http://www.slitherine.com/forum/viewtopic.php?f=218&t=77884&p=662610#p662610

Post Reply

Return to “Commander the Great War : Mods & Scenario Design”