"Help" Swap Hero's Percentage lifes

djb4cc1o94

TH.net Regular
Reaction score
5
Hello i created an ability based of channel and i want it to swap my hero's percentage life to the targeted hero's one, problem is that the percentage life of the opponent hero doesnt switch, i just get his percentage but he doesnt get my old one... i show u my trigger, pls help me thx in advice


Code:
Swap Percentage
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Swap Percentage
    Actions
        Unit - Set life of (Triggering unit) to (Percentage life of (Target unit of ability being cast))%
        Unit - Set life of (Target unit of ability being cast) to (Percentage life of (Triggering unit))%
 

Slapshot136

Divide et impera
Reaction score
469
you can't swap them simultaneously, you need to save 1 of them in a variable first, this is what you are currently doing

A-> B
B-> A (you already replaced B, therefore at this point b=A already, and this step is pointless)

what you need to do:

A-> C (a variable)
B-> A
C-> B
 

djb4cc1o94

TH.net Regular
Reaction score
5
Sorry about, but i cant understand, could you make an example thx?

EDIT: I tried with variables, integer unit... but i dont know wich one to use :(
 

keychup

Active Member
Reaction score
34
The variable, A should be "Real" type

Set A = Percentage Life of Caster
Set Percentage Life of Caster to Percentage Life of Target
Set Percentage Life of Target to A
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    I reorganized the forums somewhat but I doubt anyone would notice
  • The Helper The Helper:
    Happy Friday!
    +1
  • The Helper The Helper:
    Happy Saturday!
    +1
  • The Helper The Helper:
    The forum software says we have 554 members online now. We did not have that many unique visitors the whole day today. Too many bots and the disconnect between the forum counts and the stats.
  • Varine Varine:
    Currently it says 413 guests and 2 members
    +1
  • Varine Varine:
    Aww
  • The Helper The Helper:
    That is going to be mostly bots
  • The Helper The Helper:
    527 (members: 2, guests: 525)
  • The Helper The Helper:
    Happy Saturday!
    +1
  • V-SNES V-SNES:
    Happy Saturday!
    +1
  • The Helper The Helper:
    622 (members: 2, guests: 620)
  • The Helper The Helper:
    666 (members: 4, guests: 662) :)
    +1
  • Varine Varine:
    609 (members: 4, guests: 605)
  • The Helper The Helper:
    I was posting that last one because the 666 users online :)
    +1
  • The Helper The Helper:
    Happy Wednesday Night!
    +1
  • The Helper The Helper:
    Happy Thursday!
    +1
  • The Helper The Helper:
    Marathon watching The Expanse!
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    leaving for the weekend in San Antonio will be gone until Sunday afternoon
    +1
  • The Helper The Helper:
    and I am back :)
    +1
  • The Helper The Helper:
    Happy Tuesday!
    +1

    The Helper Discord

    Members online

    Affiliates

    Hive Workshop NUON Dome World Editor Tutorials

    Network Sponsors

    Apex Steel Pipe - Buys and sells Steel Pipe.
    Top