[Fix Small Trigger] Can only buy 1 unit?

GfameVideos

New Member
Reaction score
2
These are my 2 triggers, which should make it only able to buy 1 unit, and then when it dies it resets, and ucan buy another 1.

(I knew this trigger was gonna be wrong on making, but i didn't knew how to maek it working, so i just made this for an example of what i want)

Please help!


Trigger:
  • Class Selecting 1
    • Events
      • Unit - A unit Sells a unit
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Player_Bought Equal to 1
        • Then - Actions
          • Game - Display to (Player group((Owner of (Sold unit)))) for 5.00 seconds the text: You already have a ...
          • Unit - Remove (Sold unit) from the game
        • Else - Actions
          • Set Player_Bought = 1



Trigger:
  • Class Selecting 2
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Dying unit)) Equal to |cff995500Force Recon|r
          • (Unit-type of (Dying unit)) Equal to |cff995500Rifleman|r
          • (Unit-type of (Dying unit)) Equal to |cff995500Stealth Sniper|r
    • Actions
      • Set Player_Bought = 0
 

adeoin

Member
Reaction score
11
umm I may be wrong but shouldn't there be a trigger that sets Player_Bought = 1 when you buy a unit.

I only see it checking if Player_Bought = 1 but I don't see setting Player_Bought to 1.
 

HydraRancher

Truth begins in lies
Reaction score
197
umm I may be wrong but shouldn't there be a trigger that sets Player_Bought = 1 when you buy a unit.

I only see it checking if Player_Bought = 1 but I don't see setting Player_Bought to 1.

Trigger:
  • Class Selecting 1
    • Events
      • Unit - A unit Sells a unit
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Player_Bought Equal to 1
        • Then - Actions
          • Game - Display to (Player group((Owner of (Sold unit)))) for 5.00 seconds the text: You already have a ...
          • Unit - Remove (Sold unit) from the game
        • Else - Actions
          • Set Player_Bought = 1

There is, look right up there.







Use - A unit is trained instead.
 

GfameVideos

New Member
Reaction score
2
There is, look right up there.







Use - A unit is trained instead.

Thats all ? :S

EDIT: Can you tell me, how to set player bought to 1? :D

EDIT 2:

I have this other trigger, which picks every unit in 'Wait Spawn Region' which are allied to player 1 red.
(I can use this that way, cause i have a auto team team balance system')

But how do i make it, that all of those allied to player 1 red, in wait spawn region spawn in a other region? :S

Trigger:
  • BC CT Match Start
    • Events
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in Wait Spawn <gen> matching (((Triggering player) is an ally of Player 1 (Red)) Equal to True)) and do (Actions)
        • Loop - Actions
 

HydraRancher

Truth begins in lies
Reaction score
197
I think. Oh wait sorry, how do you get the unit? Do you buy it from a shop? If so, ignore what I said.
 

HydraRancher

Truth begins in lies
Reaction score
197
Your problems arent related, make a new thread.

>u owe me to help me set player_bought to 1?
What do you mean?
 

GfameVideos

New Member
Reaction score
2
Your problems arent related, make a new thread.

>u owe me to help me set player_bought to 1?
What do you mean?

Lol, was just kidding with the you owe me.

but what i mean with set player_bought to 1.
Thats the problem of the trigger not working.

Everything is correct but i don't know how to make a trigger, that it sets player_bought to 1.
 

HydraRancher

Truth begins in lies
Reaction score
197
Put AFTER set - player_bought something like Game - Display text message IT WORKED! And try again.
 

bess

New Member
Reaction score
2
Trigger:
  • Class Selecting 1
    • Events
      • Unit - A unit Sells a unit
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Player_Bought Equal to 1
        • Then - Actions
          • Game - Display to (Player group((Owner of (Sold unit)))) for 5.00 seconds the text: You already have a ...
          • Unit - Remove (Sold unit) from the game
        • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Player_Bought Equal to 0
          • Then - Actions
            • Set Player_Bought = 1
          • Else - Actions

Try this, it might work
 

adeoin

Member
Reaction score
11
Trigger:
  • Untitled Trigger 002
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Sold unit)) Equal to Footman
          • (Unit-type of (Sold unit)) Equal to Rifleman
          • (Unit-type of (Sold unit)) Equal to Blood Mage
    • Actions
      • Set Interger[1] = 1


add that seperate trigger see if that works cause that sets player bought to 1. And the other will check if player bought is 1.
 

Tyman2007

Ya Rly >.
Reaction score
74
If you place the text after whatever, and the trigger runs and doesn't display, the problem is with the event itself.

Tell me..

Did you put the units under techtree - Units Sold or techtree - Units Trained on the building that sells the units.

From the looks of it, the trigger should work fine.

Perhaps you're using world editor unlimited?
 

GfameVideos

New Member
Reaction score
2
I now have this, but it still doesn't work..
And no im using normal world editor.

wat it supposes to do:

Block an Player from getting 2 Units:

Trigger:
  • Class Selecting 1
    • Events
      • Unit - A unit Sells a unit
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Player_Bought Equal to 1
        • Then - Actions
          • Game - Display to (Player group((Owner of (Sold unit)))) for 5.00 seconds the text: You already have a ...
          • Unit - Remove (Sold unit) from the game
        • Else - Actions


When the unit dies, player can buy a new 1:

Trigger:
  • Class Selecting 2
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Dying unit)) Equal to |cff995500Force Recon|r
          • (Unit-type of (Dying unit)) Equal to |cff995500Rifleman|r
          • (Unit-type of (Dying unit)) Equal to |cff995500Stealth Sniper|r
    • Actions
      • Set Player_Bought = 0


Setting it to a limit (1 unit)

Trigger:
  • Class Selecting 3
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Selling unit)) Equal to |cff995500Force Recon|r
          • (Unit-type of (Selling unit)) Equal to |cff995500Rifleman|r
          • (Unit-type of (Selling unit)) Equal to |cff995500Stealth Sniper|r
    • Actions
      • Set Player_Bought = 1

But it doesnt work!!! please!! :D
 

HydraRancher

Truth begins in lies
Reaction score
197
why would i want a text message appear, ofcourse that will work :D

-.- Its called Debugging, to test if it REALLY works.


Dont Split the first trigger into 2. It doesnt work like that, put it back together, and try the text messages. By splitting it in two, you've messed up the conditions, and now buying one of those 3 units, will stop ALL of them. And, please answer all my questions, how are you buying the unit? Is it a shop?
 

GfameVideos

New Member
Reaction score
2
-.- Its called Debugging, to test if it REALLY works.


Dont Split the first trigger into 2. It doesnt work like that, put it back together, and try the text messages. By splitting it in two, you've messed up the conditions, and now buying one of those 3 units, will stop ALL of them. And, please answer all my questions, how are you buying the unit? Is it a shop?

Buying the one unit in a shop, so that parts right.
There supposed to be 3 different triggers.. One sets the player_bought to 1, one sets it back to 0 and one checks how if he already got a unit or not :D

EDIT: I want it serperately for all players if thats what u ment, with you've messed up teh conditions. And yes i don't want them to be able to buy 1 of all. if he buys 1, he can't buy any other unit :D
 

HydraRancher

Truth begins in lies
Reaction score
197
Buying the one unit in a shop, so that parts right.
There supposed to be 3 different triggers.. One sets the player_bought to 1, one sets it back to 0 and one checks how if he already got a unit or not :D

EDIT: I want it serperately for all players if thats what u ment, with you've messed up teh conditions. And yes i don't want them to be able to buy 1 of all. if he buys 1, he can't buy any other unit :D

Oh, so buying a sniper, means hes banned from buying all other units?

Have you tried to text messages, they are for testing if things work, you dont have to keep them there.

By the way, you dont have to have "You already have a..." you can use "You already have a " + Unit - Unit Name of (Sold Unit) Concetnate strings.


>But it doesnt work!!! please!! :D
Same, my toaster doesnt work. Oh wait you werent talking about that? What then? What doesn't work? Whats happening?
 

GfameVideos

New Member
Reaction score
2
The text doesnt show up either..

well last try..

Can you look at it urself? ill attach the map?


I have send u Zshare download link with a private message k?

please have a look at it.
 
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