| 10-01-2003, 04:07 AM | #1 |
I need a trigger that when a unit-type's mana reaches XXX, the unit automatically cast a spell, or the unit automatically converts into another unit. how to do that? I just can't come up with some way to do this..! thxs in adv. |
| 10-01-2003, 04:26 AM | #2 |
Use a periodic event and then a real comparrison to check the unit's mana. If it's greater than X, do action. Something like... Auto Spell ------------------------ <> Events <> <> Time - Periodic <> <> <> Every 0.50 seconds of game time <> Conditions <> <> Real Comparrison <> <> <> (Mana of "Hero") Greater than 149.00 <> Actions <> <> Unit - Issue Order <> <> <> Order ("Hero") to Use spell etc. NOTE - 'Hero' is a unit variable. |
| 10-01-2003, 05:42 AM | #3 | |
Quote:
I tried something like this... but the problem is.... I want it for a UNIT-TYPE... and I can't set a real comparison involving unit-type... that's the problem :() |
| 10-01-2003, 05:51 AM | #4 |
Maybe this will work, then? Code:
Untitled Trigger 001
Events
Time - Every 0.50 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Units in (Playable map area) matching (((Unit-type of (Picked unit)) Equal to Whatever) and ((Mana of (Picked unit)) Greater than or equal to 150.00))) and do (Actions)
Loop - Actions
(whatever) |
| 10-01-2003, 10:48 AM | #5 |
I think periodic event it's a lag-friend system... I suggest to use the event: Unit - A unit Finishes casting an ability Mana decrease after an ability have been casted. |
| 10-01-2003, 11:28 AM | #6 |
Is there not a "unit type enters region" event? then you could work your conditions and actions of "triggering unit" |
| 10-01-2003, 01:37 PM | #7 |
He wants the event to occur periodically, not after an ability is casted. Use Pirogen's if you want the correct way. I didn't know that you needed unit type. .5 second trigger won't lag, it when you get down to the .1 etc. periodics. |
| 10-01-2003, 01:52 PM | #8 |
After releasing the first alpha version of my map, I started to hate periodic events, and loops, forget about them, only use them when it is really needed This solution to your problem doesn't use them: 1) Make this trigger Name this Trigger "Trigger A" Events: -none Conditions: -none Actions: -Order (Triggering unit) to Use spell etc. Sounds weird doesn't it? Then make this trigger Events: -A unit enters (playable map area) Conditions: -Unit type of (Triggering unit) equal to the unit type you want Actions -Trigger - Add event - To (Trigger A <gen>) add the event (Triggering unit) mana becomes greater than or equal to XXX If you already have some of those units in your map: Events : Map initialization Conditions: none Actions: Pick every unit in (Playable map area) matching (Unit type of (matching unit) equal to (The Unit type you want) and do (actions) -Trigger - Add event - To (Trigger A <gen>) add the event (Picked unit) mana becomes greater than or equal to XXX |
