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
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 241
Joined: Wed Nov 27, 2013 3:27 pm

ConsumeX command for nations aren't yet at war?

Post by Kossatx »

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
Brigadier-General - Elite Grenadier
Brigadier-General - Elite Grenadier
Posts: 2193
Joined: Tue Nov 23, 2010 3:35 pm

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

Post by Robotron »

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?
Image
Slitherine's Commander the Great War - Director's Cut: POTZBLITZ mod!
FIND IT HERE: http://www.slitherine.com/forum/viewtopic.php?f=218&t=77884&p=662610#p662610
Kossatx
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 241
Joined: Wed Nov 27, 2013 3:27 pm

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

Post by Kossatx »

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
Brigadier-General - Elite Grenadier
Brigadier-General - Elite Grenadier
Posts: 2193
Joined: Tue Nov 23, 2010 3:35 pm

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

Post by Robotron »

I've no clue what else you've changed in your meta-mod so I'll not comment on any weird results.
Image
Slitherine's Commander the Great War - Director's Cut: POTZBLITZ mod!
FIND IT HERE: 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”