Changing resource quantities on existing map

ww2commander

Emperor
Joined
Aug 23, 2003
Messages
1,243
Location
Australia
How do I go about increasing the quantity of resource deposits on an existing custom map that has the resources pre-placed?

I tried playing with the numbers in the AssignStartingPlots.lua file but it does not seem to do anything.

I gather because its a custom map it is ignoring this file or something!

I need a way to get around this as it is stopping me progressing with my Eastern Front mod as a lot of the builds and supply system are resource dependent heavy.

Any help much appreciated!
 
WorldBuilder, open the map, click on the hex and adjust the quatity of the resource.

Or if you need to do this dynamically in the game

pPlot:SetNumResource(iTotal) or pPlot:ChangeNumResource(iChange)
 
I gather because its a custom map it is ignoring this file or something!

You're right about that.

I assume whoward69 resolved your problems here, so just for information, if you need to alter a WB map during loading, you'll have to use a copy of WorldBuilderRandomItems.lua and it will be called only for map that have the random resource placement option, not map that have any resource pre-placed.

You can also edit the AddGoodies() function in MapGenerator.lua (will be called if you allowed random goody hut in WB, and you can edit it to do something else as long as your mod is not made to be compatible with others...)

These are the only 2 entry points I'have found for WB maps, else the loading is made by the internal game engine...
 
Thank you both for pointing out the stupidity in my ways. :wallbash:

For some reason, I never noticed that field as I had originally spent time doing it via XML only to read Spatz's replies across numerous posts explaining its done via the AssignStartingPlots.lua. Never bothered to go back to worldbuilder and have closer look.
 
I had originally spent time doing it via XML only to read Spatz's replies across numerous posts explaining its done via the AssignStartingPlots.lua.

See, that's what you get for listening to me.

I almost never use WorldBuilder, so all of my previous comments were only within the context of the dynamic map scripts. For those, you need to change AssignStartingPlots, but for premade maps like you're using, ASP is never executed at all. I've actually run into problems with that in my own mods, in that I'd like to randomly add my new resources even when playing premade Earth maps. But I haven't got that working yet.
 
Back
Top Bottom