scripter64
Wolved
posted 02-12-19 08:21 AM
CT (US)
1 / 13
Hi! The answer depends on the game version that you're using (CD v1.0c, HD, UP). Please also provide an example of which units you'd like to control and what you'd like them to do.
scripter64
Wolved
posted 02-12-19 12:48 PM
CT (US)
6 / 13
That rule alone won't work since it will run on the first second of the game and disable itself, so it won't affect things later on. To force them to garrison every 10 seconds:
(defconst tm-garrison 20)
(defconst timer-running 2)
(defconst new-unit 101) ;redefine to the actual unit type id
(defrule
(true)
=>
(up-gather-inside c: castle c: -1) ;keep garrisoned units inside
(disable-self)
)
(defrule
(up-timer-status tm-garrison != timer-running)
=>
(up-garrison castle c: new-unit) ;put new-unit into castles
(enable-timer tm-garrison 10) ;repeat after 10 seconds
)
scripter64
Wolved
posted 02-13-19 11:07 AM
CT (US)
10 / 13
What is the unit id of your new unit? Unit ids 900-999 are reserved for classes. For UP v1.5, 1000-1959 can be used for units, but it's best to keep AI controlled units and buildings between 0-899.