• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Linking spells to upgrades

Status
Not open for further replies.
Level 9
Joined
Sep 8, 2004
Messages
633
Hey,

I made me a nice passive ability, and another nice upgrade. (sounds stupid éh? :D)
Now, my goal is, when i upgrade the ability level 1, the ability becomes available (works already, easy.)
Now, when you upgrade to level 2, i want the ability to upgrade to lvl 2 aswel.
I have already tried the 'ability level bonus', but that just doesn't work. help me?
 
Level 9
Joined
Jun 10, 2004
Messages
594
Since its a hero ability, I'm not sure if you can use the "Techtree" fields on the spell, but otherwise you can just use triggers. Use one trigger and a boolean to detect if the unit has learned the ability (there might be a condition for this, I'm not sure). Use another trigger to set the level of the ability.

~The_Raven
 
Level 7
Joined
Mar 26, 2004
Messages
350
The_Raven said:
Since its a hero ability, I'm not sure if you can use the "Techtree" fields on the spell

yes, they work. i know it as i often forget to delete these equivalents and then have to change and retest my spells :wink:
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Umm... I don't really know what he wants but I think I understand what YOU mean Raven. Umm... You want him to get all the skills to the hero and just put requirements? Hmm... there is only one problem if so. Why if he wants to add an armor bonus skill, which increases at every level? Is it possible to give a skill three times? I doubt it though...
 
Level 9
Joined
Sep 8, 2004
Messages
633
oh i'm sorry, but it's not a hero ability, forgot to mention that.

the map i'm using it in, is StarCraft Zone Control, in which you get alot of marines out of each bunker you control, and these marines can be upgraded in various ways.
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Can't you give the skills from the beggining to the unit? Then all you have to do is set the prerequisites needed. First check the Dependency field, then set into the prerequisites field what upgrades it needs and if it only gets activated by level 2 or 3 or more of that upgrade, add it to the level required. ;)
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Ok... If you look at any spell you will notice that it has the following fields( in Object Editor btw... Spells Menu)

Techtree - Check Dependencies
Techtree - Requirements
Techtree - Requirements - Levels

Ok, make sure the first one is set to true. Go to Upgrades menu and create a new upgrade based on Defend let's say. Change icon and stuff however you want. NOW, go back to your spell. We have to change the Techtree - Requirements.

Click on Add TechItem and select into the menu up Upgrades. Search for your upgrade depending on the race and stuff and select it. That's all.

Still, if you want an upgrade which has two levels, for example, and have the ability available only at level 2, click on Requirements - Level field, click on Add Integer and write "2" into the field. If you want level 3, write level 3 and so on. If you want level 1 you don't need to add it.

That's all. Do you get it now?
 
Level 9
Joined
Sep 8, 2004
Messages
633
okay, well, here's what i want.

I've got one upgrade with 3 levels.
I've got one ability with 3 levels.

When the upgrade goes up one level, so must the ability.

E.g.:
Upgrade lvl 1 = enables the skill
Upgrade lvl 2 = makes the skill lvl2
Upgrade lvl 3 = makes the skill lvl3
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
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. ;)
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
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
 
Level 9
Joined
Sep 8, 2004
Messages
633
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.

Code:
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?
 
Status
Not open for further replies.
Top