Results 1 to 12 of 12

Thread: Implementing a goverment system

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Implementing a goverment system

    I've been working on a M2TW mod, and I've been wondering how to implement the government system I have planned.

    Basically, each faction would have its own four levels of government. The top two levels of government can only be built by each faction in its historic homeland regions (so 30 factions x 2 = 60 hidden resources, with limit at 64, some vanilla ones will be removed).

    It would need to be scripted so that only one government building can be built in each settlement, and that a government building would be required for any other building to be constructed.

    Given the limit of 128 building trees and 9 trees per building, how would I go about implementing this system?

    Would each government building have to be its own tree? Because that couldn't work since 4 gov'ts for the 30 factions would take up 120 of the 128 slots, and they can't each be a tree for all other buildings, since there can only be 9 per tree.

    I know EB implemented a similar system, but I'm unsure how I would go about it.

    Thanks for any help...

  2. #2

    Default Re: Implementing a goverment system

    Well, can't you make all four levels of government for one faction be one tree, with the top two levels requiring the hidden resources? Or am I misunderstanding what you're asking?

    Coder on Dark Ages: Roman Revival, the alternate history mod for BI.

    Under the Patronage of Augustus Lucifer, member of the House of Ward.

  3. #3

    Default Re: Implementing a goverment system

    Wouldn't you have to build through them then though?

    ie build level 4 (the worst), build level 3, build level 2, then level 1?

    Rather than just build the one you want when you conquer the settlement?

  4. #4
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Implementing a goverment system

    Quote Originally Posted by Caledonian Rhyfelwyr View Post
    I've been working on a M2TW mod, and I've been wondering how to implement the government system I have planned.
    Interesting idea. More details about it will make it easier to help you out, but if you dont want to make some things public then I understand.



    Basically, each faction would have its own four levels of government. The top two levels of government can only be built by each faction in its historic homeland regions (so 30 factions x 2 = 60 hidden resources, with limit at 64, some vanilla ones will be removed).
    You dont even have to use hidden resources for this, you can tie it to specific region IDs.


    It would need to be scripted so that only one government building can be built in each settlement, and that a government building would be required for any other building to be constructed.
    What would probably work best is to create branches. Use a base setup that works for all factions, 1 tree. Then create several more trees that can be branched off of the first tree. Maybe 10 other options, so you use 11 trees total. When you get to stage x of branch 1, you script so the other choices become available. Once the player chooses one of those choices, the other 10 are no longer available.

  5. #5

    Default Re: Implementing a goverment system

    Thanks for the info, I had no idea about the region ID's!

    How exactly would I code them in EDU?

    The thing with the trees is that I hope to make every factions governments totally unique.

    However, most of the other buildings would be similar to vanilla, and shared between most factions (at least of the same culture).

    So, I basically need to fit 120 government buildings into the hardcoded limits, with each faction only able to build its own 4. These government buildings would be a prerequisite for all others, except possibly walls.

    Do building trees have to be scrictly linear (ie Stable, Barons Stable, Royal Stable etc)? Or could the player pick from different options at each level, but only be able to build one of those available?

    Sorry I'm having a bit of difficulty explaining this...

  6. #6
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Implementing a goverment system

    Quote Originally Posted by Caledonian Rhyfelwyr View Post
    Thanks for the info, I had no idea about the region ID's!

    How exactly would I code them in EDU?
    I would have to test some stuff to be certain. But you can probably just use the IsRegionOneOf condition in the building line.

    c_cannon_towers castle requires factions { northern_european, middle_eastern, eastern_european, greek, southern_european, } and IsRegionOneOf 1, 2, 3
    I am not 100% certain that will work, if not then you will have to script something to allow the choices. Scripting it for the player is easy, scripting it for the AI takes some time.




    Do building trees have to be scrictly linear (ie Stable, Barons Stable, Royal Stable etc)? Or could the player pick from different options at each level, but only be able to build one of those available?
    Well they do if you are only going to access them from the settlement scroll. But if you are going to create some of them by script then you can mix and match however you want.

    I have already done most of this, but nothing is compiled into one script. If you dig through all of my released scripts you will see that there are all kinds of pieces you can put together and come up with most of what you want, and you might get some other ideas as well.

  7. #7

    Default Re: Implementing a goverment system

    Thanks for the info!

    The idea of scripting got me thinking... could I make it so that all government buildings (at least for each faction) came from the one tree.

    However, you would not be able to build them, but they would instead appear by script when you conquer a settlement. Could I code in a choice for the player this way?

    IIRC, you can only give players choices through Yes/No questions, represented by a tick/x. So, when a settlement is conquered, then a message would appear saying "would you like to build a level 1 gov't". If you click the tick then the building appears, and if you click the x you will get a similar message asking if you want to build a level 2 government, and so on... do you think that would work?

    For the AI, an appropriate government buildings given the faction and region could be scripted to appear automatically when it conquers a settlement.

    :hmmm:

  8. #8
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Implementing a goverment system

    Quote Originally Posted by Caledonian Rhyfelwyr View Post
    Thanks for the info!
    Welcome.


    The idea of scripting got me thinking... could I make it so that all government buildings (at least for each faction) came from the one tree.

    However, you would not be able to build them, but they would instead appear by script when you conquer a settlement. Could I code in a choice for the player this way?
    Yes but it would take quite a bit of work and testing to get it right.

    IIRC, you can only give players choices through Yes/No questions, represented by a tick/x. So, when a settlement is conquered, then a message would appear saying "would you like to build a level 1 gov't". If you click the tick then the building appears, and if you click the x you will get a similar message asking if you want to build a level 2 government, and so on... do you think that would work?
    Yes it could work. You are correct that you can only offer an Accept/Decline message, but incorrect in thinking that this limits you to two choices. I havent posted any examples of this, but I do have a working multichoice system using multiple choice scrolls. Its not as easy as having multiple choices on 1 screeen, but it works.


    Choice 1:
    Accept = give building 1
    Decline = next choice

    Choice 2
    Accept = give building 2
    Decline = next choice

    Choice 3
    Accept = give building 3
    Decline = next choice

    Choice 4
    Accept = give building 4
    Decline = give default building 5



    For the AI, an appropriate government buildings given the faction and region could be scripted to appear automatically when it conquers a settlement.
    Yes, or you could set requirements and thresholds. Above x = this building, above y = that building, and so on.

  9. #9
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Implementing a goverment system

    Keep us posted on progress, I would like to see how it turns out.

  10. #10

    Default Re: Implementing a goverment system

    Will do, though I think I'll have to leave it until after my exams, they're cathing up with me ATM...

  11. #11
    Condottiere SOG's Avatar Domesticus
    Join Date
    Dec 2006
    Location
    Oregon, USA
    Posts
    2,274

    Default Re: Implementing a goverment system

    Damn good thread. FO'bama!-cuz i'm tired of the peanut circus!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •