Results 1 to 30 of 35

Thread: Invisible buildings?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: Invisible buildings?

    Quote Originally Posted by Epistolary Richard
    monitor_event CharacterTurnEnd AgentType = spy
    and FactionType britons
    and SettlementBuildingExists = stone_wall
    and RandomPercent < 20
    Hopefully it is so easy.
    I thought that you should specify in the script:
    - which settlement is that
    - that the spy is there at the moment

    What I understand from that script is:
    - the game check every briton spy
    - the game search for a settlement where the stone_wall exists (irrespective whether the spy is there or not)
    - then the game applies the random percent

    What happens with the spies that are out of a settlement?
    Am I wrong?

  2. #2
    Member Member Dromikaites's Avatar
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    151

    Default Re: Invisible buildings?

    Quote Originally Posted by Monkwarrior
    Hopefully it is so easy.
    I thought that you should specify in the script:
    - which settlement is that
    - that the spy is there at the moment

    What I understand from that script is:
    - the game check every briton spy
    - the game search for a settlement where the stone_wall exists (irrespective whether the spy is there or not)
    - then the game applies the random percent

    What happens with the spies that are out of a settlement?
    Am I wrong?
    Every time the spy enters a city which does not belong to his faction, he fires the SpyMission event. This is the event to be intercepted by the trigger for acquiring the ancillary. According to the documentation the event returns among other parameters the region_id, which means the spy and the city are "tied" to each other.

    Please try to see if it works. I will do it myself this week-end when I have more time and report back, but I guess you need an answer faster than that.

  3. #3
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: Invisible buildings?

    Only partial success.

    I've created a new trait, wall_builder (useless at the moment) and a new ancillary, wall_builder. These are the entries in export_descr_ancillaries.
    Code:
    ;------------------------------------------
    Ancillary wallbuilder_ancillary
        Image scribe_ancillary.tga
        Description wallbuilder_ancillary_desc
        EffectsDescription wallbuilder_ancillary_effects_desc
        Effect SiegeDefence  1 
        Effect Construction  10 
    
    ;------------------------------------------
    Trigger trigger_wallbuilder_ancillary
        WhenToTest CharacterTurnEnd
        Condition EndedInSettlement
              and SettlementBuildingExists >= stone_wall
              and AgentType = spy
    
        AcquireAncillary wallbuilder_ancillary chance  100
    The effects are only to test the ancillary. The chance 100 is only to speed up the test.
    This is the effect in game.

    On the left, the spy before entering Rome. On the right, the same spy after staying in Rome for a turn.
    Of course, it is necessary to complete also export_descr_ancillaries_enum and export_ancillaries.

    The problem comes from the next step. I tried to trigger a show_me script with an advice about the new technology. These are the entries in export_descr_advice:
    Code:
    ;------------------------------------------ Barbarian Walls advice below		
    AdviceThread Stone_Wall_Technology_Thread		
    	GameArea Campaign	
    
    	Item Stone_Wall_Technology_Text_01	
    		Uninhibitable
    		Verbosity  0 
    		Threshold  1  
    		Attitude Normal
    		Presentation Default
    		Title Stone_Wall_Technology_Text_01_Title
    		Text Stone_Wall_Technology_Text_01_Text1
    
    ;------------------------------------------ Barbarian Walls trigger
    Trigger 3001_Stone_Wall_Technology_Trigger
        WhenToTest FactionTurnStart
    
        Condition FactionIsLocal 
              and FactionwideAncillaryExists wallbuilder_ancillary true               
    
        AdviceThread Stone_Wall_Technology_Thread  0
    Unfortunately the game (still RTW) doesn't seem to recognize the condition FactionwideAncillaryExists, although there is no error message from -show_err.
    As a result, the advice appears just at the start of the campaign.

    I've been thinking about the possible script.
    Do you think that it would be necessary one script per faction and in each script all the settlement must be checked one by one?

    Any idea?

    P.S.: do you think that it would be better to implement this kind of things through a background script?

  4. #4
    Member Member Dromikaites's Avatar
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    151

    Default Re: Invisible buildings?

    Quote Originally Posted by Monkwarrior
    Unfortunately the game (still RTW) doesn't seem to recognize the condition FactionwideAncillaryExists, although there is no error message from -show_err.
    As a result, the advice appears just at the start of the campaign.
    FactionwideAncillaryExists is not implemented in RTW. It will only become available in BI. What you can do before getting your hands on BI is to test the code with a particular spy (one you know his name, say Burubista). You make Burubista enter a city with stone walls and then check only Burubista's ancillary.

    Since in RTW you need to go through all the possible names, to check if they are spies and then if they have the constructor de murallas (wall builder), the code is a pain in the butt. FactionwideAncillaryExists simplifies the code.

    To me the images show that your code actually works because the dude gets his constructor de murallas. Congratulations!
    Last edited by Dromikaites; 09-29-2005 at 11:43. Reason: Expanding it

  5. #5
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: Invisible buildings?

    @E. Richard
    You are probably right, but my idea was to try a more general script, not only for a given faction, if it is possible, of course.
    In fact, the ancillary could be restricted to some factions using the ExcludeCultures command, which is often used in export_descr_ancillaries.
    In any case, I will try a background script with your idea just to test this syntax.

    @Dromikaites
    In the meantime, I will try your idea. As I know that Burubista is the spy I'm using, I will work with this just to see if the script is correct.

    @ Both of you
    I was wondering if we could play a little bit with the faction_capability.
    Would there be any type of capability that we can put as requirement for the first, invisible, building? Could we give this capability to a faction through scripting?
    The problem with the ancillary is that it is given only to the spy. That means that if it is killed in the next turn, the faction losts the ancillary. The capability would be permanent, irrespective of the characters alive in each moment of the campaign.

    Another point is if there is some "general way" to detect the settlements owned by a given faction and to build a building in all of them.
    I didn't find anything like this (all the commands of creation of buildings require the name of the settlement), so the script should contain a check for every settlement in the map.

  6. #6
    Member Member Dromikaites's Avatar
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    151

    Default Re: Invisible buildings?

    Quote Originally Posted by Monkwarrior
    @ Both of you
    I was wondering if we could play a little bit with the faction_capability.
    Would there be any type of capability that we can put as requirement for the first, invisible, building? Could we give this capability to a faction through scripting?
    The problem with the ancillary is that it is given only to the spy. That means that if it is killed in the next turn, the faction losts the ancillary. The capability would be permanent, irrespective of the characters alive in each moment of the campaign.

    Another point is if there is some "general way" to detect the settlements owned by a given faction and to build a building in all of them.
    I didn't find anything like this (all the commands of creation of buildings require the name of the settlement), so the script should contain a check for every settlement in the map.
    faction_capability extends the benefits of a particular building to all the cities belonging to a faction, not to only those having that building present. It turns a building into a wonder.

    So it's not about what a "faction can do" but about "what a building can do for a faction". Of course you can indirectly test the faction_capability by testing if a building that gives such faction-wide benefits is present in any of the faction's cities.

    As for the second question you are in the "pain in the butt" territory: you need to loop through all the settlements on the map, check if they are local (i.e. they belong to the current faction) and then check if they have the building present. If not, build it.
    Last edited by Dromikaites; 09-29-2005 at 12:30.

  7. #7

    Default Re: Invisible buildings?

    Quote Originally Posted by Monkwarrior
    You are probably right, but my idea was to try a more general script, not only for a given faction, if it is possible, of course.
    You can extend it to other factions by duplicating the monitor and replacing britons with gauls, for example.

    You could get rid of the faction requirement altogether, but you need it to be able to determine which faction needs to be able to get the capability.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  8. #8
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: Invisible buildings?

    Current status:

    Created a new trait

    Code:
    ;------------------------------------------
    Trait WallBuilder
        Characters spy
    
        Level WallBuilder
            Description WallBuilder_desc
            EffectsDescription WallBuilder_effects_desc
            Threshold  1 
    
    ;------------------------------------------
    Trigger wallbuilder
        WhenToTest CharacterTurnEnd
    
        Condition AgentType = spy
              and FactionCultureType barbarian
              and SettlementBuildingExists >= stone_wall
    
        Affects WallBuilder  1  Chance  100
    Created a background script:
    Code:
    script
    	
    	monitor_event CharacterTurnEnd AgentType = spy
    		and Trait WallBuilder >= 1
    		and SettlementName Patavium
    		console_command create_building Patavium stone_wall_prerequisite
    		console_command add_money -3000
    		terminate_monitor
    	end_monitor
    	
    	while TrueCondition
    	end_while
    
    end_script
    Added the building:
    Code:
    building stone_wall_prerequisite
    {
        levels stone_wall_prerequisite
        {
            stone_wall_prerequisite requires factions { barbarian, } and hidden_resource stone_wall_pre
            {
                capability
                {
                }
                construction 0
                cost  3000
                settlement_min town
                upgrades
                {
                }
            }
        }
    }
    Edited the require clause of the larger walls:
    Code:
     requires factions { ct_carthage, eastern, parthia, egyptian, greek, roman, } or building_present_min_level stone_wall_prerequisite stone_wall_prerequisite
    This works fine so far, I was able to build stone walls in Patavium after changing descr_strat so that it is a city and spying in Rome ;)
    One'd have to do this for every city on the map but that's okay, you can copy&paste and only have to change the settlement name.
    The downside of this is that the player may wonder why he just lost 3000 denarii, I'm planning to advance an advice telling him.

    I haven't done much more testing yet, I'll post another update this evening.

  9. #9

    Default Re: Invisible buildings?

    Quote Originally Posted by Monkwarrior
    Hopefully it is so easy.
    I thought that you should specify in the script:
    - which settlement is that
    - that the spy is there at the moment

    What I understand from that script is:
    - the game check every briton spy
    - the game search for a settlement where the stone_wall exists (irrespective whether the spy is there or not)
    - then the game applies the random percent

    What happens with the spies that are out of a settlement?
    Am I wrong?
    I've not tested this but here is my logic:

    This is the event:

    ---------------------------------------------------
    Identifier: CharacterTurnEnd
    Event: A Character has finished its turn
    Exports: nc_character_record, character_record, faction, region_id, character_type, settlement
    Class: ET_CHARACTER_TURN_END
    Author: Guy

    Note that the event has a settlement export, that export relates to the specific city that the character is in. That is why you can have SettlementName as in the following example from vanilla prologue

    monitor_event GeneralCaptureSettlement FactionType romans_julii
    and SettlementName Messana

    This monitor fires when the general captures Messana, not when the general captures the city and a city called Messana exists somewhere.

    So:

    monitor_event CharacterTurnEnd AgentType = spy
    ; Check each spy at the end of their turn turn
    and FactionType britons
    ; Check to see if their faction type is Britons
    and SettlementBuildingExists = stone_wall
    ; Check to see if the settlement they're in has a stone wall
    and RandomPercent < 20
    ; Apply random percent

    The only confusion in that script, I think perhaps, will be between whether the agent has to be Britons or whether the settlement has to be Britons. Without testing it, I couldn't tell you how the game is reading it.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO