Page 1 of 2 12 LastLast
Results 1 to 20 of 21

Thread: help in scripting is needed

Hybrid View

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

    Default help in scripting is needed

    I have a little question. Knows someone a way to check if particular unit was recruited?

  2. #2

    Icon1 Re: help in scripting is needed

    Try this:
    Code:
    	monitor_event UnitTrained FactionType sicily
    		and UnitType Axemen of Lossarnach		
    				
    	end_monitor
    Or:
    Code:
    	monitor_event UnitTrained UnitType Axemen of Lossarnach		
    				
    	end_monitor

  3. #3

    Default Re: help in scripting is needed

    I'll try it. Thanks.

  4. #4

    Default Re: help in scripting is needed

    it works! Thanks again!

    I have another question: is there a possibility to make possible replenishment of losses without possibility of recruiting new unit?

  5. #5

    Default Re: help in scripting is needed

    is there something what can let me count existing units? I know that there is a condition I_UnitExists. How to use it to count existing units?

  6. #6

    Default Re: help in scripting is needed

    It's not going to work how you want it too... Unless you'd like to explain what you want to acomplish and prove me wrong?

  7. #7

    Default Re: help in scripting is needed

    i look for a way to simulate the militia system. I need something to limit the number of existing units to number of provinces which belongs to specific faction. I know how to count provinces. Now i look forway to cout existing units and to compare those two numbers.

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

    Default Re: help in scripting is needed

    Counting units: I needed this too but could not find a way to do it. Maybe if there is a counter that gets +1 each time one is recruited and -1 each time one is disbanded. But I don't know if UnitDisbanded fires when units are merged or turn rebel.

    is there a possibility to make possible replenishment of losses without possibility of recruiting new unit?
    Code:
    recruit_pool "saus_er_Elven_Rangers"  0   0.111   0.999  0  requires factions { turks, }
    If that red number is less than 1 then recruitment is not possible but retraining is. 0.999 means it can replenish a unit that has 99.9% of its soldiers lost. Change the 0.111 to suit the replenishment rate you need.

  9. #9

    Default Re: help in scripting is needed

    And how works UnitDisbanded for units destroyed in the battle?

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

    Default Re: help in scripting is needed

    I don't know.

  11. #11

    Default Re: help in scripting is needed

    So it's time to tests. The problem is, that i don't know what to look for

  12. #12

    Default Re: help in scripting is needed

    It doesn't, nor are a lot of other possibilities covered. Hence the reason I said it's not going to work like you want it too.

  13. #13

    Default Re: help in scripting is needed

    Is there a possible to add label for specific unit? Not for all of units using the same name but for specific troops?

  14. #14

    Default Re: help in scripting is needed

    No.

  15. #15
    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: help in scripting is needed

    There is: use a custom attribute in the EDU for that unit.

    eg - attributes sea_faring, hide_forest, is_peasant, can_run_amok, militia

    can be used like this:

    destroy_units [faction_name] militia










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

    Default Re: help in scripting is needed

    To a unit he means, not all units of that type.

    You can on the battle map but not the campaign map. Even if you could I don't think it would be practical. e.g. If you have two units of the same type with a label each and then merge them, which label remains?

  17. #17
    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: help in scripting is needed

    That's what I mean, too. You can give individual attributes to units as described.










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

    Default Re: help in scripting is needed

    e.g. If the attribute was "attrX" and given to the "Peasant" unit in EDU then all Peasant units will have the attrX attribute. He wants the ability to uniquely identify one specific unit of Peasants on the map, not all Peasant units on the map.

  19. #19
    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: help in scripting is needed

    That is utterly impossible. It has to be a named character's body guard for that to work.










  20. #20

    Default Re: help in scripting is needed

    Which one of TNZ's suggestions worked?

Page 1 of 2 12 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
  •