Results 1 to 3 of 3

Thread: More Questions...

  1. #1

    Default More Questions...

    hey again, sorry for polluting the board,but if i write in my old topic it gets missed. anyway, i have a few new questions:

    How can I make a script that allows only two family members at a time have a certain trait?
    For example, I have added the Army_Consul Trait for the Romans, now I want only 2 consuls at a time, like in historical fact. I assume it would look something like the scripts/triggers for faction leader and heir, but i cant find those either. I have read through the scripting tutorials, but I cannot copy them because I dont have access to the net on my compy.

    Secondly, If i put my version of the imp campaign in a separate campaign folder, does this automatically disable the marian reforms? because i want to get rid of them.

    thanks for your patience and help!

  2. #2
    Finder of Little Oddities Senior Member Makanyane's Avatar
    Join Date
    Jan 2006
    Posts
    2,220

    Default Re: More Questions...

    How can I make a script that allows only two family members at a time have a certain trait?
    For example, I have added the Army_Consul Trait for the Romans, now I want only 2 consuls at a time, like in historical fact. I assume it would look something like the scripts/triggers for faction leader and heir, but i cant find those either. I have read through the scripting tutorials, but I cannot copy them because I dont have access to the net on my compy.
    There isn't an easy way to do that within the traits section themselves - unless you just want to give them only to the faction leader and heir - otherwise there isn't a way to limit the number of people that have trait, if trigger conditions are met other generals will get it.

    It's vaguely possible that it could be done within campaign script, but you'd need to make sure that it could check the number of generals that have trait already (and I'm not sure you can), you'd then need to give trait via script and not normal trigger - again I'm not sure how that works.

    If a scripting expert doesn't come up with answers to the above I would suggest you use the ancillary system instead. You can't set an ancillary to be used only twice but you can set it to be used once per faction only so you'd make two ancillaries that have different internal name, but look like same thing in game and set them to be mutually exclusive so same guy couldn't get both.
    so in trigger you'd need
    Trigger trigger_consul2
    WhenToTest CharacterTurnEnd
    Condition FactionType ......
    and not FactionwideAncillaryExists consul2
    and in ancillary itself
    Ancillary consul2
    Image ......tga
    ExcludedAncillaries consul1
    the FactionwideAncillaryExists only appears in BI but I think it should work in RTW, you can also try and not WorldwideAncillaryExists if you want it to apply to more than one roman faction.

    Secondly, If i put my version of the imp campaign in a separate campaign folder, does this automatically disable the marian reforms? because i want to get rid of them.
    no that won't do that but if you include the line
    start_date 666 summer
    end_date 999 summer


    marian_reforms_disabled
    ;rebelling_characters_active
    gladiator_uprising_disabled
    below the campaign dates in your descr_strat file that should work, you'll probably want to adjust the requirements for the units in EDB to suit, otherwise you'll never get the better units, remove all references like
    "and marian_reforms" or "and not marian_reforms" from the unit recruitment lines and you should get them all available whenever appropriate barracks is built. If RTW doesn't like including the disabled line you could try taking out the "italy" hidden resource from all regions in descr_regions.txt
    Last edited by Makanyane; 05-24-2007 at 18:43.
    Not used mods before? Looking for something small and fun?!
    Download the:

  3. #3
    Bibliophilic Member Atilius's Avatar
    Join Date
    Oct 2005
    Location
    America Medioccidentalis Superior
    Posts
    3,837

    Default Re: More Questions...

    In general, scripting is a poor way to handle traits. The problem is that the only way to give a character a trait from inside a script is via the give_trait console command. However, this requires that your script knows the name of the character it wants to give the trait to. But there is usually no way for the script to know with certainty the names of characters existing in the game.

    There are only two situations in which giving traits from a script is more or less entirely predictable. The first is when a script is run just prior to the first turn of the game, as when specified in descr_strat.txt. In this case you know the name of every character in the game. The second case is immediately after a character has been spawned by a script, because the script names him. Even this case is a bit problematic, since a character by that same name may already exist. When two characters have the same name, it's usually not clear which will get the trait.
    The truth is the most valuable thing we have. Let us economize it. - Mark Twain



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