HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

need help with triggers

03-17-2004, 05:53 PM#1
Pyrus
i have a lot of problems and i'll list them all here
1. I want to make timers when a spell is casted for the targets of the spell, to tell the duration, without having to declare multiple timers in the beginning.
2. As an alternative i was thinking of using buffs so how do i tell when a buff is removed/expired.
3. I want to give a certain item to ALL units of a specific type (eg all footmen) after a requirement is met.
4. I need to be able to detect that an upgrade is researched in conditions.
5. Custom values. How do i detect them in conditions.

I have some more but cant remember them at the moment.
03-17-2004, 06:24 PM#2
Ligature
1) I'm not quite sure what you mean by "making timers when a spell is cast for the targets of the spell, to tell the duration, without having to declare multiple timers in the beginning." At a guess, I'd say you're going to need a unit array, and use the targets' custom values to tell how long until they get hit with the spell / the spell wears off. Since it sounds like you're already using custom values, I suggest using arrays to store the values you're putting in the custom values and instead using the custom values to tag units with their index in the arrays.

2) WorldEdit triggers are terrible with detecting anything about buffs, so I would say not to try doing it that way.

3) Wait, didn't you just ask this yesterday? Use action "Hero - Create item for hero." And I would use a pick all units loop, but if you're using arrays it might be quicker to use a for loop...

4) Hold on here... I saw this on the board yesterday too. You asked this and someone answered, right? They said there's a function to get the current level of a particular upgrade for a player as an integer... why don't you use that?

5) Use function "Custom Value of Unit." it returns an integer.

Hang on... is your problem that you don't know how to use functions in conditions? To use an integer function just set up an Integer Comparison. It's the second drop-down box in the "Configure Condition" window. Then you can say "Current level of ResearchX for PlayerY is greater than or equal to 1." Get me?

Good luck man.
03-17-2004, 07:04 PM#3
Pyrus
would you look at that, i found out something new today. Thanks man, that function thing should really help.

The reason why i posted it here is because no one was responding, like you did. I was following a trend that if the thread goes unanswered then the next day it is very likely to get pushed to the next day due to the heavy traffic and cause people like me are too lazy to go to the next page and check old stuff the thread remains unanswered.

I'm not sure that "Hero - Create item for hero." works for normal units with inventory causei tried it and doesn't. Or maybe im doing something wrong. I want the units to be able to use items but not drop/pick up cause the only items i want them to have are the ones i give them through triggers.

I realise i wasnt too clear about the timer thing. sorry about that. The thing is i want to do some actions when the buff is expired. I'm now experimenting with custom values and arrays so i would appreciate it if you could walk me through here.