[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.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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