Teamupgrades

Status
Not open for further replies.
Level 1
Joined
Jul 26, 2008
Messages
5
(Solved) Teamupgrades

Hi i searched in the Forum already for it but coulndt find it.

I Found somethign similar but its a bit to differnt to use it right.

I have the following problem:

I have 2 Teams each Team has a Computer who attacks via creeps the enemy team.

As example i call the team computer player 10

Now i want 1 Building on which nearly heros of (as example) player 1,2,3,4 can upgrade the creeps for player 10.

If its not possible i would be thanksfull for alternativs too.

Thanks alot Platin
 
Last edited:
I found it possible with only 3 lines.

make a trigger that


unit - unit buy stuff from shop (the things that it buys will be units that look like upgrade)
condition - unit type of bought unit is Troll that looks like upgrade (same tooltip and icon)
action: set upgrade of player 12 to the same upgrade level +1

I think it even not have leaks xD.
 
Level 1
Joined
Jul 26, 2008
Messages
5
hi thx for the answer but i think i found a leak ... or its only because im an idiot.

There is no conditon to declare a "buyed" unit, only trained unit or "buying" unit.
With set variable its the same ...

Thats now my new Problem, the rest works fine so far ^^

greetings
Platin
 
Level 1
Joined
Jul 26, 2008
Messages
5
Problem solved!

I thank you for the idee with triggers and units to buy but displayed as upgrades .. i never thought of someting like that!

But i changed the Triggers to:

Unit - A unit comes within range 300 to "Shop"

Condition - empty

Action - (if/then/else) if unittyp of trigering unit = "UPGRADE DUMMY" then do set current level of "Upgrade" to current level of upgrade +1 else do nothing

Action2 - (if/then/else) if unittyp of trigering unit = "UPGRADE DUMMY" then remove triggering unit else do nothing

case solved ^^
 
Level 12
Joined
Mar 10, 2008
Messages
869
Always use multiple if/then/else functions to avoid having to place Do Nothing in the trigger.
3ICE said:
Every time you use this function:

call DoNothing()
Do Nothing

You call this JASS function:

function DoNothing takes nothing returns nothing
endfunction

Which takes up valuable processing time.
By choosing not to use call DoNothing(), you win 12.3% speed increase!

call DoNothing()+return executed 2162 times per milisecond.
//null+return executed 26668 times per milisecond.
The real benefit of not using call DoNothing() is 0.00046 ms per call.

Posted by 3ICE @ 6:26 am
As found here.
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
Make items that equal to the upgrades you want to do
Then make the following trigger:

  • Upgrades
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Item-type of (Sold Item)) Equal to <ItemTypeHere>
      • Then - Actions
        • Player - Set the current research level of <TechNameHere> to <Level> for <Player>
      • Else - Actions
Can be done with unit instead of item:

  • Upgrades
    • Events
      • Unit - A unit Sells a unit
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Sold unit)) Equal to <UnitTypeHere>
        • Then - Actions
          • Player - Set the current research level of <TechTypeHere> to <Level> for <Player>
        • Else - Actions
 
Status
Not open for further replies.
Top