Results 1 to 5 of 5

Thread: specific character in specific place...

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    SpyrosM91's Avatar Despotes
    Join Date
    Aug 2010
    Location
    Patras, Greece
    Posts
    3,675

    Default specific character in specific place...

    i'm willing to make a simple script for a byzantine conversion.... the section i want help is the one that contains all the conditions:

    i want the Faction Leader(with a trait) and the Patriarch(with an anc and a trait) to go to Rome, so that the player can be asked wether he likes the union or not.... the reasonable way is to use the "I_CharacterTypeNearTile byzantium <character type>, 0 310, 141" condition... BUT, check out below....
    Code:
        monitor_event CharacterTurnEnd CharacterIsLocal 
        and I_LocalFaction byzantium 
        and Trait Priest_Level >= 5 
        and HasAncType Patriarch_Roman 
        and I_CharacterTypeNearTile byzantium priest, 10 310, 141  
     
            ;historic event...
            ;.....things.... 
     
        end_monitor
    the monitor works in the end of the "character turn"....and for our faction, it checks:
    CharacterIsLocal - true for every character
    I_LocalFaction - true for every character
    Trait - true only for the Patriarch
    HasAncType - true only for the Patriarch
    I_CharacterTypeNearTile -...

    the faction will always have a patriarch, so by his "CharacterTurnEnd" these 2 conditions will be true...plus those other two in the beginning.... we have 4/5 conditions true...

    the problem occurs if another priest... a simple one (and not the Patriarch)... is near Rome... then, in the Patriarch's "CharacterTurnEnd", the last condition will be true also.... (since it doesn't refer to any specific character... but to a anyone who is near that tile...) THUS MAKING THE EVENT TO FIRE....ALBEIT WRONGLY...


    so, i need some suggestions how can i solve this, or bypass it....
    Proud Tsardoms Total War: Historian - Coder - Scripter - Mapper

  2. #2

    Icon1 Re: specific character in specific place...

    SpyrosM91: The easiest thing to do would be to replace ‘I_CharacterTypeNearTile byzantium priest, 10 310, 141’ with ‘IsRegionOneOf Roman_Province’. That way the script will only trigger when a priest with the ‘Patriarch’ ancillary ends his turn in that province:
    Spoiler Alert, click show to read: 
    Code:
    	monitor_event CharacterTurnEnd CharacterIsLocal 
        		and I_LocalFaction byzantium 
        		and Trait Priest_Level >= 5 
        		and HasAncType Patriarch_Roman 
    		and IsRegionOneOf Roman_Province
     
            	;historic event...
            	;.....things.... 
     
        	end_monitor

  3. #3
    SpyrosM91's Avatar Despotes
    Join Date
    Aug 2010
    Location
    Patras, Greece
    Posts
    3,675

    Default Re: specific character in specific place...

    and as always, TNZ comes to the rescue..!!

    thanks!! (+rep)... so that you can get yourself a red fleur-de-lis...
    Proud Tsardoms Total War: Historian - Coder - Scripter - Mapper

  4. #4
    SpyrosM91's Avatar Despotes
    Join Date
    Aug 2010
    Location
    Patras, Greece
    Posts
    3,675

    Default Re: specific character in specific place...

    one question, what does the condition: "IsPositionInRect 5 10 40 140" do??? will it work in my case??
    Proud Tsardoms Total War: Historian - Coder - Scripter - Mapper

  5. #5

    Icon1 Re: specific character in specific place...

    SpyrosM91: No. The ‘IsPositionInRect’ condition only works with these three events:
    Spoiler Alert, click show to read: 
    docudemon_conditions:
    Code:
    ---------------------------------------------------
    Identifier:              IsPositionInRect
    Trigger requirements:    sm_position
    Parameters:              left top [width height]
    Sample use:              IsPositionInRect 5 10 40 140
    Description:             Test is a tile in specified rectangular area?
    Battle or Strat:         Strat
    Class:                   IS_POSITION_IN_RECT
    Implemented:             Yes
    Author:                  Grig
    ---------------------------------------------------
    docudemon_events:
    Code:
    ---------------------------------------------------
    Identifier:         TileSeen
    Event:              The tile has been seen by faction
    Exports:            faction, region_id, sm_position
    Class:              ET_TILE_SEEN_FACTION
    Author:             Grig
    ---------------------------------------------------
    Code:
    ---------------------------------------------------
    Identifier:         ObjSeen
    Event:              An object of target faction has been seen by faction
    Exports:            faction, target_faction, region_id, sm_position
    Class:              ET_OBJ_SEEN_FACTION
    Author:             Grig
    ---------------------------------------------------
    Code:
    ---------------------------------------------------
    Identifier:         ArmyTakesCrusadeTarget
    Event:              Army has taken crusade/jihad target settlement
    Exports:            army, faction, religion, region_id, sm_position, crusade, target_settlement, target_region_id, target_faction, target_religion
    Class:              ET_ARMY_TAKES_CRUSADE_TARGET
    Author:             Grig
    ---------------------------------------------------

Posting Permissions

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