• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

UltimateTobi

General
53 Badges
Mar 8, 2010
1.933
1.290
www.youtube.com
  • Stellaris: Nemesis
  • Cities: Skylines - Campus
  • 500k Club
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris - Path to Destruction bundle
  • Stellaris: Apocalypse
  • Stellaris: Megacorp
  • Stellaris: Federations
  • Stellaris: Leviathans Story Pack
  • Stellaris: Synthetic Dawn
  • Stellaris: Distant Stars
  • Stellaris: Ancient Relics
  • Stellaris: Humanoids Species Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Lithoids
  • Stellaris: Necroids
  • Europa Universalis IV
  • Europa Universalis 4: Emperor
  • Island Bound
  • Prison Architect: Psych Ward
  • Arsenal of Democracy
  • Europa Universalis IV: Golden Century
  • Darkest Hour
  • Hearts of Iron III
  • Cities: Skylines
  • Cities: Skylines Industries
  • Cities: Skylines - Natural Disasters
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • Cities: Skylines - Green Cities
  • Prison Architect
  • Europa Universalis IV: Rights of Man
  • Cities: Skylines - Parklife
  • Europa Universalis IV: Dharma
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis IV: Pre-order
  • Cities: Skylines Deluxe Edition
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
Hello guys,

I posted this in the suggestions sub-forum:

"Hey guys,

I don't know if it's possible, but I would like to see something like a basic commands tab. With basic commands I mean orders you can give your allies.

First: You can choose an allied country, then these options come:

For example: - Attack enemy:[list to choose whith whom you're at war: country name]
- Defend country:[list to choose whith whom you're allied: country name]
- Relinquish

Explanation of "Attack enemy [country name]": If you choose this, the specific country you gave that order will attack/try to attack (if possible, and effective) the chosen enemy country.

Explanation of "Defend country [country name]": The specific country you gave that order will defend/try to defend (if possible, and effective) the chosen allied country. (NOT expeditionary forces.)

Explanation of "Relinquish": That will relinquish all orders of the specific country and will act on its own again. Orders can be given again afterwards.

I find this would give you more control over your allies and would improve gaming experience as a leader of an alliance.
Ofcourse, if you're not, but the AI, the AI could give these orders, then it's up to you if you follow their order, or continue on your own. (But I guess that would include much AI coding [if possible at all], but I find that this would be a great improvement.)

Sorry for my bad English and thanks in advance for reading, liking/disliking my idea. :)"

(Link: http://forum.paradoxplaza.com/forum/showthread.php?555298-Basic-Commands)

So, the problem is, that I am not a modder, but maybe here I can find a smarter guy than me who grabs my idea and realize it. Maybe it gets implemented too, as you can read in the thread/(link above).

I just want nothing more but be credited as the "Idea Founder", the rest goes to you. Fame, glory, etc. :p

But before that, I want your opinions how do you like my idea. Makes it sense? Is it worth to be realized? Do you want to see it as a feature in a future patch? (Would need to be done first, as you can read in the thread I linked.) If so, go for it and realize the mod! :D

Thanks in advance!
 
Form my point of view, the amount of generic decision that a country could possibly use is huge (to let every ally attack/relinquish/change goals) and the decision system is not really capable of managing every possible combination.

I don't know how close that would be to your idea, but I would rather see it as implementation of a couple of pre-scripted decisions covering the most important cases. For example once USA joins the war, the UK could ask them, by decision, to prioritize invading Africa and then Italy, or going straight on Normandy, or maybe even helping them out in Burma. The decision could be made every half a year, would launch a different AI file and there would be some probability of rejecting the idea (or American reverting to their standard AI file).

Likewise, a major partner in alliance, like Germany, could ask a minor, like Italy, to concentrate on Africa, send expeditionaries to help in Russia or maybe attack Greece? Here the probability of agreement should be higher, but still Italians weren't that easy to coordinate the war with ;)

THE most difficult thing to do is, I think, making sure there are good AI files to cover possible choices.

For me, the nice point in this idea is that it gives some sort of getting military control without all the micromanagement and simulating the autonomy of different armies.
 
Form my point of view, the amount of generic decision that a country could possibly use is huge (to let every ally attack/relinquish/change goals) and the decision system is not really capable of managing every possible combination.

I don't know how close that would be to your idea, but I would rather see it as implementation of a couple of pre-scripted decisions covering the most important cases. For example once USA joins the war, the UK could ask them, by decision, to prioritize invading Africa and then Italy, or going straight on Normandy, or maybe even helping them out in Burma. The decision could be made every half a year, would launch a different AI file and there would be some probability of rejecting the idea (or American reverting to their standard AI file).

Likewise, a major partner in alliance, like Germany, could ask a minor, like Italy, to concentrate on Africa, send expeditionaries to help in Russia or maybe attack Greece? Here the probability of agreement should be higher, but still Italians weren't that easy to coordinate the war with ;)

THE most difficult thing to do is, I think, making sure there are good AI files to cover possible choices.

For me, the nice point in this idea is that it gives some sort of getting military control without all the micromanagement and simulating the autonomy of different armies.

Thanks for the input. :) Yes, the suggestion gets close to mine. Anyway, I hope somebody will grab my idea/your suggestion and realize it, because I can't mod. Well, I had a look at the guide but it was very confusing for me. I don't think I have the time to work through all that. But a modder could do that in matter of days I think.

Your suggestion gives not that much freedom as I thought, though it would make the thing alot easier. Either way, one of these both things as a mod (and maybe afterwards implemented into the game) would be great to see.
 
I'm bogged down in doing the next version of New World Order mod, if I have any time. Like I said, I looked at the AI files, and there are still certainly not enough AI files to cover those alternate routes and getting good results (in 1.0.0 IIRC AI found it near impossible to do DDay, not to mention consider alternatives). So correcting and enlarging current AI file base which is a big task would be the first thing. I'd have this idea earmarked for me to remember about. Possibly someone else will have the time to do this?
 
AI is and remains a weak point of the HoI system. I wish Martin would take the time to convert ai changing to specific commands (with -1 to refer to self country for the commands that do exist) so we can add/remove piecemeal without having to have an ai file for every possible combination of target = {}, embargo = {}, favor = {}, etc.

In my opinion, command ai decision simply would not be feasible. There are way too many possible targets, wars, etc. If we modified a target in a decision to add country A, we'd have to take into consideration if the country already targets country B C D, and have prior written ai files with A B C D. If country did not target D yet, or C, or B, we'd have to have triggers and separate ai files. Later, if an old event adds country E, it would have to be modified to include country A on condition that the previous event fired. It just gets way too complicated.
 
I could do with this while playing as germany in ww1.

Austro-Hungary are awful at prioritising.
 
I'm bogged down in doing the next version of New World Order mod, if I have any time. Like I said, I looked at the AI files, and there are still certainly not enough AI files to cover those alternate routes and getting good results (in 1.0.0 IIRC AI found it near impossible to do DDay, not to mention consider alternatives). So correcting and enlarging current AI file base which is a big task would be the first thing. I'd have this idea earmarked for me to remember about. Possibly someone else will have the time to do this?

Great, if you find time sometime to maybe get your hands on it. :)

I notice, that the interest is growing, so maybe we find a smart modder. :D

@Limith MartinBG said, that it's possible, well, I don't know if he means, that all's possible (I hope so).

His words "It can be done by soft-codding (decision(s) for player that trigger events for AI allies switching AI files), but I doubt that any team member will have time to work on such feature. It is a good idea for a mod though." in God's ear. :D
 
Great, if you find time sometime to maybe get your hands on it. :)

I notice, that the interest is growing, so maybe we find a smart modder. :D

@Limith MartinBG said, that it's possible, well, I don't know if he means, that all's possible (I hope so).

His words "It can be done by soft-codding (decision(s) for player that trigger events for AI allies switching AI files), but I doubt that any team member will have time to work on such feature. It is a good idea for a mod though." in God's ear. :D

It is "possible" (below pseudo-code for singleplayer games only)
Code:
decision = {
.....
persistent = yes
trigger = {
 ai = no
}
.....
action = { # Repeat for [b]every[/b] country available
    trigger = {
           alliance = { 
                  country = Y
           }
    }

    name = "Select Ally Y" #Opens another event menu that lets you select a target for ally y
    command = { type = local_setflag which = <thisid>_YTAG }
    command = { type = trigger which = <nextid>}
    }
}
event = {
...
persistent = yes
#Triggered
....
desc = "Select a target for our allies"
....
action = { # Repeat for every country
       trigger = {
       not = { country = X }
       war = { country = X }
       }
name = "Attack Country X"
command = { type = setflag which = TARGET_XTAG }
command = { trigger = { local_flag = <previd>_YTAG } type = event which = <nextid> where = YTAG when = 0 } # Repeat for every possible country, calls event that changes ai for said country.
command = { type = local_clrflag which = <previd>_YTAG } # Repeat for every possible country
}
action = {
      trigger = {
      country Z != countryY #(local_flag = <previd>_YTAG != Z )
      alliance = { country = Z }
      not = { country = Z }
      }
name = "Defend Country Z" # Repeat for every country tag.
command = { type = setflag which = DEFEND_ZTAG }
command = { trigger = { local_flag = <previd>_YTAG } type = event which = <nextid> where = YTAG when = 0 } # Repeat for every possible country, calls event that changes ai for said country.
command = { type = local_clrflag which = <previd>_YTAG } # Repeat for every possible country
      }
.....
action = {
      trigger = {
      #COPY AND CONVERT ALL REQUIREMENTS FOR CONTROL/OWNERSHIP FOR RELEASING A COUNTRY
      # EX:
      control = { province = ?? data = Y }
      local_flag = <previd>_YTAG
      # Wheres this would need to be repeated for every possible YTAG. data = <param> isn't a dynamic variable externally.
      }
name = "Release Country A" # Repeat for every country tag.
command = { type = setflag which = RELEASE_ATAG }
command = { trigger = { local_flag = <previd>_YTAG } type = event which = <nextid> where = YTAG when = 0 } # Repeat for every possible country, calls event that changes ai for said country.
command = { type = local_clrflag which = <previd>_YTAG } # Repeat for every possible country
       }
......
action = {
       name = "Cancel"
       command = { type = local_clrflag which = <previd>_YTAG } # Repeat for every possible country
       }
}
.....
event = {
....
persistent = yes
#triggered
.....
action = { # Repeat for every possible target
      trigger = {
               flag = TARGET_XTAG
      }
      command = { type = ai which = "<filename>" } #This is an abstraction since this doesn't take into account the inherently restrictive nature of ai switching which replaces entire blocks of active ai sections instead of adding/removing targets to or from the list of targets for the ai. If Martin doesn't add commands allowing modification as such, you would STILL need to have an incredible amount of triggers reading the current ai file (that simply don't exist) and an equally incredible amount of ai files to account for every possible TAG variation, possible alternative history, deviation, etc.
       command = { type = clrflag which = TARGET_XTAG }
       }
action = {
       trigger = {
               flag = DEFEND_ZTAG
       }
       command = { type = ai which = "<filename>" } # Same problems as above. Has to be expeditionary force due to broken front ai.
       command = { type = clrflag which = DEFEND_ZTAG }
       }
.....
action = {
       trigger = {
               flag = RELEASE_ATAG
       }
       command = { type = independence which = ATAG } #COMPLETELY ignores messy independence due to cores/claims, which solving it would probably require another messy generic event with flag based "parameters" (given the limitation of boolean fla variables) whereby provinces of the released country are forcibly given to the new country if occupied by releasing country after independence.
       command = { type = clrflag which = RELEASE_ATAG }
       }
......
}
......
Martin is right by saying it is "possible". I'm saying it is not "feasible" (in a cost-benefit analysis or as defined: Possible to do easily or conveniently) given the current tools available to create a generic decision based menu for what you are suggesting. It is much better in a development sense to include a hardcoded internal system for your goal with easier access to existing variables (instead of using external boilerplate commands that inevitably probably call upon internal hardcoded boilerplate code).

Even better would be if the ai actually reacts well enough by itself (internally) to not require human manual changing of ai target priorities. If the internal target calculation is good enough, then there is no need to manually modify the targets.

It's just not worth the time needed to do what you are asking (aka I won't be contributing and I doubt a modder would given the many other projects out there). Feel free to manually (or write some code to generate) fill in the outline I wrote above though Tobi. There already exists ways to do what you want anyway:
-Attack Country: - Take military control (acceptall)
-Defend Country: - Take military control (acceptall)
-Relinquish Country: - Wait 30 days or save, load, release, resave, reload.

Unless anyone (Martin?) has a better idea for the coding structure...I'm not the best coder out there...the above coding structure would probably require more than 15,000 lines of code to create a true generic menu for every country.

If only we had access to variables....
 
Last edited:
It is "possible" (below pseudo-code for singleplayer games only)
Code:
decision = {
.....
persistent = yes
trigger = {
 ai = no
}
.....
action = { # Repeat for [b]every[/b] country available
    trigger = {
           alliance = { 
                  country = Y
           }
    }

    name = "Select Ally Y" #Opens another event menu that lets you select a target for ally y
    command = { type = local_setflag which = <thisid>_YTAG }
    command = { type = trigger which = <nextid>}
    }
}
event = {
...
persistent = yes
#Triggered
....
desc = "Select a target for our allies"
....
action = { # Repeat for every country
       trigger = {
       not = { country = X }
       war = { country = X }
       }
name = "Attack Country X"
command = { type = setflag which = TARGET_XTAG }
command = { trigger = { local_flag = <previd>_YTAG } type = event which = <nextid> where = YTAG when = 0 } # Repeat for every possible country, calls event that changes ai for said country.
command = { type = local_clrflag which = <previd>_YTAG } # Repeat for every possible country
}
action = {
      trigger = {
      country Z != countryY #(local_flag = <previd>_YTAG != Z )
      alliance = { country = Z }
      not = { country = Z }
      }
name = "Defend Country Z" # Repeat for every country tag.
command = { type = setflag which = DEFEND_ZTAG }
command = { trigger = { local_flag = <previd>_YTAG } type = event which = <nextid> where = YTAG when = 0 } # Repeat for every possible country, calls event that changes ai for said country.
command = { type = local_clrflag which = <previd>_YTAG } # Repeat for every possible country
      }
.....
action = {
      trigger = {
      #COPY AND CONVERT ALL REQUIREMENTS FOR CONTROL/OWNERSHIP FOR RELEASING A COUNTRY
      # EX:
      control = { province = ?? data = Y }
      local_flag = <previd>_YTAG
      # Wheres this would need to be repeated for every possible YTAG. data = <param> isn't a dynamic variable externally.
      }
name = "Release Country A" # Repeat for every country tag.
command = { type = setflag which = RELEASE_ATAG }
command = { trigger = { local_flag = <previd>_YTAG } type = event which = <nextid> where = YTAG when = 0 } # Repeat for every possible country, calls event that changes ai for said country.
command = { type = local_clrflag which = <previd>_YTAG } # Repeat for every possible country
       }
......
action = {
       name = "Cancel"
       command = { type = local_clrflag which = <previd>_YTAG } # Repeat for every possible country
       }
}
.....
event = {
....
persistent = yes
#triggered
.....
action = { # Repeat for every possible target
      trigger = {
               flag = TARGET_XTAG
      }
      command = { type = ai which = "<filename>" } #This is an abstraction since this doesn't take into account the inherently restrictive nature of ai switching which replaces entire blocks of active ai sections instead of adding/removing targets to or from the list of targets for the ai. If Martin doesn't add commands allowing modification as such, you would STILL need to have an incredible amount of triggers reading the current ai file (that simply don't exist) and an equally incredible amount of ai files to account for every possible TAG variation, possible alternative history, deviation, etc.
       command = { type = clrflag which = TARGET_XTAG }
       }
action = {
       trigger = {
               flag = DEFEND_ZTAG
       }
       command = { type = ai which = "<filename>" } # Same problems as above. Has to be expeditionary force due to broken front ai.
       command = { type = clrflag which = DEFEND_ZTAG }
       }
.....
action = {
       trigger = {
               flag = RELEASE_ATAG
       }
       command = { type = independence which = ATAG } #COMPLETELY ignores messy independence due to cores/claims, which solving it would probably require another messy generic event with flag based "parameters" (given the limitation of boolean fla variables) whereby provinces of the released country are forcibly given to the new country if occupied by releasing country after independence.
       command = { type = clrflag which = RELEASE_ATAG }
       }
......
}
......
Martin is right by saying it is "possible". I'm saying it is not "feasible" (in a cost-benefit analysis or as defined: Possible to do easily or conveniently) given the current tools available to create a generic decision based menu for what you are suggesting. It is much better in a development sense to include a hardcoded internal system for your goal with easier access to existing variables (instead of using external boilerplate commands that inevitably probably call upon internal hardcoded boilerplate code).

Even better would be if the ai actually reacts well enough by itself (internally) to not require human manual changing of ai target priorities. If the internal target calculation is good enough, then there is no need to manually modify the targets.

It's just not worth the time needed to do what you are asking (aka I won't be contributing and I doubt a modder would given the many other projects out there). Feel free to manually (or write some code to generate) fill in the outline I wrote above though Tobi. There already exists ways to do what you want anyway:
-Attack Country: - Take military control (acceptall)
-Defend Country: - Take military control (acceptall)
-Relinquish Country: - Wait 30 days or save, load, release, resave, reload.

Unless anyone (Martin?) has a better idea for the coding structure...I'm not the best coder out there...the above coding structure would probably require more than 15,000 lines of code to create a true generic menu for every country.

If only we had access to variables....

Thanks for contribute this. You explained that all very well. Though it makes me sad, that it's that hard, though I thought that "3 orders can't be that hard to soft-code/mod! ;)". Well, it probably is.

Well, we'll see what happens. Maybe someone sees this and want to do it anyway, I won't hold him/her up. :p
 
Thanks for contribute this. You explained that all very well. Though it makes me sad, that it's that hard, though I thought that "3 orders can't be that hard to soft-code/mod! ;)". Well, it probably is.

Well, we'll see what happens. Maybe someone sees this and want to do it anyway, I won't hold him/her up. :p

It's not hard. Just very very time consuming for (imo) little gain. Not to mention it'd need to be updated for every revolt.txt change. The coding structure took me 30 seconds to think of, around 4 minutes to finish typing and 5 to comment/format, and about 5 minutes to proofread (slightly broken keyboard). The sheer repetitiveness ("boilerplate") of the triggers needed to get a generic event working is the reason why this event would take forever to write. Most large generic decisions suffer from this. Ex: I spent around 3 hours writing the Japanese Collaboration event in CCIP due to the need to look up province IDS and repetitive actions for each area. Another would be an hour working on a generic economic decision in CG. I would do it here if it weren't for the fact that solutions ingame already exist.

Anyway, if you really want this, just go ahead and fill in the code yourself. The pseudo-code I wrote shouldn't be too hard to fill in (given the terrible documentation I see in coding given to us in my CompSci classes), my grader always says I overcomment my code...just open up event commands.txt in Modding Documentation and look at a few other events to learn the coding syntax (language). It isn't very hard.
3 things:
  • decision = {} is not the proper start of a event, it is still event = {}
  • country Z != countryY #(local_flag = <previd>_YTAG != Z ) is a logical explanation (country Z cannot be country Y, since then you will be asking country Y to protect country Y. This would be done via a not = { local_flag = <previouseventid>_COUNTRYTAG } trigger specifically with the country tag of COUNTRYZ.
  • '...' represents omitted (standard/obligatory) "boilerplate" code.
 
Last edited:
It's not hard. Just very very time consuming for (imo) little gain. Not to mention it'd need to be updated for every revolt.txt change. The coding structure took me 30 seconds to think of, around 4 minutes to finish typing and 5 to comment/format, and about 5 minutes to proofread (slightly broken keyboard). The sheer repetitiveness ("boilerplate") of the triggers needed to get a generic event working is the reason why this event would take forever to write. Most large generic decisions suffer from this. Ex: I spent around 3 hours writing the Japanese Collaboration event in CCIP due to the need to look up province IDS and repetitive actions for each area. Another would be an hour working on a generic economic decision in CG. I would do it here if it weren't for the fact that solutions ingame already exist.

Anyway, if you really want this, just go ahead and fill in the code yourself. The pseudo-code I wrote shouldn't be too hard to fill in (given the terrible documentation I see in coding given to us in my CompSci classes), my grader always says I overcomment my code...just open up event commands.txt in Modding Documentation and look at a few other events to learn the coding syntax (language). It isn't very hard.
3 things:
  • decision = {} is not the proper start of a event, it is still event = {}
  • country Z != countryY #(local_flag = <previd>_YTAG != Z ) is a logical explanation (country Z cannot be country Y, since then you will be asking country Y to protect country Y. This would be done via a not = { local_flag = <previouseventid>_COUNTRYTAG } trigger specifically with the country tag of COUNTRYZ.
  • '...' represents omitted (standard/obligatory) "boilerplate" code.

Thanks buddy. I think, when I find the time, I'll try to do 1 such event just to test it. If it works, I may get my hands on it myself.