Event Response Unit lost by Trigger

XeRo13g

New Member
Reaction score
3
I've done some testing but I cannot conclude to a result 100%. Maybe someone can help...

Code:
Event
Unit - A unit Sells a unit

Conditions
(Unit-type of (Sold unit)) Equal to UnitX

Actions

Do something for (Owner of (Sold unit)) ....
Wait 5 seconds
Do something else for (Owner of (Sold unit)) ....

In these 5 seconds delay:
-What happens if another player buys ANY other unit?
-What happens if another player buys a UnitX?

Does the already running trigger loses focus on the first (Owner of (Sold unit))?

Thanks in advance.
 

evilwolf

Member
Reaction score
11
Wait action is unstable if rum multiple times.
Use a countdown timer that will run and fire only for the owner of sold unit.
 

DioD

New Member
Reaction score
57
every event variable expect GetTriggerX is LOST after wait.

sold unit in your trigger will be lost after wait in ANY case (ever if you sell no other units), you must use global or local variables to save reference.
 

XeRo13g

New Member
Reaction score
3
Yet, for some unknown reason it still works. I surely don't feel safe using such trigger and I will need some way to stabilize it.

Edit.-
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
basically if you are not using variables just event responses and owner of unit, etc the trigger will run fine as long as the owner of the unit isnt changing, variables would not work with the wait function because they can be changed before the wait function ends... by a different trigger or the same one, but once the trigger is in the que if the owner of the unit does not change then the trigger should work

if you wish to use variables and still want to use a wait function, you need to use a pick every player/unit function like this:
pick every unit in playable map area matching condition: unit comparision - matching unit = saved variable then do every action for the picked unit, because then the unit is picked for the trigger already and does not change for that trigger while it is in the que...
 

XeRo13g

New Member
Reaction score
3
basically if you are not using variables just event responses and owner of unit, etc the trigger will run fine as long as the owner of the unit isnt changing.

So, if the same trigger runs multiple times for multiple users at the same time, the (Owner of (Sold unit)) will be kept for each one of the users for as long as the sold unit (of each player) isn't modified in any way?

-I'm not very comfortable using "queue", because even though I've read a fair share about it's use, it's mechanics and placement remain unclear to me and also caused a crash that kinda scared me.

-I could use a unit variable array to store the (Owner of (Sold unit)) for each player and re-use it over and over again. Though, I haven't seen that a lot in other people coding and even though Temp_Unit variable is not supposed to leak, I don't quite trust it.

Only if i could clear those things in my mind...Ohh well..
 

hopy

Active Member
Reaction score
64
So, if the same trigger runs multiple times for multiple users at the same time, the (Owner of (Sold unit)) will be kept for each one of the users for as long as the sold unit (of each player) isn't modified in any way?
The '(Owner of (Sold unit))' shouldn't cause problems because of multiple players using it, but more because the data stored in '(Owner of (Sold unit))' gets cleared afther the wait. So no, it wouldn't work.

-I could use a unit variable array to store the (Owner of (Sold unit)) for each player and re-use it over and over again. Though, I haven't seen that a lot in other people coding and even though Temp_Unit variable is not supposed to leak, I don't quite trust it.
If every player can only use this once, or once every 5 seconds, yes.
If yes, should I show you how?
 

XeRo13g

New Member
Reaction score
3
If every player can only use this once, or once every 5 seconds, yes.
If yes, should I show you how?

I didn't quite understand what do you mean by that and yes please show me!!

PS. After looking into it a bit more, I don't see how (Owner of (Sold unit) can be stored in something that will be reused and remain unchanged even if the trigger re-runs. Let alone creating 1 trigger for each player, which I'm sure is not optimal.

EDIT: spelling
 

tommerbob

Minecraft. :D
Reaction score
110
PS. After looking into it a bit more, I don't see how (Owner of (Sold unit) can be stored in something that will be reused and remain unchanged even if the trigger re-runs. Let alone creating 1 trigger for each player, which I'm sure is not optimal.

You use variables to keep track of specific data. So in your trigger above, you would change it to this:

Trigger:
  • Events
    • Unit - A unit sells a unit
    • Conditions
      • (sold unit) equal to [Your Unit]
    • Actions
      • Set UNIT = (sold unit)
      • Wait 5.00 seconds
      • Unit - Make UNIT jump around


You would need to add a condition check if you want this for only 1 player, or instead of using a variable you could add the (sold unit) to a unit group (like GFreak45 suggested), and then after the wait, do actions for every unit in that unit group and then remove the unit from the unit group. Example:

Trigger:
  • Events
    • Unit - A unit sells a unit
    • Conditions
      • (sold unit) equal to [Your Unit]
    • Actions
      • Unit group - Add (sold unit) to UNITS
      • Wait 5.00 seconds
      • Unit group - Pick every unit in UNITS and do Actions
        • Loop - Actions
          • Unit - Make (picked unit) jump around
          • Unit group - Remove (picked unit) from UNITS
 

XeRo13g

New Member
Reaction score
3
To my understanding that would work just fine if the event runs at the same time for all players.
If a second player trigger the event after x seconds though, the sequence of actions for each player should be different (since the first is x seconds ahead).

Am I missing something?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      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