[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
 
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.
 
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.
 
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
 
I think. Oh wait sorry, how do you get the unit? Do you buy it from a shop? If so, ignore what I said.
 
Your problems arent related, make a new thread.

>u owe me to help me set player_bought to 1?
What do you mean?
 
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.
 
Put AFTER set - player_bought something like Game - Display text message IT WORKED! And try again.
 
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
 
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.
 
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?
 
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
 
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?
 
-.- 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
 
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?
 
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 The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      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