Warcraft III resources & community, 2003–2006 · archived

Linking spells to upgrades

29 posts
#16
Hmm... as I suspected. WEll, I'll get your triggers done. I'll edit this post later.
#17
thanks mate :) let me know by bumping the thread or pming me plz..
#18
i've been messing around with it myself, but still no avail, did u pull it off yet daelin?
#19
Ok... I haven't really make hte trigger but I'll give you the idea and you try to make it up. I'm pretty busy with school and my computer goes sooooo slow. I'm starting to hate it.

Ok, you need two triggers/upgrade. Ok, the first one is activated when the upgrade is done. It has an event "Unit - n unit finishes an upgrade". Condition would be something like "(Researched Tech-Type) is equal to (Yourupgrade)". Action would be picking every unit in the map that belongs to you and that has the ability which needs upgradation, remove its current ability and add a new one. Moreover, you will need a global variable (perhaps array) which is boolean and set it to "True" in this case, being "False" origianlly.

The second trigger should have hte action "An unit finishes training an unit" and the conditions should be two: 1. Unit Type of Trained unit is equal to "Yourunit".
2. Yourboolean is equal to true
Action: Remove Ability from Unit.
Add Ability to Unit.

Hope this helps you! Oh, and at research level 3, you should have a separate boolean which is at the beginning false. In this case, once you have the research done at level 3, set the boolean for level 2 to false. ;)
#20
alright, that is also very much possible yeah.
i'll give it a try. thanks.
#21
No problem... Just announce me if it doesn't work so I can try it too... And probably fix it.
#22
i'm not that stupid.. i had about the same idea as this, but my purpose was to find a way using the spells and upgrades themself. which is not really possible.
#23
Wow... Angeslusz, I never said you are stupid. Why would you think such a thing? I just gave you an idea, and said that I wanted to know if it worked so that if it doesn't, find the problem myself as well, so I won't repeat it again. I'm really sorry if I offended you. Wasn't my purpose.

~Daelin
#24
It's ok, i haven't had the time yet btw, i'll start on it now :)
#25
Oh, by the way, i've come up with a better way.
Mine is simpler, and alot less laggy, for changing an aspect of every unit owned by a player (in my map up to 150 units) causes a quite significant lagspike.

Microdegen Upgrade
    Events
        Unit - A unit Finishes research
    Conditions
        (Researched tech-type) Equal to MicroDegenerative Bullets
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Microdegen_lvl[(Player number of (Owner of (Triggering unit)))] Equal to 0
            Then - Actions
                Set Microdegen_lvl[(Player number of (Owner of (Triggering unit)))] = (Microdegen_lvl[(Player number of (Owner of (Triggering unit)))] + 1)
                Player - Enable MicroDegenerative Bullets (1) for (Owner of (Triggering unit))
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Microdegen_lvl[(Player number of (Owner of (Triggering unit)))] Equal to 1
            Then - Actions
                Set Microdegen_lvl[(Player number of (Owner of (Triggering unit)))] = (Microdegen_lvl[(Player number of (Owner of (Triggering unit)))] + 1)
                Player - Disable MicroDegenerative Bullets (1) for (Owner of (Triggering unit))
                Player - Enable MicroDegenerative Bullets (2) for (Owner of (Triggering unit))
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Microdegen_lvl[(Player number of (Owner of (Triggering unit)))] Equal to 2
            Then - Actions
                Set Microdegen_lvl[(Player number of (Owner of (Triggering unit)))] = (Microdegen_lvl[(Player number of (Owner of (Triggering unit)))] + 1)
                Player - Disable MicroDegenerative Bullets (1) for (Owner of (Triggering unit))
                Player - Disable MicroDegenerative Bullets (2) for (Owner of (Triggering unit))
                Player - Enable MicroDegenerative Bullets (3) for (Owner of (Triggering unit))
            Else - Actions
                Do nothing


What do you think?
#26
Hmm... I think I get what you want to do. You want to ENABLE the triggers? It doesn't really come less laggy if so but it is a better idea than mine. ;)
#27
well, it works perfectly now, no lag, no bullshit, thank god :p
#28
Good... I'm glad you finally solved this problem. It was starting to bug me as well... ;)
#29
hehe, got to love the warcraft engine, every once in a while you'll find one of those little buggers which just won't do what they're supposed to.
May i ask, since you're very experienced at the editor, would you mind taking a look at this:

http://www.wc3sear.ch/viewtopic.php?t=6662

thanks..