Results 1 to 10 of 10

Thread: Is it possible to export a character by name?

  1. #1

    Default Is it possible to export a character by name?

    As the title question goes, is there a way, either direct or through gamey logistics, to make a script that triggers only for a particular character when in or around a location? Explaining in other words, say I wanted an event to trigger if character X starts a turn inside settlement Y, or possibly near it as well.

    I've been forcing my neurons to find some smart way around this, but all I know how to do is trigger the event when any character is inside the settlement, rather than using name, traits, attributes, or ancillaries to separate one character from all the others.

    Hope I was clear in describing what I aim to do. Any suggestion will be welcome.

  2. #2

    Default Re: Is it possible to export a character by name?

    You can use a unique trait to identify a character and then test if he ended his turn in a particular settlement. You can even make this trait invisible (hidden) if needed.

    Code:
    monitor_event CharacterTurnEndInSettlement SettlementName London   ;character ended their turn in London
    and Trait IDtrait > 0   ;character has the unique ID trait, so must be the character we're interested in
       ;do stuff
    end_monitor
    Alternatively, we can use just about any event that exports character_record to test if they're in a particular region. For example, we can test which region the character is in when the player selects them (only works outside of residence).

    Code:
    monitor_event CharacterSelected Trait IDtrait > 0
    and IsRegionOneOf London_Province   ;character is somewhere in the London region
       ;do stuff
    end_monitor
    Beyond that, it becomes difficult to test precisely where a character is on the map. We have the I_CharacterTypeNearTile and I_CharacterTypeNearCharacterType conditions, but neither can take a trait, ancillary, name, or label (i.e. any uniquely identifying information) as a parameter. If you want to be absolutely sure that a uniquely identified character is at a specific tile, your best bet is to put a settlement on that tile and test if the character is in the settlement.

  3. #3

    Default Re: Is it possible to export a character by name?

    I feared this lack of precision, but you did give me something I didn't know of. This "IsRegionOneOf" is something I had never used before, and it seems to roughly cover most of the needs one can possibly have in this department. I'm looking forward to use this myself.

    The phrasing of the code suggests it can contain more than one region at once. Is that true?

  4. #4

    Default Re: Is it possible to export a character by name?

    Yes. You can add additional regions separated by comas and spaces.

    Note that you can (and should) use region names in campaign_script but if you use this condition in EDCT or EDA (or presumably any file other than campaign_script), you must use region ID numbers instead. These are problematic because they change every time you edit region borders in map.rwm and the only way to know what the ID number is for any given region is to launch the campaign and use the show_cursorstat console command.

  5. #5

    Default Re: Is it possible to export a character by name?

    Quote Originally Posted by Callistonian View Post
    Yes. You can add additional regions separated by comas and spaces.

    Note that you can (and should) use region names in campaign_script but if you use this condition in EDCT or EDA (or presumably any file other than campaign_script), you must use region ID numbers instead. These are problematic because they change every time you edit region borders in map.rwm and the only way to know what the ID number is for any given region is to launch the campaign and use the show_cursorstat console command.
    I thought show_cursorstat only shows coordinates for a single tile...

  6. #6

    Default Re: Is it possible to export a character by name?

    It also shows the region ID number.

  7. #7
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: Is it possible to export a character by name?

    I use region ID number in cs without any problem.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  8. #8
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,129
    Blog Entries
    35

    Default Re: Is it possible to export a character by name?

    Using IDs in CS doesn't provide an issue as long as you don't change regional borders at which point you may have to recode the numbers. Using region names makes that unnecessary.










  9. #9
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: Is it possible to export a character by name?

    I compose cs after mapping so that's not an issue for my case. And some scripts require to include all regions on map except one or two into the script line so it's much more compact with numbers for me.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  10. #10
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,129
    Blog Entries
    35

    Default Re: Is it possible to export a character by name?

    Yup, I only do that region ID sensitive stuff after finalizing the map myself - others do not have that patience so it's prudent to point out the pitfall

    Edit: withnwhar's map reader displays region IDs in a much easier way then via console should the need arise.
    Last edited by Gigantus; July 23, 2021 at 12:31 PM.










Posting Permissions

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