Changes to resources

Discuss and post your mods and scenarios here for others to download.

Moderator: Vic

Post Reply
Cesare7
Posts: 3
Joined: Sun Sep 20, 2020 6:38 pm

Changes to resources

Post by Cesare7 »

Hello,

I'd like to use the editor to make a change, but I'm not sure how to go at it. Currently, resources work in such a way that whoever owns the resource hex automatically gains the resources at the end of the turn. There is no need to ship the resources (raw and oil) from the hex to a town/city/production center. I would like to find a way in the editor so that resources produced must go to a town/city to be added to your stockpile. It would use the current supply system already in the game.

Also, I play my games using the rulevar (312) where production can only arrive in a HQ in the same hex. This might be important.

Does anyone here know how this could be done?

Thank you
User avatar
ernieschwitz
Posts: 4536
Joined: Tue Sep 15, 2009 3:46 pm
Location: Denmark

Re: Changes to resources

Post by ernieschwitz »

Hi Cesare7, welcome :)

I think it might only be possible if you are in fact playing with the rulevar that production arrives where it is produced. Of course I am not saying it is the only way, but I cannot think of another.

Currently a mine/drill site, produces the resource (which is a regimevar) when it produces an item, which is blank. That is stops existing the moment you produce it. (it is not an entirely correct depiction, but somewhat this is what is being done). The site is set to produce without a HQ, and thus the number of items is added to the resource (regimevar).

What you could do is make a dummy item. That is an item, called Ore for instance. Then NOT have it produce a resource when doing so. This would make a "unit" then. That unit you could then let the player manually transport to a place where the it can be made into a resource.

That last things would need some coding. Basically look over the map's locations, see if it is in a city (or wherever you decided it could be made into a resource), and then removing the "unit", and for each 1 subformation removed add to a regimevar of the appropriate resource. You could run this event at end of turn.

There is really no way to make it behave like supplies. So that option is not there. So this is the best option, in my opinion.
Creator of High Quality Scenarios for:
  • Advanced Tactics Gold
    DC: Warsaw to Paris
    DC: Community Project.
Try this Global WW2 Scenario: https://www.vrdesigns.net/scenario.php?nr=280
Cesare7
Posts: 3
Joined: Sun Sep 20, 2020 6:38 pm

Re: Changes to resources

Post by Cesare7 »

Hello ernie,

Isn't there a simpler way to do this? I just want it to be possible to interdict resources (think oil being shipped back to Japan but US subs keep sinking the convoys). Wouldn't this be simple to do in a ww2 strategic level game? Most other wargames can do this. Heck, this game already has this, but it's limited to only supplies. Also, I'm not a programmer.

Thank you
User avatar
ernieschwitz
Posts: 4536
Joined: Tue Sep 15, 2009 3:46 pm
Location: Denmark

Re: Changes to resources

Post by ernieschwitz »

Hi Cesare,

I hear ya. I've been there...

There is no rulevar or other flick of a magic wand to make it do this. Frustrating I know.

As for not being a programmer, neither was I when I began modding ATG. My first foray into the event code part of the editor was trying to get the AI to act rationally when declaring war in a global world scenario. I found it very frustrating that a landlocked nation for instance would declare war on an island kingdom. I tried to make up scenarios for when a nation would declare war on another... Failed miserably. But you only learn from mistakes, you learn nothing from not trying.

Fuel and Raw were added much later than supplies. Back then... I have no idea how many years ago... a decision was probably made that this was a good enough way of doing resources, and that it didn't have to be revisited before much later. As with so many things, later just was too long down the line ...
Creator of High Quality Scenarios for:
  • Advanced Tactics Gold
    DC: Warsaw to Paris
    DC: Community Project.
Try this Global WW2 Scenario: https://www.vrdesigns.net/scenario.php?nr=280
User avatar
Ormand
Posts: 823
Joined: Tue Feb 17, 2009 1:31 am

Re: Changes to resources

Post by Ormand »

Something like this has been added to 2.40.057. Resources, more accurately, items that are regime slots, can be interdicted in the anti-supply system if reulvar(938) = 1. To use this, however, it is necessary to specify someplace for the resources to travel to. So, I set up a Resource Destination Hex that can be queried with a check functions in an event, and can be set using an exec function in an event. If these are not set, then a warning will pop up and in order to avoid a CTD, rulevar(38) will be set to 0. In random games. In order for resources to reach the stockpile, that is the info at the top of the screen, the resource hex has to trace a valid path not obstructed by enemy hexes, unfriendly hexes, or forbidden terrain. The resources "travel" like standard production, but are not affected by the distance modifier. Essentially, they will travel an infinite distance. Also, like production, they provide their own transport, rather than some ships or trucks. Like production, it would be too hard in this version to do it another way. If resources can't trace a valid path, they go into the leftover queue and will be sent went contact is re-established.

I set it up so that if rulevar(938) = 1 the destination hex will be the capital. And, if you lose it, you lose the game. For a scenario, it is the responsibility of the designer to set this up and to figure out what to do if the destination hex is lost.
One man alone can be pretty dumb sometimes, but for real bona fide stupidity, there ain't nothin' can beat teamwork -- Edward Abbey
User avatar
CSO_Talorgan
Posts: 804
Joined: Sat Mar 10, 2007 5:53 pm

Re: Changes to resources

Post by CSO_Talorgan »

Cesare7 wrote: Tue Jun 20, 2023 5:34 pmI just want it to be possible to interdict resources
Convoy battles?

Operation Pedestal?

I hear ya!
Post Reply

Return to “Mods and Scenarios”