wc3edit.net

United Warcraft 3 map hacking!
It is currently April 19th, 2024, 10:34 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: August 16th, 2013, 6:34 pm 
Offline
Junior Member

Joined: December 28th, 2010, 4:14 pm
Posts: 34
Hi, I would like to request a simple upgrade/ability system.
I am not to good at triggering, so hopefully you guys could help me on this.

In an abstract, my map contains a spawning system where units will spawn every few seconds to
attack a point.

I want to create a system where you can research an upgrade and it will simply add the ability to your
spawned units and current spawning units. I would like it to also be MPI, considering, there will be other
players who would also use this function.

Could anyone help me on this?


Top
 Profile  
 
PostPosted: August 19th, 2013, 1:38 am 
Offline
Forum Staff
User avatar

Joined: November 17th, 2008, 3:49 pm
Posts: 610
Alright, it should be pretty simple to add, you will need a bit of variables though but its nothing too complicated.

Here's the trigger's that you will need. You only need two triggers to work this, one that adds the check for the upgrade to work and one to add the ability to the units.

Code:
Untitled Trigger 001 Copy
    Events
        Unit - A unit Finishes research
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Researched tech-type) Equal to Iron Forged Swords
            Then - Actions
                Set IronSwords[(Player number of (Owner of (Researching unit)))] = True
            Else - Actions
This first one should be easy to understand, basically it triggers when a building finishes the upgrade, determines what upgrade was done, and then checks the player so the next trigger can add the skill for just that players units.

In the line "Set IronSwords" IronSwords is a Boolean variable, with an array size set as 1-12. You will have to create variables for each of your upgrades.

After "Else - Actions" Repeat the If/Then/Else action just as shown but do it for a different upgrade.

Code:
Untitled Trigger 002
    Events
        Time - Every 2.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 10, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        IronSwords[(Integer A)] Equal to True
                    Then - Actions
                        Unit Group - Pick every unit in (Units owned by (Player((Integer A))) of type Footman) and do (Unit - Add Aerial Shackles to (Picked unit))
                    Else - Actions
                        Do Nothing
This trigger checks every 2 seconds to see if the player has finished the upgrade from the previous trigger, and adds an ability that you want to any unit type owned only by that player.

It should be very easy to make, the only thing really confusing could be the line (Units owned by (Player((Integer A))). To get that you need to select "Units owned by player of type" under the unit group option. Then for where you choose the player, the option is called "Conversion - Convert player index to player"

Unlike the previous trigger, for this one you can't put everything under "Else - Actions". Simply copy and paste the actions and change the rest of the parts for the other abilities.
...
I tested this small system out with two players and it did not conflict, so you shouldn't have many problems with it. If i made something confusing or you cant figure a line out feel free to ask.

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO


Privacy Policy Statement
Impressum (German)