Can anyone give me ideas on how to set up a room of monsters appearing?

tom_mai78101

The Helper Connoisseur / Ex-MineCraft Host
Staff member
Reaction score
1,697
I'm making a trigger that can make a random number between 10 to 30 creeps appearing in a room during a particular event.

The event is:

When a hero walks in, it sets up a random number.
If the random number matches, or conditions equals true, then monsters appear.
I need ideas on how to make creeps appear randomly. Just ideas.

I made this trigger, but I wondered if it works:

Trigger:
  • Monster Room
    • Events
      • Unit - A unit enters Monster House 1 <gen>
    • Conditions
      • (Triggering unit) Equal to HeroUnit[(Player number of (Owner of (Triggering unit)))]
    • Actions
      • Trigger - Turn off (This trigger)
      • For each (Integer A) from (Random integer number between 1 and 10) to (Random integer number between 25 and 50), do (Actions)
        • Loop - Actions
          • Set TempPoint[500] = (Random point in Monster House 1 <gen>)
          • Unit - Create 1 UnitType[(Random integer number between 0 and 11)] for Neutral Hostile at TempPoint[500] facing Default building facing degrees
          • Unit - Order (Last created unit) to Attack HeroUnit[(Player number of (Owner of (Triggering unit)))]
          • Custom script: call RemoveLocation(udg_TempPoint[500])


Reason is, I'm currently not at my computer. Those are copied-pasted from a text document, which was copied-pasted from WE yesterday.
Any tips, suggestions, etc. are welcome. Thanks in advance. :D
 

emilemil1

New Member
Reaction score
20
With that loop you could easily get more than 30 units.

Try:

For each (Integer A) from 1 to (Random integer number between 10 and 30), do (Actions)

And I wonder if your condition would work. You might have to set a specific number instead of a variable.

Otherwise it should be fine.
 

DarkSonicele

New Member
Reaction score
20
Other than what emilemil1 said, you're turning off the trigger before the rest of the actions have been run. Move it to the bottom!
 

tom_mai78101

The Helper Connoisseur / Ex-MineCraft Host
Staff member
Reaction score
1,697
To DarkSonicele:

The description for the (Turn off this trigger) said, this trigger will continue to execute even after it passes that action.

--------------

To emilemil1:

The problem arises when I don't know what to do with that Monster Room trigger. I am in need of finding a way to enable that trigger only by chance. But it's kind of hard to, you know, mix them up together with two triggers.

One trigger works continually, while the other works when the former trigger turns to true. That's the problem I'm having.
 

Lammet

New Member
Reaction score
0
Monster Room
Events
Unit - A unit enters Monster House 1 <gen>
Conditions
(Triggering unit) Equal to HeroUnit
Actions
Set Unitspawn (Random integer number between 10 and 30)
Unit - Create (Integer(Unitpawn (UnitType MONSTER))) for Neutral Hostile at random point in Region facing Default building facing degrees
Unit - Order (Last created unit) to Attack HeroUnit[(Player number of (Owner of (Triggering unit)))]
Custom script: call RemoveLocation(udg_TempPoint[500])

Something like that?
 

tom_mai78101

The Helper Connoisseur / Ex-MineCraft Host
Staff member
Reaction score
1,697
I forgot, I left out details. Sorry. That's not what I meant in the first place.

Trigger:
  • Dungeon 1A
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Set TempGroup[0] = (Units in (Playable map area))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TempGroup[0]) Less than 100
        • Then - Actions
          • For each (Integer A) from 1 to 12, do (Actions)
            • Loop - Actions
              • Set PlayerPosition[(Integer A)] = (Position of HeroUnit[(Integer A)])
              • Set TempPoint[0] = (PlayerPosition[(Integer A)] offset by 1000.00 towards (Random real number between 0.01 and 360.00) degrees)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Terrain type at TempPoint[0]) Equal to Dungeon - Brick
                      • (Spawn 1 &lt;gen&gt; contains TempPoint[0]) Equal to True
                      • (Spawn 2 &lt;gen&gt; contains TempPoint[0]) Equal to True
                      • (Spawn 3 &lt;gen&gt; contains TempPoint[0]) Equal to True
                • Then - Actions
                  • Unit - Create 1 UnitType[(Random integer number between 0 and 11)] for Neutral Hostile at TempPoint[0] facing Default building facing degrees
                  • Unit - Order (Last created unit) to Attack HeroUnit[(Player number of (Triggering player))]
                  • Trigger - Remove (This trigger) from the trigger queue
                  • Custom script: call RemoveLocation(udg_PlayerPosition[bj_forLoopAIndex])
                  • Custom script: call RemoveLocation(udg_TempPoint[0])
                • Else - Actions
                  • Wait 1.00 seconds
                  • Trigger - Add (This trigger) to the trigger queue (Checking conditions)
        • Else - Actions
          • Do nothing
      • Custom script: call DestroyGroup(udg_TempGroup[0])


I wanted to try and mix this trigger with that Monster Room trigger up there. But I don't know how to do that. I've been trying it for over 2 hours.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top