Page 1 of 2 12 LastLast
Results 1 to 30 of 44

Thread: Complex conditionals for recruiting and building

  1. #1

    Default Complex conditionals for recruiting and building

    Sorry in advance if this is already well known. I recently found out that you can use not only AND when concatenating conditionals but OR and NOT as well

    This means you can specifiy that a unit can be built if a building is NOT present of if one of a list of buildings is present for instance.
    There are many other uses.

  2. #2
    Senior Member Senior Member Duke John's Avatar
    Join Date
    May 2003
    Location
    Netherlands
    Posts
    2,917

    Default Re: Complex conditionals for recruiting and building

    Thanks alot for that information! This will surely come in handy.

  3. #3

    Default Re: Complex conditionals for recruiting and building

    Here are some working examples from the Ptolemaic mode I'm working on:

    recruit "egyptian peltast" 0 requires factions { egyptian, } and hidden_resource egypt and not building_present_min_level hellenic_colony basic_colony


    This will allow you to build egytian peltasts as long as its a native Egyptian Area and you haven't founded a hellenic colony there.

    temple_of_fun_large_temple requires factions { armenia, thrace, seleucid, julii, } or factions { egyptian, } and hidden_resource greeks or factions { egyptian, } and building_present_min_level hellenic_colony basic_colony


    This allows this temple if you are egyptian and either its a ethnic Greek province or you have founded a hellenic colony there

  4. #4
    Wandering Historian Member eadingas's Avatar
    Join Date
    Nov 2004
    Location
    Llanfairpwll- gwyngyll- gogerych- wyrndrobwll- llantysilio- gogogoch
    Posts
    4,714

    Default Re: Complex conditionals for recruiting and building

    Can you nest the brackets?
    I'm still not here

  5. #5

    Default Re: Complex conditionals for recruiting and building

    But there is no way to tie certain units to a specific date, or tie them to an event other than Marius' reforms, right?

  6. #6
    Wandering Historian Member eadingas's Avatar
    Join Date
    Nov 2004
    Location
    Llanfairpwll- gwyngyll- gogerych- wyrndrobwll- llantysilio- gogogoch
    Posts
    4,714

    Default Re: Complex conditionals for recruiting and building

    It would be good if somebody posted a list of all possible conditionals... We're wandering in the mist right now, I was trying to find out some requirements not listed in the original files, but to no avail. Is this really all there is? Can't we tie the unit for example to province's tax value or population...
    I'm still not here

  7. #7

    Default Re: Complex conditionals for recruiting and building

    The only ones I know of are:

    requires factions { x, y, ... z, }
    building_present_min_level x y
    resource x
    hidden_resource x
    marian_reforms

    connected using "and", "or" and "not"

    Addtionally condtionals do not work on agents just recruitment and building requirements.

  8. #8
    Wandering Historian Member eadingas's Avatar
    Join Date
    Nov 2004
    Location
    Llanfairpwll- gwyngyll- gogerych- wyrndrobwll- llantysilio- gogogoch
    Posts
    4,714

    Default Re: Complex conditionals for recruiting and building

    hmmm... when I put 'buildingx requires factions { greek, } and not hidden_resource greeks or factions { roman, } and not hidden_resource romans', it only works for greeks. Romans can't build it at all.
    I'm still not here

  9. #9

    Default Re: Complex conditionals for recruiting and building

    ...but no way to link it do a date... Sad...

  10. #10
    Member Member Turbo's Avatar
    Join Date
    Oct 2002
    Location
    New Jersey
    Posts
    414

    Default Re: Complex conditionals for recruiting and building

    Quote Originally Posted by tommh
    Here are some working examples from the Ptolemaic mode I'm working on:

    recruit "egyptian peltast" 0 requires factions { egyptian, } and hidden_resource egypt and not building_present_min_level hellenic_colony basic_colony


    This will allow you to build egytian peltasts as long as its a native Egyptian Area and you haven't founded a hellenic colony there.

    temple_of_fun_large_temple requires factions { armenia, thrace, seleucid, julii, } or factions { egyptian, } and hidden_resource greeks or factions { egyptian, } and building_present_min_level hellenic_colony basic_colony


    This allows this temple if you are egyptian and either its a ethnic Greek province or you have founded a hellenic colony there
    Where would I find a list of tags such as your "hellenic_colony basic_colony"?

    Thanks
    When you decide that servicing your core niche is no longer important, you might as well put a gun to your corporate temple. - Red Harvest -

  11. #11

    Default Re: Complex conditionals for recruiting and building

    Quote Originally Posted by eadingas
    hmmm... when I put 'buildingx requires factions { greek, } and not hidden_resource greeks or factions { roman, } and not hidden_resource romans', it only works for greeks. Romans can't build it at all.
    That's probably because you need to have it say "requires factions {greek, romans, }

    Is there actually a use for the "or factions" command, because "requires factions" is the exact same thing?

  12. #12
    Wandering Historian Member eadingas's Avatar
    Join Date
    Nov 2004
    Location
    Llanfairpwll- gwyngyll- gogerych- wyrndrobwll- llantysilio- gogogoch
    Posts
    4,714

    Default Re: Complex conditionals for recruiting and building

    But I want different conditions for different factions.
    I'm still not here

  13. #13

    Default Re: Complex conditionals for recruiting and building

    I am trying to get some conditional info also. Are time trigger conditionals available? Now, early legionary cohorts are triggered by the Marian Reform event. Can anyone tell me how to include a no earlier than date(around 105 BC) to the original requirement of any Roman faction building an imperial palace? I also want to cause my (later) legionary cohorts to become available with a foundry and a time trigger(apprx 50 BC). Any help would be greatly appreciated!

  14. #14

    Default Re: Complex conditionals for recruiting and building

    Sorry for the slow reply. Been very busy lately. No there ar no date triggers. Sorry. THe only thing that approximates a date trigger is requiring an additional advanced building and then figuring out the date at which this level of development would be possible.

    As to having different conditions for different factions the best way is to use completly seperate recruitment lines. You can have multiple lines for the same unit so put each fractions requirments on its own line.

  15. #15
    EB insanity coordinator Senior Member khelvan's Avatar
    Join Date
    Sep 2002
    Location
    Oakland, CA
    Posts
    8,449

    Default Re: Complex conditionals for recruiting and building

    Just a FYI, we have found that you can string quite a few of these together in the same line with no problems at all, and achieve expected results. So you can get pretty damn complex in defining areas to recruit units, for instance.
    Cogita tute


  16. #16

    Default Re: Complex conditionals for recruiting and building

    Quote Originally Posted by khelvan
    Just a FYI, we have found that you can string quite a few of these together in the same line with no problems at all, and achieve expected results. So you can get pretty damn complex in defining areas to recruit units, for instance.
    Alas, I confirmed the hard way today that no nested evaluation of these complex conditionals is possible.

    Capability1 requires A and (B or C)

    must be expressed as

    Capability1 requires A and B
    Capability1 requires A and C

    where the or is implicit between the two lines.
    "Let us wrestle with the ineffable and see if we may not, in fact, eff it after all." -Dirk Gently, character of the late great Douglas Adams.

  17. #17
    Spends his time on TWC Member Simetrical's Avatar
    Join Date
    Dec 2004
    Location
    New York City
    Posts
    1,358

    Default Re: Complex conditionals for recruiting and building

    But other forms of complex conditionals may be possible, right? "Capability1 requires A and B or C" is probably being parsed as "Capability1 requires (A and B) or C". Or do you have evidence against this? It would be very helpful if someone felt like testing how the computer parsed complex conditionals.

    By the way, might it be a good idea for someone to edit down blitz576's post? It's extremely long and completely irrelevant—those lists are only used for show_me scripts, traits, and ancillaries, not recruitment or building.

    -Simetrical
    TWC Administrator

    MediaWiki Developer

  18. #18

    Default Re: Complex conditionals for recruiting and building

    I've been playing around with ZOR hidden resources for most of the day. I haven't got very far with comprehending the parsing, but this is what I have discovered:

    1. Capability1 requires A and (B or C) worked for me as intended with A as a faction, and B and C as hidden resources with the effect that the unit will appear where either the B resource or the C resource is present. I didn't use any brackets though.

    2. Capability1 requires A and not B and not C also works in that the unit will not appear where either resource B or resource C is present.

    3. Capability1 requires A and not B or not C however appeared not to function as expected or cancelled itself it. The unit appeared where both B and C were present.

    A few other things:

    4. The marian_reform tag has to go at the end if it's going to be used, you can't leave it in the middle.

    5. If you leave the faction blank then the programme will take its reference from export_desc_unit thus the following

    Code:
                    recruit "warband sword briton"  0
    will still allow the unit to be available to the britons.

    Other requirments can be added on as well:

    Code:
                    recruit "warband sword briton"  0  requires hidden_resource A
    will put the unit in any British province contain resource A.

    6. And the double spacing around the experience number and before the and hidden_resource tags doesn't seem to matter too much. I've used single spacing and it's been fine.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  19. #19

    Default Re: Complex conditionals for recruiting and building

    Is there any way to make a certain unit only recruitable if there are no such units recruited, ie. so that you could only train one single unit of that type?

  20. #20

    Default Re: Complex conditionals for recruiting and building

    Simetrical, I found that any attempt at grouping conditionals using () {} or [] caused a CTD on launch. I did not explore implied grouping based on order of parsing other than the example I gave in my previous post. Sorry for the confusion.
    "Let us wrestle with the ineffable and see if we may not, in fact, eff it after all." -Dirk Gently, character of the late great Douglas Adams.

  21. #21
    Spends his time on TWC Member Simetrical's Avatar
    Join Date
    Dec 2004
    Location
    New York City
    Posts
    1,358

    Default Re: Complex conditionals for recruiting and building

    Quote Originally Posted by Epistolary Richard
    Capability1 requires A and not B or not C however appeared not to function as expected or cancelled itself it. The unit appeared where both B and C were present.
    There are three ways to interpret "A and not B or not C", as far as I can tell:

    1) "A and (not B or not C)". This would cause the capability to appear if and only if either A was true but B wasn't (and C would be irrelevant), or A was true but C wasn't (and B would be irrelevant).

    2) "(A and not B) or not C". This would cause the capability would appear if and only if either A was true, but B was false (and C would be irrelevant); or C was false (and A and B would be irrelevant).

    3) "A and not (B or not C)". This would cause the capability to appear if and only if A and C were true, but B was false (with nothing irrelevant).

    If B and C are both true, none of these should apply, and the capability shouldn't appear. Either I missed a possibility, or I misunderstood Richard, or the game is seriously screwed up. This probably merits further investigation.

    -Simetrical
    TWC Administrator

    MediaWiki Developer

  22. #22

    Default Re: Complex conditionals for recruiting and building

    Darn, so much to be done and I'm not going to be able to access RTW for another three weeks at least!

    @ quadrille
    I haven't discovered any way of ensuring you can only build one unit. There's no conditional (that I'm aware of) that involves the game looking at what the faction already owns so we can't simply say:

    requires faction and hastati = 0

    (if I'm wrong on this, please let me know!)

    The main problem lies in creating some kind of exhaustable building/resource so that once you've built it the resource is destroyed and so it cannot be created twice.

    I don't how far people have got in understanding the campaign scripting, but that could help you if there was some trigger after a unit was constructed that could be used to destroy a conditional building.

    There is, however, an easy way of only ever having one unit of a type on the map.

    Easy solution
    You make the unique unit non-buildable and place a single one on the starting campaign map.
    Problem here is that the faction has to have the unique unit from the start, unless again a script trigger could place the unit outside of the normal recruitment system (eg, complete Achilles' home triggers placement of Achilles unit at particular location)


    @ Simetrical

    I think you understood me right.

    I only happened to use the "or not" parameter because I was working on a excel script to make defining the unit's hidden resource requirements easier and therefore the script was set up to insert "or" in between the different hidden resource areas.

    I was going to suggest that perhaps the game uses "and" "or" & "and not" but not "or not" parameters, but that would mean that it shouldn't have appeared in B.

    I don't think we should be too concerned with "or not" though as each one of the situations that it could have been (per your list) can be defined using "and" & "and not" (though you'd have to have two lines for 1) & 2)).

    I'd be more interested in a couple of other areas:

    A) khelvan said we can string quite a few of these together, is there an upper limit? (so if I want to be able to build the unit in half the map, can I list ten ZOR areas that already exist or would I have to create another resource for it?)

    B) what happens if we put in contradictory recruitment parameters, eg, requires faction and italy and not italy ?
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  23. #23

    Default Re: Complex conditionals for recruiting and building

    Thanks for the reply Richard!

    The best would of course be if the player himself could train the unit at any time, but after that not be able to train any more of the same unit (until it's killed). The purpose I was wondering is because I'm working on the warhammer mod, and we are trying to find a way of preventing people from training armies of greater daemons (which would be very "un-fluffy", and which is not possible in the table top game).

    The thing with giving the player the daemon at the start of the campaign is that it would most likely get killed quite soon and then be gone forever (unless there's for example a way of modding the probability that the unit heals after a battle, but that has more to do with the way it was "taken down" than which unit it actually is, hasn't it?).

  24. #24

    Default Re: Complex conditionals for recruiting and building

    I see what you're aiming for. Here are a few ideas pluck out of the blue, but I don't know how feasible some of them are:

    1) Have a "Realm of Chaos" province which is the only one that can build daemonic units. Make the population very small and grow very slowly so that it will limit the number of daemons able to be "recruited".
    Problem: the Chaos player can just demob units in the province and boost its population. Perhaps something can be done with making it a long way away or make the daemon units take up lots more of the population than regular units. (I have to say, though, I quite like the idea of the Chaos player sending a trail of peasant units from the places he's captured back north to 'sacrifice' to get his daemon units)

    2) Make your starting family members greater daemons, make them all infertile and so reduce the number the Chaos player will have.
    Problem: I don't know if it's possible to make different generals have different models so they may all look alike.

    3) Include a 'Daemon Prince' trait that can be gained by one of your characters so if they slaughter enough of the enemy they made a daemon prince/greater daemon. It you make it hard enough to get then it will necessarily limit the number of greater daemons in the army, on the plus side it will accurately reflect the fact that for Chaos hordes success breeds success. Or perhaps replace Faction Leader or Faction Heir, so there will only ever be (and always be) one daemon at a time.
    Problem: I don't know if it's possible for the acquisition of a trait to change the general model, eg, if I made a special 'Scarface' version of a general could I mod the files so that any character who got this trait used the 'Scarface' version rather than the regular version.


    But I have a question as well, for your greater daemon units, how are you getting around the 6 man unit limit?


    Edit

    Greater Daemon mercenaries!

    Mercenary elephants only appear in a few places and have a very low refresh rate. Have a look at them in descr_mercenaries and see if you could put something similar in an isolated Realm of Chaos province.
    Problem: Any other faction can recruit them too! But then again, if the other factions are getting banners into the Realm of Chaos province then Chaos is pretty much onto a loser anyway...
    If you really want to be sure that no one else can recruit them, put the RoC province on an island within an inland sea (a Sea of Chaos perhaps ), ensure the only port for the sea is on the island and give the Chaos player the only ship in that sea.
    Last edited by Epistolary Richard; 03-01-2005 at 17:11. Reason: Brainwave
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  25. #25

    Default Re: Complex conditionals for recruiting and building

    Quote Originally Posted by Epistolary Richard
    I see what you're aiming for. Here are a few ideas pluck out of the blue, but I don't know how feasible some of them are:

    1) Have a "Realm of Chaos" province which is the only one that can build daemonic units. Make the population very small and grow very slowly so that it will limit the number of daemons able to be "recruited".
    Problem: the Chaos player can just demob units in the province and boost its population. Perhaps something can be done with making it a long way away or make the daemon units take up lots more of the population than regular units. (I have to say, though, I quite like the idea of the Chaos player sending a trail of peasant units from the places he's captured back north to 'sacrifice' to get his daemon units)

    2) Make your starting family members greater daemons, make them all infertile and so reduce the number the Chaos player will have.
    Problem: I don't know if it's possible to make different generals have different models so they may all look alike.

    3) Include a 'Daemon Prince' trait that can be gained by one of your characters so if they slaughter enough of the enemy they made a daemon prince/greater daemon. It you make it hard enough to get then it will necessarily limit the number of greater daemons in the army, on the plus side it will accurately reflect the fact that for Chaos hordes success breeds success. Or perhaps replace Faction Leader or Faction Heir, so there will only ever be (and always be) one daemon at a time.
    Problem: I don't know if it's possible for the acquisition of a trait to change the general model, eg, if I made a special 'Scarface' version of a general could I mod the files so that any character who got this trait used the 'Scarface' version rather than the regular version.


    But I have a question as well, for your greater daemon units, how are you getting around the 6 man unit limit?


    Edit

    Greater Daemon mercenaries!

    Mercenary elephants only appear in a few places and have a very low refresh rate. Have a look at them in descr_mercenaries and see if you could put something similar in an isolated Realm of Chaos province.
    Problem: Any other faction can recruit them too! But then again, if the other factions are getting banners into the Realm of Chaos province then Chaos is pretty much onto a loser anyway...
    If you really want to be sure that no one else can recruit them, put the RoC province on an island within an inland sea (a Sea of Chaos perhaps ), ensure the only port for the sea is on the island and give the Chaos player the only ship in that sea.


    The best idea for a non recuitable unit, but want it to be retainable is to make it's build time something ridiculous like 800. Then it's still retainable but not buildable since the game is hardcoded to accept only 244(something like that) turns.

  26. #26
    Member Member Periklis's Avatar
    Join Date
    Sep 2004
    Location
    Athens
    Posts
    54

    Default Re: Complex conditionals for recruiting and building

    Quote Originally Posted by eadingas
    But I want different conditions for different factions.
    In that case you have to make two lines one for the romans and one for the greeks with different conditions. If you look in RTR files you will understand.

  27. #27
    Wandering Historian Member eadingas's Avatar
    Join Date
    Nov 2004
    Location
    Llanfairpwll- gwyngyll- gogerych- wyrndrobwll- llantysilio- gogogoch
    Posts
    4,714

    Default Re: Complex conditionals for recruiting and building

    That post was 3 months old, we moved on since then a bit :)
    I'm still not here

  28. #28

    Default Re: Complex conditionals for recruiting and building

    Actually, the board uses the american dating system of putting the month first. Your post was made at the beginning of December, that's seven months ago!

    Was there even RTW modding back then?
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  29. #29
    Wandering Historian Member eadingas's Avatar
    Join Date
    Nov 2004
    Location
    Llanfairpwll- gwyngyll- gogerych- wyrndrobwll- llantysilio- gogogoch
    Posts
    4,714

    Default Re: Complex conditionals for recruiting and building

    Hmm then I think that was even before the period when I was the building coordinator for EB... prehistory :)
    I'm still not here

  30. #30

    Default Re: Complex conditionals for recruiting and building

    Does using "or" as a building conditional necessitate restating "factions (x,y,z,)"?

    In other words is example 1 the same as example 2?

    1. requires factions (x, y, ) and buildingalpha or buildingbeta

    2. requires factions (x, y, ) and buildingalpha or (x, y, ) and buildingbeta
    Last edited by Teleklos Archelaou; 10-02-2005 at 20:57.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO