Page 2 of 5 FirstFirst 12345 LastLast
Results 21 to 40 of 85

Thread: Unique Names (and avoiding labels)

  1. #21
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Unique Names (and avoiding labels)

    Some more good news, this time regarding Priests & Imams. Using set_religion will let you spawn either type from the same spawning faction.

    OP updated.

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

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

    Default Re: Unique Names (and avoiding labels)

    So first set_religion, then spawn, then set_religion back again?










  3. #23
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Unique Names (and avoiding labels)

    That's right. But the setting back must happen after the give_everything_ otherwise he dies.

  4. #24

    Default Re: Unique Names (and avoiding labels)

    Quote Originally Posted by Withwnar View Post
    Agents? It's been a while since I tried but I never had any luck. Does spawn_character take a portrait parameter?

    EDIT: I tried again and I get the "Unrecognised character data string (portrait)" error. "portrait" works in descr_strat but not with spawn_character as far as I know.

    I also tried with captains and admirals: no luck with spawn_character. Strangely, the admiral ends up with no portrait at all. The captain ends up with a standard portrait.
    If I try to add a new culture and new portraits for this culture,
    (http://www.twcenter.net/forums/showthread.php?t=287046)

    Is it possible to choose portrait to my spawn character?

    If I add only one portrait, always it must be use that portrait.

  5. #25
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Unique Names (and avoiding labels)

    For named characters in a spawn_army you can use a custom portrait.

    For agents, having only one portrait for that agent type in the culture will guarantee* that he gets that portrait. Otherwise the game will choose one 'at random'. Whether it is truly random, or somehow related to his name, I don't know.

    * Although once I tried that - one princess portrait - and the game kept using vanilla M2TW ones as well. I had to create 20 copies of my portrait named 000-019 to stop it happening. But I have used the single portrait method since, in a different scenario, and it works just fine.

    If you're using the method that this thread is about then the portraits come from spawn pool faction's culture, not the destination faction's culture. Giving the spawn pool its own culture would be a good way to get some unique portraits happening.
    Last edited by Withwnar; January 15, 2012 at 10:17 PM.

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

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

    Default Re: Unique Names (and avoiding labels)

    Just a feed back - it works like a charm, used it for 'historical battles' within the strategic map part. Basically scripted\spawned battles with generals that have the same name as the main characters in the game.










  7. #27
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Unique Names (and avoiding labels)

    Excellent. Thanks for the feedback.

    I am in the process of using it myself for a new submod: a one-off character who needs to perform a quest. The script can give and remove traits and ancillaries - updated as his quest progresses - safe in the knowledge that it is indeed him that is being affected and not some other character with that name. Plus I can name him "Loremaster of Gondor" - a name that would be just plain wrong for random characters. Oh, and he's a priest, so labels would not have worked here.

  8. #28

    Default Re: Unique Names (and avoiding labels)

    Quote Originally Posted by Withwnar View Post
    For named characters in a spawn_army you can use a custom portrait.
    If you're using the method that this thread is about then the portraits come from spawn pool faction's culture, not the destination faction's culture. Giving the spawn pool its own culture would be a good way to get some unique portraits happening.
    That's the answer of my question. Thank you.

  9. #29
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Unique Names (and avoiding labels)

    You're welcome. It is in the OP...
    Portraits
    The portraits of some characters will be according to the culture of the spawn faction (descr_sm_factions.txt). These are: named character, spy, assasin, diplomat, merchant and priest.
    ...but I'll make that a bit clearer.

  10. #30
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Unique Names (and avoiding labels)

    OP updated: "Successive Spawns - it can fail" in the "Limitations" section. It had been mentioned already but only in passing in the "Priests & Imams" section.

    I am working on something at the moment which is trying to spawn two agents at once, but into different factions so two separate transfers are required. This was causing all sorts of problems - apparently I forgot my own advice on using two different names for the temporary characters.

    So I have spelled out the problem and solution a bit better.

  11. #31

    Default Re: Unique Names (and avoiding labels)

    Hi Withwnar, first of all congratulations for your great idea! I'm using your system but I have a problem with the bodyguard, that are not spawned correctly: instead of the unit with the general_unit attribute that I have put in the script, the named character has the standard bodyguard's unit.
    Then I tried with your "send-off-map" system, but even this is not working. The full script is below:

    Spoiler Alert, click show to read: 

    monitor_event FactionTurnStart FactionType poland
    spawn_army
    faction spawnpool ;x 120, y 449
    character Morna, named character, age 30, x 88, y 362, direction S
    unit Guardia_bruti exp 2 armour 0 weapon_lvl 0
    end
    give_everything_to_faction spawnpool poland false
    terminate_monitor
    end_monitor

    monitor_event FactionTurnStart FactionType poland
    and I_CharacterExists Morna
    console_command give_trait "Morna" GoodCommander 1
    console_command give_trait "Morna" Maschera_Bianca 1
    terminate_monitor
    end_monitor

    send_character_off_map Morna
    spawn_army
    faction poland
    character Morna, named character, x 88, y 362
    unit Guardia_bruti exp 2 armour 0 weapon_lvl 0
    end

    What happened is that after the send-off there are now two named character: the "old one" is not deleted, and it has the correct name (Morna) but with the wrong bodyguard and a new spawned character with the correct bodyguard but without the name!
    Could you tell me if I have made any mistakes? Thanks.

  12. #32
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Unique Names (and avoiding labels)

    Assuming that this is the exact script you are using then yes, there is a mistake.

    The send-off part is not inside a monitor. As a result that last block of script is being carried out at campaign start, before the FactionTurnStart script.

    My example showed what to do but not where to put it. Not explicitly; it is what I meant by "after the transfer". Your script should look like this...

    Code:
    monitor_event FactionTurnStart FactionType poland
     spawn_army
       faction spawnpool ;x 120, y 449
       character Morna, named character, age 30, x 88, y 362, direction S
       unit  Guardia_bruti    exp 2 armour 0 weapon_lvl 0
     end      
     give_everything_to_faction spawnpool poland false
    
     ;you may as well give him his traits here rather than from a separate monitor
     console_command give_trait "Morna" GoodCommander 1
     console_command give_trait "Morna" Maschera_Bianca 1
    
     ;change bodyguard
     send_character_off_map Morna
     spawn_army
      faction poland
      character  Morna, named character, x 88, y 362
      unit  Guardia_bruti    exp 2 armour 0 weapon_lvl 0
     end
    
    terminate_monitor
    end_monitor
    However, and I forgot to mention this, his portrait will be "dead". To avoid that you can either move him into a settlement before the send-off, give his first spawned army another unit (which will remain behind), or give him a custom portrait that has an "alive" looking "dead" one.

    EDIT: OP updated with this information.
    Last edited by Withwnar; February 26, 2012 at 01:15 AM.

  13. #33

    Default Re: Unique Names (and avoiding labels)

    Many thanks for your quick reply. I will fix it.

  14. #34
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Unique Names (and avoiding labels)

    I just realised that a "catholic" spawnpool faction will appear on the Pope scroll. OP updated with a solution.

    Also, attached to the OP is a zip containing the files which set up spawnpool as described in that post.

  15. #35
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Unique Names (and avoiding labels)

    When I run the example from the OP I have "Spawn Pool" appearing in the Diplomacy (Overview / Faction Summary) scroll and it remains there.

    But in TATW I am not getting this behaviour. There the spawning faction is a modified Hungary, rather than a new faction. I thought that I had tested for this when writing the tutorial but maybe I forgot.

    Is anybody else getting this behaviour and/or have any ideas what could be causing it here but not with TATW's Hungary?

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

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

    Default Re: Unique Names (and avoiding labels)

    I have been using the method in 1648 and that faction never showed up. Could it be that the "spawnpool" faction hasn't got a family tree in the descr_sm_factions entry? Because that would be a classical case of the 'immortal faction' - happened to the guys at TATW in an earlier version with the Orcs - those buggers just didn't want to disappear\die. All because they had "has_family_tree no" in descr_sm_factions.










  17. #37
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Unique Names (and avoiding labels)

    You, sir, are an absolute legend. That's exactly what it was. Thanks a bunch. I'll update the OP.

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

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

    Default Re: Unique Names (and avoiding labels)

    One is glad to be of service
    Spoiler Alert, click show to read: 
    (It does scare me sometimes how good I am)
    Spoiler Alert, click show to read: 











  19. #39
    UndyingNephalim's Avatar Primicerius
    Patrician Artifex

    Join Date
    Jan 2011
    Posts
    3,967

    Default Re: Unique Names (and avoiding labels)

    I'm having and odd problem with the script. It seems whenever I give everything from a faction to a target faction their units just disappear. Even more odd is that when I get rid of the give everything line the named characters that I'm spawning are given to the Slave faction rather then my placeholder faction (I'm using the Saxons for that). Might I have don something wrong in my script?
    Code:
    monitor_event FactionTurnStart FactionType hylian
        and not IsFactionAIControlled
        and I_TurnNumber = 0
            add_events
                event    historic    GAMESTART_HYLIAN
                date    0
                event    historic    Hero_PrincessZeldaI
                date    0
           end_add_events
            
         spawn_army 
                faction saxons
                character    Princess_Zelda_I, named character, age 22, x 147, y 122, direction E
                unit        Princess Zelda I     exp 0 armour 0 weapon_lvl 0
    
            end
            
            give_everything_to_faction saxons hylian false
                  
        terminate_monitor
    end_monitor

  20. #40
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Unique Names (and avoiding labels)

    when I get rid of the give everything line the named characters that I'm spawning are given to the Slave faction rather then my placeholder faction
    That is correct. You need the give_everything_to_faction part otherwise you are just effectively emerging the faction (saxons). I'm not sure why the slaves end up with them but the whole point of this technique is to give the character to a specific faction: the give_everything target faction.

    Is hylian a faction that already exists on the map when you are trying this? I can't recall trying it on a faction that does not yet exist. Again, that's not really its purpose (emerging a faction).

    whenever I give everything from a faction to a target faction their units just disappear
    Whose units? saxons? In your script they only have one 'unit': the named character you are spawning.

    The OP mentions the possibility that the unit ("Princess Zelda I" in your script) might need to belong to both the FROM and TO factions. Unit ownership (EDU) I mean.

    Other than these points I would double check that the saxons faction has been set up as described in the OP.

Page 2 of 5 FirstFirst 12345 LastLast

Posting Permissions

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