Results 1 to 12 of 12

Thread: Rebel attack script, Help!

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VINC.XXIII's Avatar Retired
    Join Date
    Mar 2009
    Location
    Oxybian hills
    Posts
    4,644

    Default Rebel attack script, Help!

    Good morning, I would know if its possible to give a regional assignation to the emergent rebels?
    My rebel script is working good, but I see the rebels emerged with only "Huge rebels city" or "Rebel Army" as name
    I would give to them the name of true territorial rebels present in the descr_rebel_factions.
    My second question is: its possible to make a emergent rebel script recurrent? With percentage chance,etc...
    That could be very accurate by this way

    the script:
    monitor_event FactionTurnStart FactionType Slave
    and I_TurnNumber > 3

    if not I_SettlementOwner Dijon = slave
    spawn_army
    faction slave sub_faction france
    character Jean, named character, age 25, x 123, y 123, family
    traits GoodCommander 5
    unit NE Bodyguard exp 5 armour 0 weapon_lvl 0
    unit Armored Sergeants exp 5 armour 0 weapon_lvl 0
    unit Armored Sergeants exp 5 armour 0 weapon_lvl 0
    unit Armored Sergeants exp 5 armour 0 weapon_lvl 0
    unit Armored Sergeants exp 5 armour 0 weapon_lvl 0
    unit Armored Sergeants exp 5 armour 0 weapon_lvl 0
    unit Armored Sergeants exp 5 armour 0 weapon_lvl 0
    unit Hand Gunners exp 5 armour 0 weapon_lvl 0
    unit Hand Gunners exp 5 armour 0 weapon_lvl 0
    unit Free Company Longbowmen exp 5 armour 0 weapon_lvl 0
    unit Free Company Longbowmen exp 5 armour 0 weapon_lvl 0
    unit Free Company Longbowmen exp 5 armour 0 weapon_lvl 0
    unit Free Company Longbowmen exp 5 armour 0 weapon_lvl 0
    unit Hand Gunners exp 5 armour 0 weapon_lvl 0
    unit Chivalric Knights exp 5 armour 0 weapon_lvl 0
    unit Chivalric Knights exp 5 armour 0 weapon_lvl 0
    unit Chivalric Knights exp 5 armour 0 weapon_lvl 0
    unit Chivalric Knights exp 5 armour 0 weapon_lvl 0
    unit Chivalric Knights exp 5 armour 0 weapon_lvl 0
    end
    siege_settlement Jean, Dijon, maintain
    terminate_monitor
    end_if
    terminate_monitor
    end_monitor



    And thanks in advance

  2. #2
    boboav's Avatar Decanus
    Join Date
    Sep 2009
    Location
    Italy
    Posts
    532

    Default Re: Rebel attack script, Help!

    for create a percentage chance:

    generate_random_counter CounterName 0 10 (from 0 to 10 for example).

    if CounterName < 8
    spawn_army
    ...
    end
    ...
    end_if

    if counter_name >= 8
    ...
    end_if
    Modder of "Bellum Crucis" and "De Bello Mundi"

  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: Rebel attack script, Help!

    Good morning, I would know if its possible to give a regional assignation to the emergent rebels?
    Are you talking about the randomly appearing rebels or spawned rebels?
    In the first case (random) they should have the name as assigned via descr_rebel_factions.txt and their entry in data\text\rebel_factions_descr.txt, depending on the region.
    For spawned rebels I have never checked, to be honest. But I assume they are like any other spawned army - simply another army, no special assignment name.










  4. #4
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Rebel attack script, Help!

    You have to alter the script - Stick and randompercent in there. Make the script dependant on a counter, make the counter enable the script dependant on Jean dying.

    It is impossible to specify a rebel faction for a spawned army.

  5. #5
    VINC.XXIII's Avatar Retired
    Join Date
    Mar 2009
    Location
    Oxybian hills
    Posts
    4,644

    Default Re: Rebel attack script, Help!

    "spawned rebels?"
    yes, Gi. spawned rebels, I have yet changing this files for the slave factions


    "like any other spawned army - simply another army, no special assignment name. "

    "It is impossible to specify a rebel faction for a spawned army. "

    Its so bad, its very important that they have this regional assignation,
    something could help them to merging with another rebel army, in taking the name of the regional rebel faction?


    "for create a percentage chance:

    generate_random_counter CounterName 0 10 (from 0 to 10 for example).

    if CounterName < 8
    spawn_army
    ...
    end
    ...
    end_if

    if counter_name >= 8
    ...
    end_if " very useful

    well thanks guys for your answers, ever usefuls!!

    I back to my script

  6. #6
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Rebel attack script, Help!

    monitor_event FactionTurnStart FactionType Slave
    and I_TurnNumber > 3
    and RandomPercent > 10

    That's what I meant, that gives the script a 9 in 10 chance of firing.

    and RandomPercent < 11

    That's one way to give it a 1 in 10 chance.

    This way the script monitor is not firing every turn like it will for an if statement.

    Remove the 'terminate_monitor' commands or the script will only fire once (you want recurrent).

    And add an in 'I_CharacterExists Jean' condition, like so:

    monitor_event FactionTurnStart FactionType Slave
    and I_TurnNumber > 3
    and not I_CharacterExists Jean
    and RandomPercent > 10

    This will prevent the script firing while the spawned army already exists.
    Last edited by Taiji; January 07, 2011 at 07:26 PM.

  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: Rebel attack script, Help!

    not needed










  8. #8
    VINC.XXIII's Avatar Retired
    Join Date
    Mar 2009
    Location
    Oxybian hills
    Posts
    4,644

    Default Re: Rebel attack script, Help!

    great Taiji!!

  9. #9
    VINC.XXIII's Avatar Retired
    Join Date
    Mar 2009
    Location
    Oxybian hills
    Posts
    4,644

    Default Re: Rebel attack script, Help!

    Great thanks to all, guys!

  10. #10
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Rebel attack script, Help!

    You're welcome, and best of luck

  11. #11
    w.wallace61's Avatar Civis
    Join Date
    May 2009
    Location
    Where Another Bagpipe is Being played :)
    Posts
    132

    Default Re: Rebel attack script, Help!

    I recently trying to find if its possble to do it with not a rebel army with a national army..paris is england's land for example and a french army appears.. simply like that..

  12. #12
    VINC.XXIII's Avatar Retired
    Join Date
    Mar 2009
    Location
    Oxybian hills
    Posts
    4,644

    Default Re: Rebel attack script, Help!

    "character Jean, named character" that is for the Duché of Bourgogne^^

    "french army appears.. simply like that.. ", of course!! and a lot of "riots"/feudal or communal reaction are planned for Sicilian Vespers 4.0, in submod.
    You could have a lot of realistic difficulties, according the potential historicity...
    Scottish loyalist band against English invaders, English reaction against the Scotish raids in Cumberland...
    African Tribal rebellions against Arabics or Portugueses/Castillans colons...
    Game become just great.

    And credits to all coders who had gived me the help/possibility to improve these ideas, with a lot of patience^^
    Taiji, Gigantus was ever answering about this, thanks again guys, my SV self mod is better like that...and by this ,a lot of SV's fans will have better feels...
    Last edited by VINC.XXIII; January 27, 2011 at 04:12 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
  •