Log in

View Full Version : while/ if instead of monitor_conditions



webwing
07-09-2008, 00:11
I'm starting to do some Historical Battles script.

I'm having trouble to make monitor_conditions work. I need some help please.

The script works ok but I tried everything with the monitor_conditions and no success so far.
I ended up using a while loop and a conditional if instead and it does what I wanted but it was just good for testing since what I need is a recurring checking while other things are happening.



while nada < 1

if I_UnitDistanceFromUnit knights1 alfred > 30


release_unit mercs1
unit_order_attack_unit mercs1 alfred run
unit_set_morale mercs1 impetuous
unit_set_experience mercs1 3
unit_set_formation_spacing mercs1 tight


release_unit mercs2
unit_order_attack_unit mercs2 knights1 run
unit_set_morale mercs2 impetuous
unit_set_experience mercs2 4
unit_set_formation_spacing mercs2 tight

battle_wait 30
release_unit adam


battle_wait 20
unit_unset_morale mercs2
unit_unset_morale mercs1

set_counter nada 1

end_if


end_while


This is how it should be but does not work




monitor_conditions I_UnitDistanceFromUnit knights1 alfred > 30

release_unit mercs1
unit_order_attack_unit mercs1 alfred run
unit_set_morale mercs1 impetuous
unit_set_experience mercs1 3
unit_set_formation_spacing mercs1 tight


release_unit mercs2
unit_order_attack_unit mercs2 knights1 run
unit_set_morale mercs2 impetuous
unit_set_experience mercs2 4
unit_set_formation_spacing mercs2 tight

battle_wait 30
release_unit adam

battle_wait 20
unit_unset_morale mercs2
unit_unset_morale mercs1

terminate_monitor
end_monitor




I'd really appreciate any help.

Thanks.