Page 1 of 1

ConsumeX command for nations aren't yet at war?

Posted: Sat Dec 28, 2019 8:10 am
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?

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

Posted: Sat Dec 28, 2019 12:34 pm
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?

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

Posted: Sat Dec 28, 2019 6:47 pm
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:

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

Posted: Sat Dec 28, 2019 7:09 pm
by Robotron
I've no clue what else you've changed in your meta-mod so I'll not comment on any weird results.