problems with ally unit

theDTD

Active Member
Reaction score
8
>how to do these:

1.)when your ally kills an enemy unit, the bounty that it gets will also added to your gold

2.)when you use a "scroll of town portal" , your ally will also teleport,

:thup:+rep:thup:
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
1: Has to be triggered.
2: Give your own modded mass teleport to a scroll and have a unit use this. All units in range that you allowed will teleport.
 

Drakethos

Preordered Sc2 ftw!
Reaction score
56
hm for the bounty thing, you would need to detect the ally getting gold, and whether or not he just killed a unit. Ill add the code in a second.
EDIT: hm i know its not perfect, you need to figure out the gold detection, perhaps a 3rd trigger?
Unit - A unit Dies
Set gold[(Player number of (Owner of (Killing unit)))] = ((Owner of (Killing unit)) Current gold)
Set GetBounty[(Player number of (Owner of (Killing unit)))] = True
Player - Player 1 (Red)'s Current gold becomes Greater than or equal to 100.00
Player - Add 30 to Player 2 (Blue) Current gold
Set GetBounty[(Player number of (Owner of (Killing unit)))] = False
 

theDTD

Active Member
Reaction score
8
>more trigger for the bounty thing pls. i realy nid dis but don't know how to trigger it . . . .


>thnks
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
u could update your gold with a gold variable so if a unit was killed and the amount of gold is different than the variable amount u add the: ((Amount of Gold) - GoldVar) X 2 to the players current gold and then update the GoldVar to ur current gold
 

Manee

New Member
Reaction score
20
i had a similar problem with u be4 XD

here's a trigger from my map ;)

Code:
Shared Bounty Copy
    Events
        Unit - A unit Dies
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (Owner of (Killing unit)) Equal to Player 1 (Red)
                        (Owner of (Killing unit)) Equal to Player 2 (Blue)
                        (Owner of (Killing unit)) Equal to Player 3 (Teal)
                        (Owner of (Killing unit)) Equal to Player 4 (Purple)
            Then - Actions
                Set TempPoint = (Position of (Triggering unit))
                Set sharedgold = (Point-value of (Triggering unit))
                Floating Text - Create floating text that reads (+ + (String(sharedgold))) at TempPoint with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
                Special Effect - Create a special effect at TempPoint using UI\Feedback\GoldCredit\GoldCredit.mdl
                Set FloatingText = (Last created floating text)
                Floating Text - Show FloatingText for Force1
                Floating Text - Hide FloatingText for Force2
                Floating Text - Hide FloatingText for Force3
                Floating Text - Change FloatingText: Disable permanence
                Floating Text - Change the lifespan of FloatingText to 1.00 seconds
                Special Effect - Destroy (Last created special effect)
                Player Group - Pick every player in Force1 and do (Actions)
                    Loop - Actions
                        Player - Add sharedgold to (Picked player) Current gold
                Custom script:   call RemoveLocation (udg_TempPoint)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (Owner of (Killing unit)) Equal to Player 5 (Yellow)
                        (Owner of (Killing unit)) Equal to Player 6 (Orange)
                        (Owner of (Killing unit)) Equal to Player 7 (Green)
                        (Owner of (Killing unit)) Equal to Player 8 (Pink)
            Then - Actions
                Set TempPoint = (Position of (Triggering unit))
                Set sharedgold = (Point-value of (Triggering unit))
                Floating Text - Create floating text that reads (+ + (String(sharedgold))) at TempPoint with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
                Special Effect - Create a special effect at TempPoint using UI\Feedback\GoldCredit\GoldCredit.mdl
                Set FloatingText = (Last created floating text)
                Floating Text - Show FloatingText for Force2
                Floating Text - Hide FloatingText for Force1
                Floating Text - Hide FloatingText for Force3
                Floating Text - Change FloatingText: Disable permanence
                Floating Text - Change the lifespan of FloatingText to 1.00 seconds
                Special Effect - Destroy (Last created special effect)
                Player Group - Pick every player in Force2 and do (Actions)
                    Loop - Actions
                        Player - Add sharedgold to (Picked player) Current gold
                Custom script:   call RemoveLocation (udg_TempPoint)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (Owner of (Killing unit)) Equal to Player 9 (Gray)
                        (Owner of (Killing unit)) Equal to Player 10 (Light Blue)
                        (Owner of (Killing unit)) Equal to Player 11 (Dark Green)
                        (Owner of (Killing unit)) Equal to Player 12 (Brown)
            Then - Actions
                Set TempPoint = (Position of (Triggering unit))
                Set sharedgold = (Point-value of (Triggering unit))
                Floating Text - Create floating text that reads (+ + (String(sharedgold))) at TempPoint with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
                Special Effect - Create a special effect at TempPoint using UI\Feedback\GoldCredit\GoldCredit.mdl
                Set FloatingText = (Last created floating text)
                Floating Text - Show FloatingText for Force3
                Floating Text - Hide FloatingText for Force2
                Floating Text - Hide FloatingText for Force1
                Floating Text - Change FloatingText: Disable permanence
                Floating Text - Change the lifespan of FloatingText to 1.00 seconds
                Special Effect - Destroy (Last created special effect)
                Player Group - Pick every player in Force3 and do (Actions)
                    Loop - Actions
                        Player - Add sharedgold to (Picked player) Current gold
                Custom script:   call RemoveLocation (udg_TempPoint)
            Else - Actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top