Results 1 to 10 of 10

Thread: e_select_character

Hybrid View

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

    Default e_select_character

    I found an odd command in the Docudemons. The entry says that it "selects the character currently referred to in the event context" but I'm not sure what this means. My interest is that I want to be able to selectively spawn reinforcements in certain regions for certain factions, but I can't find a way to spawn troops at the correct location without doing something complicated, like doing a check for every tile in a region.
    A well informed opinion is a well formed opinion.

  2. #2

    Default Re: e_select_character

    This command only works if the faction is local and uses the identifier as 'this' when placing a command. And it's used when an event that was just executed refers to that character involved in it.

  3. #3
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: e_select_character

    @ Carle

    Give an example of what exactly you want to do.










  4. #4

    Default Re: e_select_character

    I posted everything in the other thread, but no one has replied...
    anyway, I want to have reinforcements spawn to help out native factions, i.e. England invades Scotland, Scottish reinforcements may randomly spawn if the Scottish are attacked on their turf, if Inverness (or any other settlemen) is beseiged, then there's a greater chance of reinforcements, and a random counter modified by certain events (i.e. the loss of the capital, a crusade against the target faction, etc) will determine the spawn chance. The units will be disbanded immediately after the battle. I think I know how to do everything else, but I can't figure out how to spawn the army in the right place.
    A well informed opinion is a well formed opinion.

  5. #5
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: e_select_character

    This should do the trick:
    Identifier: I_CharacterTypeNearTile
    Trigger requirements:
    Parameters: faction, character type, distance in squares, x, z
    Sample use: I_CharacterTypeNearTile romans_julii named_character, 10 48,30
    Description: Is a particular character type of a faction near a particular tile?
    And then spawn the army close to the co-ordinates


    To disband units after spawning them, give those units a unique attribute in the EDU and then disband them using the following:
    Identifier: destroy_units
    Parameters: faction, attribute_or_type
    Description: Disbands all units in the faction's armies with the specified name or attribute.
    Sample use: destroy_units England free_upkeep_unit










  6. #6

    Default Re: e_select_character

    That would work for settlements, where the coordinates are constant; but what about field battles in a given region? I guess I'll have to test for every pixel in that region, it's not like my script isn't huge already...
    A well informed opinion is a well formed opinion.

  7. #7
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: e_select_character

    Use the event "GeneralAssaultsGeneral" - add the necessary faction conditions and then test in which area the conflict took place with "I_CharacterTypeNearTile" and spawn another army accordingly. If you keep the radius down to, let's say 5, then it shouldn't be difficult (just time consuming)










  8. #8

    Default Re: e_select_character

    Thanks. I'd already figured out the General and label things, the one problem was that i wanted an easier way to get the units to spawn in the right area...
    Ah well. I don't think I can keep the radius above zero, as there isn't any way that I can think of to get the army to attack as reinforcements unless they are adjacent (i.e. reinforcements) but I could be wrong. I guess I'll just have to code a bunch of tile checks. Do you know whether it would be more efficient to use a lot of ifs, or is better to use monitors?
    A well informed opinion is a well formed opinion.

  9. #9
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: e_select_character

    I believe this command might help (worked over 5 tiles in my mod), but it requires to know the names of both characters:

    Identifier: engage_armies
    Parameters: attacking general, defending general
    Description: Instruct the attacking general to attack the defending general
    Sample use: engage_armies Gaius Julius, Epiroderix


    Using 'IF" - it is easier on the processor I believe then a bunch of monitors, it is just one monitor after all.
    Last edited by Gigantus; February 05, 2011 at 11:07 PM.










  10. #10
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: e_select_character











Posting Permissions

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