Results 1 to 10 of 10

Thread: Replenish unit script question

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Replenish unit script question

    Here is what I have in mind. I would like the game to replenish a general's units whenever he ends his turn in a settlement. Here is what I have so far. I can't get it to work. I only tried with one general, but of course it would be preferable if the script checked all generals for all factions.

    Code:
    script
    	declare_counter loop
    	set_counter loop 0
    	
    		monitor_event FactionTurnStart FactionIsLocal TrueCondition
    			
    			monitor_conditions EndedInSettlement Quintus
    			replenish_units Quintus
    			end_monitor
    		
    		end_monitor
    				
    	while I_CompareCounter loop = 0
    	end_while
    
    end_script
    I checked the the overall script works. If I just ask it to reposition quintus, for example, without checking EndedInSettlement, it works.

  2. #2

    Default Re: Replenish unit script question

    i really don't know if it would effect it but maybe if you aligned replenish units one more tab in.....

    monitor_conditions EndedInSettlement Quintus
    . replenish_units Quintus
    end_monitor

    like so? again just giving idea's as i am just a beginning modder.....

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

    Default Re: Replenish unit script question

    You can't have a monitor inside another one. You could just use the Condition monitor anyways and add "and FactionIsLocal" to it.
    EndedInSettlement doesn't take a parameter, either, you can't check the character name anyhow afaik.
    Last edited by alpaca; 01-09-2006 at 18:54.

  4. #4

    Default Re: Replenish unit script question

    Yep, our inability to check the character's name for anything prevents us from having quite a few neat features
    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

  5. #5
    Shaidar Haran Senior Member SAM Site Champion Myrddraal's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    5,752

    Default Re: Replenish unit script question

    You can get rid of one of the monitors, either by using an 'and' as was suggested, or by using an 'if'. Also, I think that this is how you use EndedInSettlement:

    Code:
    script
    declare_counter loop
    set_counter loop 0
    	
    		monitor_event CharacterTurnStart Quintus		
    			and EndedInSettlement 
    			replenish_units Quintus		
    		end_monitor
    				
    	while I_CompareCounter loop = 0
    	end_while
    
    end_script

  6. #6

    Default Re: Replenish unit script question

    Myyrdal,

    Thanks for your suggestion. Interesting behaviour with your version of the script. If Quintus is NOT in a settlement, his units get replenished. If he IS in a settlement and needs replenishment, the game CTDs. I'll try a couple more things.

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