Lever

Crofna

New Member
Reaction score
0
I made lever something like this (cant copy GUI coz no WE on this comp...)
When lever dies, gates will open.
But i want lever wich can open and close door.
 

Moridin

Snow Leopard
Reaction score
144
How about something like this. You have a real variable that's default is 0 (It is named Lever_Set in the triggers below). Make the lever have 999999 life (Not invulnerable, you want it to be attackable) and 99999 life regen. Then set a trigger such that:

Trigger:
  • Lever gets attacked
    • Events
      • Unit - A unit is attacked
    • Conditions
      • Unit - Unit-type of (Triggering unit) Equal to Lever
    • Actions
      • If (multiple conditions) then (then actions) else (else actions)
        • If - conditions
          • Lever_Set = 0
        • then - actions
          • Set Lever_Set = 1
        • else - actions
      • If (multiple conditions) then (then actions) else (else actions)
        • If - conditions
          • Lever_Set = 1
        • then - actions
          • Set Lever_Set = 0
        • else - actions


...and then make two more triggers with the events:

Game - Lever_Set becomes equal to 1

...for this trigger (above)^ make it open the gate in the actions.

Game - Lever_Set becomes equal to 0

...for this trigger (above)^ make it close the gate in the actions.
 

Crofna

New Member
Reaction score
0
Trigger:
  • Lever gets attacked
    • Events
      • Unit - A unit is attacked
    • Conditions
      • Unit - Unit-type of (Triggering unit) Equal to Lever
    • Actions
      • If (multiple conditions) then (then actions) else (else actions)
        • If - conditions
          • Lever_Set = 0
        • then - actions
          • Set Lever_Set = 1
        • else - actions
      • If (multiple conditions) then (then actions) else (else actions)
        • If - conditions
          • Lever_Set = 1
        • then - actions
          • Set Lever_Set = 0
        • else - actions


Action part...
 

Joccaren

You can change this now in User CP.
Reaction score
54
Hes using Integer Variables and If/Then/Elses

You can create variable in the variable window (Click the golden 'X' in your trigger editor)

You can set variables to a value by using the 'set variable' action.

If/Then/Else I think you can do. If not, ask and I'll tell you.
 

Crofna

New Member
Reaction score
0
Trigger:
  • Lever
    • Events
      • Unit - Lever 0537 <gen> Is attacked
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Lever
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
        • Else - Actions


Now what? What type of variable i need?
 

Crofna

New Member
Reaction score
0
Cool, now i made

Trigger:
  • Lever
    • Events
      • Unit - Lever 0537 <gen> Is attacked
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Lever
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Lever_Set Equal to 0
        • Then - Actions
          • Set Lever_Set = 1
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Lever_Set Equal to 1
        • Then - Actions
          • Set Lever_Set = 0
        • Else - Actions


What now?
 

Joccaren

You can change this now in User CP.
Reaction score
54
Create two triggers.

One activates when the Integer Variable becomes 0 and then opens the door.

Two activates when the Integer Variable becomes 1 and then closes the door.
 

Moridin

Snow Leopard
Reaction score
144
Joccaren you need Real variables...not integer.

Basically theres an event "a real variable becomes ____" and you need to trigger that so that the gate opens and closes.

As for "what now?":

1) Create a trigger something like:

Trigger:
  • Trigger
    • Events
      • Game - Lever_Set becomes Equal to 1
    • Conditions
    • Actions
      • <open the gate....I'm not sure how to do this as I haven't fiddled with gates>


2) Create another trigger like:

Trigger:
  • Trigger
    • Events
      • Game - Lever_Set becomes Equal to 1
    • Conditions
    • Actions
      • <close the gate....I'm not sure how to do this as I haven't fiddled with gates>
 

Joccaren

You can change this now in User CP.
Reaction score
54
Joccaren you need Real variables...not integer.

Why? In your WC3 tags here you used Integer. The only difference between the two is that reals can be 0.01, 0.02 ect and Integers can not. If he really wanted to, he could use a boolean for the same affect.
 

Moridin

Snow Leopard
Reaction score
144
Woops...didn't realise the wc3 tags part...it was freehand and I'm used to integers.

He needs real for the event. I'm not sure...but I don't think there's an event to do with an integer becoming a certain value.

Edit: btw, I understand the difference between reals and integers thanks :p.
 

Joccaren

You can change this now in User CP.
Reaction score
54
Well, it would be easier to use reals but there are also these two things:

1. (Conversion (Integer to Real))
2. (Run (Trigger 2) Ignoring Conditions)
 

Crofna

New Member
Reaction score
0
Guyz, guyz...
Now you confused me! If I make integer variable I cant open/close door. If i make real i cant set

Trigger:
  • Lever 1
    • Events
      • Unit - Lever 0537 <gen> Is attacked
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Lever
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Value Equal to 0
        • Then - Actions
          • Set Variable = 1
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Value Equal to 1
        • Then - Actions
          • Set Variable = 0
        • Else - Actions
 

Moridin

Snow Leopard
Reaction score
144
Lol. I apologise crofna :p.

Actually to make it much simpler....all you have to do is slightly modify that one trigger:

Trigger:
  • Lever 1
    • Events
      • Unit - Lever 0537 <gen> Is attacked
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Lever
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Value Equal to 0
        • Then - Actions
          • Set Variable = 1
          • <Door opening actions here>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Value Equal to 1
        • Then - Actions
          • Set Variable = 0
          • <Door closing actions here>
        • Else - Actions
 

Joccaren

You can change this now in User CP.
Reaction score
54
Lolz, should have seen that sooner

Also, in your first If/Then Else, add this action:

Trigger:
  • Animation - Play (Lever)'s (Death) animation


and this to your second I/T/E:

Trigger:
  • Animation - Play (Lever)'s (Stand) animation
 

Moridin

Snow Leopard
Reaction score
144
Crofna, for each door you will probably need a new variable. Also make sure that the condition checks for the right lever and the actions open the right door.

@Joccaren: We all make mistakes :p lol. I didn't see that either.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top