Problem with attacks draining gold

ROTS19

TH.net Regular
Reaction score
12
i made a trigger that when a unit attacks then a certain ammount of gold is drained from the player. that part works just fine. But i also tried to make it so that when the player researches a certain upgrade, that it drains less gold on each attack. This is the part that doesn't work.
Trigger:
  • Events
    • Unit - A unit Finishes an upgrade
    • Conditions
      • (Researched tech-type) Equal to Capacity
    • Actions
      • Set CapResearched[(Player number of (Owner of (Researching unit)))] = True


Trigger:
  • S
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Peon
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Attacking unit)) Current gold) Less than 4
        • Then - Actions
          • Unit - Order (Attacking unit) to Stop
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CapResearched[(Player number of (Owner of (Attacking unit)))] Equal to True
        • Then - Actions
          • Player - Add -2 to (Owner of (Attacking unit)) Current gold
        • Else - Actions
          • Player - Add -4 to (Owner of (Attacking unit)) Current gold


The problem is that even when the upgrade is researched, 4 gold is drained anyway. What's wrong with the triggers?
 

Faust

You can change this now in User CP.
Reaction score
123
That takes gold from the enemy, not the attacker. :)


Hmm, maybe try setting it to Triggering Unit in the first trigger
 

jig7c

Stop reading me...-statement
Reaction score
123
enjoying life!

try removing the skip remaining action part! that should fix it
 

ROTS19

TH.net Regular
Reaction score
12
But that's only their to keep it from draining gold if the player doesn't have enough to attack. If i took out, it would still drain gold even if the player didn't have enough.
 

gameman

It's been a long, long time.
Reaction score
94
Create a second trigger for this. The first trigger for the beginning and the second one for the upgrade.

Well this might not be practical... How many times does it upgrade?
 

ROTS19

TH.net Regular
Reaction score
12
It only has 1 level of upgrade

well, that didn't seem to work either

Trigger:
  • Events
    • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Peon
    • Actions
      • Trigger - Turn on func2 <gen>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Attacking unit)) Current gold) Less than 4
        • Then - Actions
          • Unit - Order (Attacking unit) to Stop
          • Trigger - Turn off func2 <gen>
        • Else - Actions


Trigger:
  • func2
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Peon
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CapResearched[(Player number of (Owner of (Attacking unit)))] Equal to True
        • Then - Actions
          • Player - Add -2 to (Owner of (Attacking unit)) Current gold
        • Else - Actions
          • Player - Add -4 to (Owner of (Attacking unit)) Current gold


is this what you meant? i don't really understand why splitting them would have helped at all.
 

Ellimistrox

New Member
Reaction score
10
Trigger:
  • Events
    • Unit - A unit Finishes an upgrade
    • Conditions
      • (Researched tech-type) Equal to Capacity
    • Actions
      • Set CapResearched[(Player number of (Owner of (Researching unit)))] = True
Problem Found! Event should be
Unit - A unit Finishes research
Because you use conditions of Researched tech-type, nothing to do with upgrading :thup:.
 

ROTS19

TH.net Regular
Reaction score
12
Problem Found! Event should be
Unit - A unit Finishes research
Because you use conditions of Researched tech-type, nothing to do with upgrading :thup:.
thanks! i didn't see that. Why did nobody else think of that ? lol +rep
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Happy Sunday!
    +1
  • The Helper The Helper:
    I will be out of town until Sunday evening
    +1
  • The Helper The Helper:
    I am back! Did you miss me LOL
    +1
  • jonas jonas:
    where did you go?
  • The Helper The Helper:
    Jefferson TX on a Paranormal Investigation of a haunted bed and breakfast - I got some friends that are paranormal investigators and they have an RV and do YouTubes
    +1
  • The Helper The Helper:
    It was a lot of fun. The RV was bad ass
  • jonas jonas:
    That sounds like fun!
    +1
  • The Helper The Helper:
    it was a blast!
  • The Helper The Helper:
    I am going to post the Youtube of the investigation in the forums when it is ready
    +1
  • jonas jonas:
    cool!
  • vypur85 vypur85:
    Sounds cool TH.
  • tom_mai78101 tom_mai78101:
    I was on a Legend of Zelda marathon...
  • tom_mai78101 tom_mai78101:
    Am still doing it now
    +1
  • jonas jonas:
    which one(s) are you playing?
  • jonas jonas:
    I played a little bit of the switch title two weeks ago and found it quite boring
  • The Helper The Helper:
    just got back from San Antonio this weekend had the best Buffalo Chicken Cheesesteak sandwhich in Universal City, TX - place was called Yous Guys freaking awesome! Hope everyone had a fantastic weekend!
    +1
  • The Helper The Helper:
    Happy Tuesday!
  • The Helper The Helper:
    We have been getting crazy numbers reported by the forum of people online the bots are going crazy on us I think it is AI training bots going at it at least that is what it looks like to me.
  • The Helper The Helper:
    Most legit traffic is tracked on multiple Analytics and we have Cloud Flare setup to block a ton of stuff but still there is large amount of bots that seem to escape detection and show up in the user list of the forum. I have been watching this bullshit for a year and still cannot figure it out it is drving me crazy lol.
    +1
  • Ghan Ghan:
    Beep boop
    +1
  • The Helper The Helper:
    hears robot sounds while 250 bots are on the forum lol
  • The Helper The Helper:
    Happy Saturday!
    +1
  • The Helper The Helper:
    and then it was Thursday...
    +2

    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