System Simple but very effective and useful pathing friendly door system

SuperSoldier

New Member
Reaction score
10
sLsDoors
by sLsIDK (me)​

sLsDoors is a pathing friendly door system created in GUI. It also handles the locking of the door with an item. The locking of the door is for the game, Parasite Resurrection, by Bsw_Hunter. The locking system is not intended for more than one key. With a key any door can be locked or unlocked, not just the ones it or you locked.

This system works by creating a dummy doodad at the exact point of the gate. The dummy doodad is the one that will be shown when the gate is closed (locked or unlocked) and is the one that will take damage. This system hides the dummy doodad, instead of opening it, so it keeps its health. What this system does is when a unit gets close enough to it, the real gate will either remain open or close. The dummy gate will either get hidden or stay visible.

By the way, if a door is locked it will spam the message, I'll fix it later.
Fixed, you will now see the message upon locking and only each time any unit goes up to it.

An example of how this system works:
The green points are where the unit is or where the unit right clicked to.
The yellow lines are the direct path, going over terrain, doodads, every thing.
The red lines are the actual path taken.
The door on the left is triggered to open if a unit comes close to it, and is not using this system.

pathingexplanation.jpg


Here's the code:

sLsDoors Init
Trigger:
  • sLsDoors Init
    • Events
      • Time - Elapsed game time is 0.50 seconds
    • Conditions
    • Actions
      • Set sLsDoors_Area_Around_Door = 256.00
      • -------- ^^^The area around the doodads inwhich the group will be picked^^^ --------
      • Set sLsDoors_Type_1_H = Iron Gate (Horizontal)
      • -------- ^^^The first type of door that will be picked^^^ --------
      • Set sLsDoors_Type_1_V = Iron Gate (Vertical)
      • -------- ^^^I used the vertical form here^^^ --------
      • Set sLsDoors_Type_1_H_Dummy = Iron Gate Dummy (Horizontal)
      • -------- ^^^The dummy doodad(copy and paste doodad but with no pathing)^^^ --------
      • Set sLsDoors_Type_1_V_Dummy = Iron Gate Dummy (Vertical)
      • -------- ^^^The dummy doodad(copy and paste doodad but with no pathing)^^^ --------
      • Set sLsDoors_Type_2_H = Iron Gate (Horizontal)
      • Set sLsDoors_Type_2_V = Iron Gate (Horizontal)
      • Set sLsDoors_Type_2_H_Dummy = Iron Gate Dummy (Horizontal)
      • Set sLsDoors_Type_2_V_Dummy = Iron Gate Dummy (Horizontal)
      • Destructible - Pick every destructible in (Playable map area) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Destructible-type of (Picked destructible)) Equal to sLsDoors_Type_1_H
                  • (Destructible-type of (Picked destructible)) Equal to sLsDoors_Type_1_V
                  • (Destructible-type of (Picked destructible)) Equal to sLsDoors_Type_2_H
                  • (Destructible-type of (Picked destructible)) Equal to sLsDoors_Type_2_V
            • Then - Actions
              • Set sLsDoors_Count = (sLsDoors_Count + 1)
              • Set sLsDoors_Doors[sLsDoors_Count] = (Picked destructible)
              • Set sLsDoors_TempPoint = (Position of (Picked destructible))
              • Destructible - Open (Picked destructible)
              • Destructible - Hide (Matching destructible)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Destructible-type of (Picked destructible)) Equal to sLsDoors_Type_1_H
                • Then - Actions
                  • Destructible - Create a sLsDoors_Type_1_H_Dummy at sLsDoors_TempPoint facing Default building facing with scale 0.90 and variation 0
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Destructible-type of (Picked destructible)) Equal to sLsDoors_Type_1_V
                • Then - Actions
                  • Destructible - Create a sLsDoors_Type_1_V_Dummy at sLsDoors_TempPoint facing Default building facing with scale 0.90 and variation 0
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Destructible-type of (Picked destructible)) Equal to sLsDoors_Type_2_H
                • Then - Actions
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Destructible-type of (Picked destructible)) Equal to sLsDoors_Type_2_V
                • Then - Actions
                • Else - Actions
              • Set sLsDoors_Dummies[sLsDoors_Count] = (Last created destructible)
              • Custom script: call RemoveLocation(udg_sLsDoors_TempPoint)
            • Else - Actions


sLsDoors
Trigger:
  • sLsDoors
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to sLsDoors_Count, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (sLsDoors_Dummies[(Integer A)] is alive) Equal to True
            • Then - Actions
              • Set sLsDoors_TempPoint = (Position of sLsDoors_Dummies[(Integer A)])
              • Set sLsDoors_TempUGroup = (Units within sLsDoors_Area_Around_Door of sLsDoors_TempPoint)
              • Set sLsDoors_TempInt = 0
              • Unit Group - Pick every unit in sLsDoors_Lock_Group[(Integer A)] and do (Actions)
                • Loop - Actions
                  • Set sLsDoors_TempPoint2 = (Position of (Picked unit))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Distance between sLsDoors_TempPoint and sLsDoors_TempPoint2) Greater than 256.00
                    • Then - Actions
                      • Unit Group - Remove (Picked unit) from sLsDoors_Lock_Group[(Integer A)]
                    • Else - Actions
                  • Custom script: call RemoveLocation(udg_sLsDoors_TempPoint)
              • Unit Group - Pick every unit in sLsDoors_TempUGroup and do (Actions)
                • Loop - Actions
                  • Set sLsDoors_TempInt = (sLsDoors_TempInt + 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • sLsDoors_Locked[(Integer A)] Equal to False
                    • Then - Actions
                      • Destructible - Show sLsDoors_Doors[(Integer A)]
                      • Destructible - Open sLsDoors_Doors[(Integer A)]
                      • Destructible - Hide sLsDoors_Dummies[(Integer A)]
                      • Destructible - Make sLsDoors_Dummies[(Integer A)] Invulnerable
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ((Picked unit) is in sLsDoors_Lock_Group[(Integer A)]) Equal to False
                        • Then - Actions
                          • Destructible - Hide sLsDoors_Doors[(Integer A)]
                          • Unit Group - Add (Picked unit) to sLsDoors_Lock_Group[(Integer A)]
                          • Destructible - Close sLsDoors_Doors[(Integer A)]
                          • Destructible - Show sLsDoors_Dummies[(Integer A)]
                          • Destructible - Make sLsDoors_Dummies[(Integer A)] Vulnerable
                          • Custom script: call DisplayTextToPlayer(GetOwningPlayer(GetEnumUnit()),0,0,"|cff808040Door is locked")
                          • Sound - Play gg_snd_LockedDoor at 100.00% volume, located at sLsDoors_TempPoint with Z offset 0.00
                        • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • sLsDoors_TempInt Equal to 0
                • Then - Actions
                  • Destructible - Hide sLsDoors_Doors[(Integer A)]
                  • Destructible - Open sLsDoors_Doors[(Integer A)]
                  • Destructible - Show sLsDoors_Dummies[(Integer A)]
                  • Destructible - Make sLsDoors_Dummies[(Integer A)] Vulnerable
                • Else - Actions
              • Custom script: call DestroyGroup(udg_sLsDoors_TempUGroup)
              • Custom script: call DestroyGroup(udg_sLsDoors_TempUGroup2)
              • Custom script: call RemoveLocation(udg_sLsDoors_TempPoint)
            • Else - Actions
              • Destructible - Open sLsDoors_Doors[(Integer A)]
              • Destructible - Hide sLsDoors_Doors[(Integer A)]


sLsDoors Lock
Trigger:
  • sLsDoors Lock
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Captain's Key Card
    • Actions
      • Set sLsDoors_TempPoint = (Position of (Hero manipulating item))
      • For each (Integer A) from 1 to sLsDoors_Count, do (Actions)
        • Loop - Actions
          • Destructible - Pick every destructible within sLsDoors_Area_Around_Door of sLsDoors_TempPoint and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • sLsDoors_Doors[(Integer A)] Equal to (Picked destructible)
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • sLsDoors_Locked[(Integer A)] Equal to False
                    • Then - Actions
                      • Set sLsDoors_Locked[(Integer A)] = True
                    • Else - Actions
                      • Set sLsDoors_Locked[(Integer A)] = False
                • Else - Actions
      • Custom script: call RemoveLocation(udg_sLsDoors_TempPoint)


Changelog:
v3.5.2: Fixed a leak (map not fixed)
v3.5.1: Well let's just say it works exactly the same, just 0.4KB less because I'm not smart...
v3.5: Reworked lock message system (thanks to black.sheep)
v3.0: Finished the lock message system
v2.0: The actual door system works!
v1.0: Complete and utter failure...

Here's the (final(redone)) example map with the system

Woah, this map leaks, I fixed the trigger on the forum post but I'm at school at can't edit the map.
View attachment sLsDoors(Final2).w3x
 

SuperSoldier

New Member
Reaction score
10
Bump, comments?
Also, I finished the system and it should be perfect. I have no idea what the sound that is supposed to be played, I just copied the two actions (the display and the sound) from Bsw_Hunter's map (an unprotected one of course).
 

black.sheep

Active Member
Reaction score
24
Okay, problem
You create like 50 or so massive groups each tick.
Replace tempgroup2 with
Trigger:
  • Unit Group - Pick every unit in sLsDoors_Lock_Group[(Integer A)] and do (Actions)
    • Loop - Actions
      • Set TempLoc01 = (Position of (Picked unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between TempLoc01 and sLsDoors_TempPoint) Greater than or equal to 260.00
        • Then - Actions
          • Unit Group - Remove (Picked unit) from sLsDoors_Lock_Group[(Integer A)]
        • Else - Actions
      • Custom script: call RemoveLocation(udg_TempLoc01)
 
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

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top