What would the trigger be...?

Calibrator

New Member
Reaction score
1
Im making a Ice Escape-Like maze. Its a ice maze typically. One of its triggers makes it start at a randoms level and when you beet that lvl you go to a different lvl. Its always different, so its not in seqeunce, its actually random. What would the trigger be for that? Ty for any answers =D.
 

bumbaclo

New Member
Reaction score
3
Well from what I understand...you could set each of your starting regions to a number (from 1 onward), and then use a trigger to move all the units to a random region by picking a random integer from the set of 1 to however many levels u have.
 

Calibrator

New Member
Reaction score
1
Thats what i was thinking too, but where would the (random region from 1-(whatever)) Trigger be located? Like at which drop down select D=?
 

bumbaclo

New Member
Reaction score
3
So basically make a region variable with an array. Then pre-set each of the starting regions, e.g. Start[1] = region 1, Start[2] = region 2, etc...Set another variable Random = Random integer from 1 to (# of regions). Then for the trigger action do: Move units to Start[Random].

The only problem i see is that it could also move to the same level, or a level previously done. So after every level is finished you could set the region for that level to no region, and use an if statement for the trigger: If Start[Random] = no region, then Run the trigger again (ignoring conditions).

This is a freehand draft so someone else can correct the mistakes if there are any.
 

Calibrator

New Member
Reaction score
1
I forgot to say this, im not so good with variables xD. Can you explain a little easier? (or even better, step-by-step for the variables xD). Sorry, but everyone starts somewhere =D
 

bumbaclo

New Member
Reaction score
3
Ok so I got my editor out and heres two triggers you need:

Trigger:
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Start[0] = Region 000 <gen>
      • Set Start[1] = Region 001 <gen>
      • Set Start[2] = Region 002 <gen>


Trigger:
  • Untitled Trigger 002
    • Events
    • Conditions
    • Actions
      • Set Random = (Random integer number between 1 and 10)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LevelDone[Random] Equal to True
        • Then - Actions
          • Trigger - Run (This trigger) (ignoring conditions)
        • Else - Actions
          • Unit - Move (Triggering unit) instantly to (Center of Start[Random])


There are 3 variables here: Start, LevelDone, and Random.
Start is a region array, Leveldone is a boolean array, and Random is an integer.
To make arrays, when creating the variable, check the "array" box on the lower left corner.

The first trigger is to pre-set all the different Start regions.
The second trigger shows the actions: Random will be set from 1 to the # of regions you have. When a level is finished, set LevelDone[# corresponding to the start region] = true. For example: If you put the Level which starts at Region A as 1, then when you finish the level, put LevelDone[1] = True as well.
 

Calibrator

New Member
Reaction score
1
Hm, i did that and edited so when it hit a region, it would run that trigger, but it kills me. thats all it does. Kills the trigger unit. Anyone else know how to do what i asked?
 

Calibrator

New Member
Reaction score
1
It worked. But it randoms the same thing every time i restart the game. it goes lvl 4 - 2 -3 , but it doesnt change if i restart the game. It keeps going 4-2-3. How can i make it so that it is different each game?
 

Seprest

New Member
Reaction score
15
Don't bump more than once in 24 hours. Most of us look at most posts on the entire front page and will offer suggestions if we have them.


If you only want to use each 'level' once, then you must set the slot in the boolean array corresponding to the random number to false. The boolean array must also be set to false in all indexes by default.

If the second trigger does not have an event, it is quite possible 4-2-3 is the default order your map teleports your unit to when you hit the end of each of those levels. If you were using a teleport-like trigger using circle of powers ect beforehand, make sure you disable them and change whatever event you used to use to move the unit between levels, to instead be the event for the 2nd trigger posted above.
 

Calibrator

New Member
Reaction score
1
Sadly, i did everything you said, and at the same result. The sequence didnt change at all. (oh, and i had already done everything you said, but i double checked, but still nothing). This is my trigger below.
 

Attachments

  • Crude.png
    Crude.png
    43.5 KB · Views: 155

Seprest

New Member
Reaction score
15
You create a unit gorup in your final action that isn't used.... You just need to move the triggering unit or all units in that unit group, but you only move the triggering unit.


Also why would you run the trigger ignoring conditions? Just make it so that it runs the trigger with conditions.


Now, if you REALLY want to make sure that the first level you go to is random.

Make a different trigger for the first teleportCircle(or whatever you use) that doesn't take into consideration if any of the levels are done, because you should have just started the map. I suggest you try to get THAT trigger to work. It is pretty simple, just teleport to a random region in your region array.

Also set an integer that you increase each trigger, so that this trigger doesn't keep going on after all 3 levels have been exhausted.
 

Calibrator

New Member
Reaction score
1
I did everything you said, and now it takes me to random levels, but it takes me to level that i have already done. Any idea how to make it so it only does level i HAVENT done?
 

Seprest

New Member
Reaction score
15
implement the boolean array :thup:

As in the first trigger you tried. Experiment till it works. Remember, set each spot in the boolean array to false when the map is initialized.
 

Calibrator

New Member
Reaction score
1
Oh, i think i know whats wrong.

LevelDone[random]

Wouldnt that make a level be done, but randomly? So the lvl it sets to *done* wouldnt be the same as the Start[random] that i got sent to. Hm... And i dont know what you mean by implement D:
 

Seprest

New Member
Reaction score
15
The LevelDone = true does not set that index it to true. It just checks if it IS true, the = does not set it in this situation, because you are doing a (if/then/else) statement, not SET LevelDone[Random] = true

What it actually does is CHECK if a RandomLevel is TRUE or FALSE, it does not set anything! If the LevelDone[Random] = true, then it will keep running the trigger until it gets a LevelDone[Random] = false (and thus go on to the else statement. I hope you understand it now ;)

The boolean is not there to check off what levels are done per se. It is only there to check IF a level is done. Make sure the boolean array has all needed indexes set to FALSE at the beggining of the map. Also make sure each time a level is selected as not done, and you are teleported to it, you SET LevelDone[Random] = true as an action in the same else statement.

Also make sure you add this ad the beginning of your actions:
Trigger:
  • For each (Integer A) from 1 to 5, do (If (LevelDone[(Integer A)] Equal to True) then do (Set DoneCount = (DoneCount + 1)) else do (Do nothing))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • DoneCount Equal to 5
      • Then - Actions
        • Trigger - Turn off (This trigger)
      • Else - Actions
        • Set DoneCount = 0


DoneCount just checks how many of the levels are done, if all are done, it will stop the trigger. Change all the 5's to the # of levels you have. You'll need to make an integer variable for DoneCount, with it set to 0.
 
General chit-chat
Help Users
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • 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 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