Gates and armies

Xonora

New Member
Reaction score
3
lol. Check my trigger again. Its extremely simple. There is no leak. Only a condition. The only action is open/close gate
 

Hot

New Member
Reaction score
9
lol. Check my trigger again. Its extremely simple. There is no leak. Only a condition. The only action is open/close gate

u have to destroy the unit group (dont know the correct script)
 

Xonora

New Member
Reaction score
3
Event
Unit leaves (your region)

Condition


Action

If, then multiple functions, else. (something like that)
Conditions (interger comparison) - Number of units in (your region) = 0 is true

Then - Close gate

Else - Do nothing

Where leak?

Anyway, the command is ' call DestroyGroup (udg_yourgroup) ' (exact spacing)
 

Rainther

I guess I should write something of value here...
Reaction score
61
If it's a global unit group, which seems to be the case you better clear it then destroying it, since destroying it, from what I've heard leaks.

PS: I don't see where is leaks either.
 

Rainther

I guess I should write something of value here...
Reaction score
61
We're just messing with your brain :p

call DestroyGroup is used in order to "kill" a unit group so that it in theory doesn't store memory any longer.
 

Xonora

New Member
Reaction score
3
just go under action - custom script and paste the code in.

I know how u feel. not long ago i had problems with variables too
 

Hacklefellar

New Member
Reaction score
1
it isn't working. i did what you said but now it says : expected 'endif' should i just stick that on the end of the line or do i have to do something else?
 

Xonora

New Member
Reaction score
3
ok try - call DestroyGroup(udg_tempgroup) Where tempgroup is your group name. Must be exact spelling.
 

Hacklefellar

New Member
Reaction score
1
i haven't used unitgroups. i just used the if/then/else command with
if number of units in open door region is equal to 0 (in short)
then close door
else do nothing

what would that make the name of the unit group?
 

Rainther

I guess I should write something of value here...
Reaction score
61
number of units creates a Unit Group, which should be set to a variable before running the if and then handle it with Destroy for instance.
 

Hacklefellar

New Member
Reaction score
1
how does that thing work that u can post a trigger screen in a reply? then i can show you how i did it.

this is how i did it:

Trigger 1 (for opening)
Trigger:
  • Trigger
    • Events
      • Unit - A unit enters open door <gen>
    • Conditions
      • ((Triggering unit) is a flying unit) Equal to False
    • Actions
      • Destructible - Open Gate (Horizontal) 0004 <gen>


Trigger 2 (for closing)
Trigger:
  • Trigger
    • Events
      • Unit - Leaves Open Door <gen>
    • Conditions
    • Actions
      • If ((Number of units in (Units in Open Door <gen>)) Equal to 0) then do (Destructible - Close Gate (Horizontal) 0004 <gen>) Else (Do Nothing)
 

Rainther

I guess I should write something of value here...
Reaction score
61
Make a unit group variable and before calling the "if" set the group variable to "Units in Open Door", refer to the group insetad in the If

and when you're done use a custom script:
call GroupClear(udg_<Unit Group Variable Name>)
 

Xonora

New Member
Reaction score
3
I tot it was DestroyGroup? But i didnt know checking a region has a leak? Its a condition
 

Hacklefellar

New Member
Reaction score
1
this is how it is now:

Trigger 1 (for opening)
Trigger:
  • Trigger
    • Events
      • Unit - A unit enters open door &lt;gen&gt;
    • Conditions
      • ((Triggering unit) is a flying unit) Equal to False
    • Actions
      • Unit Group - Add all units of (Units in Open Door &lt;gen&gt;) to Opendoorgrp
      • Destructible - Open Gate (Horizontal) 0004 &lt;gen&gt;


Trigger 2 (for closing)
Trigger:
  • Trigger
    • Events
      • Unit - Leaves Open Door &lt;gen&gt;
    • Conditions
    • Actions
      • Unit Group - Remove (Triggering unit) from Opendoorgrp
      • If ((Number of units in (Units in Opendoorgrp) Equal to 0) then do (Destructible - Close Gate (Horizontal) 0004 &lt;gen&gt;) Else (Do Nothing)
    • Custom script - call GroupClear(udg_Opendoorgrp)


is it now leak free?:D

also i have 4 doors with each different regions. can i still use only 1 group? or does that cause problems if multiple doors are opened at the same time?
 

Rainther

I guess I should write something of value here...
Reaction score
61
Use 4 seperate groups.

And what it comes to clear or destroying from what I believe it's that destroying does leaks a small amount (from what I've heard), which makes reusing the unit group better. And sorry for messing with you, but on second thoughs you don't need the custom script and you only need to add entering unit to Unit Group in Trigger 1.
 

Samael88

Evil always finds a way
Reaction score
181
I just want to add something here that the others seem to have overlooked:eek:

It's more of a suggestion really.

Use the "if/then/else multiple conditions" instead of the standard one and leave the the else empty.

The "Do nothing" function is a function that really does absolutely nothing good except adding two unnecessary function calls:eek:

Edit: Oh, and I might aswell contribute to the solution while I'm at it:)

I would go for having one region for the open trigger, probably as you have it now.
And then a second region that is two or three times larger for the other trigger, hence you won't be as likely to get the problem of unit's being closed out.
 

Hacklefellar

New Member
Reaction score
1
so u say that if i don't put in anything in the else part, it doesn't leak?
i thought it would just BECAUSE there is a piece of code expected :S but i'm new to this so thats just my logic:D

anyway if this is to be leak-free i thank-thee haha:D
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
Trigger:
  • Trigger
    • Events
      • Unit - Leaves Open Door &lt;gen&gt;
    • Conditions
    • Actions
      • Set Opendoorgrp = Units in Open Door &lt;gen&gt;
      • If ((Number of units in (Units in Opendoorgrp) Equal to 0) then do (Destructible - Close Gate (Horizontal) 0004 &lt;gen&gt;) Else (Do Nothing)
      • Custom script: call DestroyGroup(udg_Opendoorgrp)


There. And remove the group thing in first trigger ^^.
 
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
    +1
  • 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