| 08-05-2004, 10:06 PM | #1 |
is there a way to give a unit a buff wen a propety reaches a certain number cos im trying to get it to make a unit lose health wen wood reaches zero and be slowed wen it reaches about 200. can please help cos i no that this is probably a noob question but i cant think of the answer. ![]() |
| 08-06-2004, 12:02 AM | #2 |
um....... huh? I don't know that I quite understand you. But if you mean what I think I mean, do this: Events: Player - Player Properties Player1 (Red)'s Current lumber becomes Greater than or equal to 200 Conditions Put whatever you want in here Actions Do whatever you want. Once complete, do another trig with an event that's exactly the same, only that says "less than" instead of "greater than or equal to" and then do whatever conditions and actions you want, if you want something different to happen if the property decreases. If you want something to happen at and exact number and ONLY that number (like zero) then do a trigger that says "equal to"... you get the point. I hope this was what you wanted. |
| 08-06-2004, 01:05 AM | #3 | |
Quote:
|
| 08-06-2004, 01:59 AM | #4 |
Well, you could always add a special effect to the unit, and (this is my of doing a looping effect, different people do it different ways) and add a countdown timer (repeating) that expires every (whatever) seconds. Then have a new trigger that has when the timer expires, Unit - Set Life (Value): Set life of (Whatever unit) to <this is a Unit - Property> (life of (whatever unit)) <this is an arithmatic> -<any number you want>. I did that quickly. I hope you understand it, and that it works. |
| 08-06-2004, 02:04 AM | #5 | |
Quote:
|
| 08-06-2004, 02:27 AM | #6 |
(I dont know which trig you want to turn off) It will need another trig, but just go: Event: <whatever happens> Condition <whatever> Action: Turn off (Whatever trigger you want to turn off) |
| 08-06-2004, 02:32 AM | #7 |
i want to turn off the action where the target unit loses health wen your wood goes up. p.s is there a way to slow down the unit wen wood goes back above 0. |
| 08-06-2004, 02:46 AM | #8 |
All you have to do is have your trigger say: when your lumber amount is greater than or equal to a certain number, pause (timer) (!DONT FORGET that the timer is a variable, and that 'your trigger' is a SEPARATE trigger!). And as for the p.s... all you have to do is Unit - Set Movement speed. That's a simple one. Just make the movement speed really low. If you want the attack speed to get lowered as well, I suggest (instead) creating a dummy unit with cripple or slow for the other team (and the locust or Aloc ability) and having it cast the spell, then being removed. I think that's how most people here would do it. |
| 08-06-2004, 02:50 AM | #9 | |
Quote:
ill just use move speed but thanks for the help and other ideas |
| 08-06-2004, 03:30 AM | #10 |
srry, there's a little thunderstorm around my place at the moment...had a power outage... I gotta check - I'll edit the post when I've got it figured out... oh, and as you seem to be new here... if somebody helps you out, it's nice when you click on that person's reputation bar and give them a positive rep (approve). [edit]: I think that it should be auto if you do it right. If it's not, put down a full description of all the triggs used, and I'll look them over to see what's wrong. I'm not quite with it right now, as it's very late, and I feel kinda messed. |
| 08-06-2004, 05:42 AM | #11 |
OK, here's how I would do this: First a trigger with the event "time - periodic event" that runs every second and decreases the hp of a unit, or all units in an unit group if you can have multiple units affected by this (if it's multiplayer, you need to check it for every player; just do a loop that goes from 1 to 12 and for each of these players checks their lumber and if it's 0, it damages their units). Then, for the movement speed, all you need is two triggers that change the movement speed: one that lowers it when lumber gets bigger, and one that increases it when lumber drops back down. |
| 08-06-2004, 05:24 PM | #12 |
i think i got the food thing sorted now thanks 4 the help. new problem: making an ability whichgives the player a chance to get an amount if gold of hits. a kind of critical hit but which gives gold instead of doing extra damage. i tried this but it didnt work event: a unit begins casting an ability. condition: ability is equal to mug action: add 10 gold to owner of triggering unit well its summin like that plz try an help |
| 08-06-2004, 05:35 PM | #13 | |
Quote:
Heres your answer! Okay u got the event and conditions right so ur not that noobish. Action- -Set ((an integer variable)) i called it mug) = math-random number between (any #) and (any#) --If (mug = whatever # lets say 10) --then give (owner of casting unit) (any amount of gold) --else do nothing Change the random numbers like between 1-10 to give a 10% chance to whatever amount of chance you want it to be Good Luck! ![]() |
| 08-06-2004, 05:45 PM | #14 |
thanks alot 4 that darkreaper thats alot of help. ill try it now if it dont work ill post again. well it didnt work i think it is cos mug is an edited critical strike so it doesnt count as an ability that is cast. well thats wat i think :> so is there away to have an event wat is wen a unit attacks an enemy. its probably simple but i cant see it. |
| 08-06-2004, 08:15 PM | #15 |
Yeah, the critical strike is not cast, nor can it be detected in any other way. So, just give the unit an ability that does nothing (it can also be critical strike with a 0% chance to do critical) and do the whole thing by triggers. Code:
Events: generic unit event - a unit is attacked Conditions: integer comparison: (level of (mug) for (attacking unit)) greater than or equal to 1 Actions: Now this depends on how you want to do this; it can either be a higher percentage to get gold with each level of ability, or more gold gained. In the first place, when you check if the random number was big enough, instead of checking, if it was equal to 1, you check if it was less than or equal to (level of (mug) for (attacking unit)). If you choose the random integer from 1 to 10, then level 3 mug would give you a 30% chance to get gold in such a case. Otherwise, you keep the chance static and instead put the "level of ability" function into the gold-gain part to get more gold with each level. (You will be giving the gold to the "owner of (attacking unit)") |
