1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The reforging of the races is complete. Come see the 14th Techtree Contest Results.
    Dismiss Notice
  4. It's time to choose your horse in the race - the 32nd Modeling Contest Poll is up!
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Enemies Spawning

Discussion in 'World Editor Help Zone' started by Impereal Gardian, May 28, 2014.

  1. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
    Hello!

    I seem to be running into a problem. What the problem is, is that I have <Region 1> spawns units randomly in the region.

    But what i am aiming for is to make enemies spawn globally, except for certain regions.

    If this is unclear, I can provide some pictures.
    Thanks :D!
     
  2. Solu9

    Solu9

    Joined:
    Jan 25, 2011
    Messages:
    2,165
    Resources:
    47
    Models:
    26
    Icons:
    16
    Skins:
    1
    Tools:
    1
    Maps:
    3
    Resources:
    47
    Events -
    Conditions -
    Actions -
    Set Temp_Point = Somewhere in the map
    if -
    Region X contains Temp_Point
    Then -
    Custom script: call RemoveLocation (udg_pTemp_Point)
    Run This Trigger
    Else -
    Spawn your units

    Under the If -
    You can do an "Or, multiple conditions" check to check all of the non spawning regions
     
  3. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
  4. Solu9

    Solu9

    Joined:
    Jan 25, 2011
    Messages:
    2,165
    Resources:
    47
    Models:
    26
    Icons:
    16
    Skins:
    1
    Tools:
    1
    Maps:
    3
    Resources:
    47
    First of. Always use "If/Then/Else, Multiple Functions". It gives you much more control and is a LOT easier to edit.

    Anyway you are doing it right in the first picture. But instead of "Random point in region" use the Temp_Point variable.

    Edit:
    Oh. Temp_Point is a Point variable NOT a region variable.

    Edit2:

    Under actions, first set the Temp_Point to a Fx. random point in playable area.
    Then add the If/Then/Else, Multiple Functions action.
     
  5. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
    Thanks, i'll let you know how it goes in a few hours
     
  6. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
  7. Solu9

    Solu9

    Joined:
    Jan 25, 2011
    Messages:
    2,165
    Resources:
    47
    Models:
    26
    Icons:
    16
    Skins:
    1
    Tools:
    1
    Maps:
    3
    Resources:
    47
    Ah. Remove the lower case p so it looks like this:
    Custom script: call RemoveLocation (udg_Temp_Point)
    The p was just a remnant from my own trigger.

    Edit:
    Btw. Post your triggers as triggers instead of pictures. Pretty please.

    Edit2:
    After looking at the picture it is clear that the trigger will not work.
    Can you figure out why?
     
  8. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
    Ah, just remembered how to do that :p

    However, when i try to testrun the map it closes out of warcraft 3 and leaves no saying why.

    Zombie Spawn Test
    Events
    Player - Player 1 (Red) types a chat message containing -coop as A substring
    Conditions
    Actions

    Set Temp_Point = (Random point in Dont Spawn Enemies <gen>)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
    (Dont Spawn Enemies <gen> contains Temp_Point) Equal to True
    Then - Actions
    Custom script: call RemoveLocation (udg_Temp_Point)
    Trigger - Run (This trigger) (checking conditions)
    Else - Actions
    Unit - Create 1 Zombie 1 for Player 5 (Yellow) at (Random point in Whole Map <gen>) facing (Center of Whole Map <gen>)

    Edit - "After looking at the picture it is clear that the trigger will not work.
    Can you figure out why?" -nope i'm not so familiar with this :/ trying to be though
     
  9. Solu9

    Solu9

    Joined:
    Jan 25, 2011
    Messages:
    2,165
    Resources:
    47
    Models:
    26
    Icons:
    16
    Skins:
    1
    Tools:
    1
    Maps:
    3
    Resources:
    47
    When you post your trigger do it between trigger tags. [trigger.]YOUR TRIGGER[/trigger.] (without punctuations).

    Yeah it does not work. As I said in edit2. Can you figure out why?
    It's actually quite obvious once you see it.
     
  10. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
    Is it the fact that im using regions to spawn enemies and not using Entire Map thingy?
     
  11. Solu9

    Solu9

    Joined:
    Jan 25, 2011
    Messages:
    2,165
    Resources:
    47
    Models:
    26
    Icons:
    16
    Skins:
    1
    Tools:
    1
    Maps:
    3
    Resources:
    47
    Sort of.
    You place the Temp_Point in the region where units are not allowed to spawn.
    Yet you check in the IF - condition that if the point is in that same region you run the trigger again. And thus is will loop indefinitely and crash the game.
    The Temp_Point must be placed a random point all the playable area (meaning where you want units to spawn).
    The reason for the if/then/else is to check if the point is within one of those non-spawn zones. If it is you want to remove the point and set a new.

    Since you didn't specify whether or not the whole of the map is able for spawn I just assumed it is.
    If not. Then the trigger will not be as simple as it is right now.
     
  12. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
    Wait, so You place the Temp_Point in the region where units are not allowed to spawn.

    but

    The Temp_Point must be placed a random point all the playable area (meaning where you want units to spawn).

    Im a bit confused, sorry :x

    Note: Messed with it a bit, i got units to spawn, but they still spawned in non-spawning areas
     
  13. Solu9

    Solu9

    Joined:
    Jan 25, 2011
    Messages:
    2,165
    Resources:
    47
    Models:
    26
    Icons:
    16
    Skins:
    1
    Tools:
    1
    Maps:
    3
    Resources:
    47
    No. However in your trigger YOU do.

    The reason for the If/Then/Else is to see if the Temp_Point is located in the Don't Spawn Region. IF it is, then the trigger is run again.

    Perhaps you should specify your needs better. We might be talking past each other and that's why is harder to understand.
    Fx. Can the units spawn ANYWHERE besides the Don't Spawn Region in your map?
     
  14. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
    The enemy units can spawn anywhere except the non-spawn room.

    Got them to spawn, but still some spawn in the non-spawning area
     
  15. Solu9

    Solu9

    Joined:
    Jan 25, 2011
    Messages:
    2,165
    Resources:
    47
    Models:
    26
    Icons:
    16
    Skins:
    1
    Tools:
    1
    Maps:
    3
    Resources:
    47
    So far so good. Post your current trigger.
     
  16. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
    • Zombie Spawn Test
      • Events
        • Player - Player 1 (Red) types a chat message containing -coop as A substring
      • Conditions
      • Actions
        • Set Temp_Point = (Random point in Whole Map <gen>)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Dont Spawn Enemies <gen> contains Temp_Point) Equal to True
          • Then - Actions
            • Custom script: call RemoveLocation (udg_Temp_Point)
            • Trigger - Run (This trigger) (checking conditions)
          • Else - Actions
            • Unit - Create 1 Zombie 1 for Player 5 (Yellow) at (Random point in Whole Map <gen>) facing (Center of Whole Map <gen>)


    I removed a bunch of the "create units" to make it shorter

    edit: (Dont Spawn Enemies <gen> contains Temp_Point) Equal to True <-- im noob but it seems fishy
     
  17. Solu9

    Solu9

    Joined:
    Jan 25, 2011
    Messages:
    2,165
    Resources:
    47
    Models:
    26
    Icons:
    16
    Skins:
    1
    Tools:
    1
    Maps:
    3
    Resources:
    47
    Yup. I said this some posts ago.
    This action:
    Unit - Create 1 Zombie 1 for Player 5 (Yellow) at (Random point in Whole Map <gen>) facing (Center of Whole Map <gen>)

    You want the unit to spawn at Temp_Point. Because the whole reason (well one of them) for setting the Temp_Point is to know if it is inside the Don't Spawn Region.
    Therefore you must create the unit a the point you set, which means Temp_Point.

    It should look like this:
    Unit - Create 1 Zombie 1 for Player 5 (Yellow) at (Temp_Point) facing (Center of Whole Map <gen>)

    Also.
    If it is not important then don't make the unit face a point. Just leave it as it was.
    The reason for this is that you will need to set a second point "Center of Whole Map" otherwise it will also cause a point leak.

    Speaking of leaks. Read this until you understand it:
    http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=27219

    Lastly. In the very end of your trigger you also need to do a point removal. Right know you only remove it if the point you set is in the Don't Spawn Region.
    So at the end (outside the If/Then/else) do:
    Custom script: call RemoveLocation (udg_Temp_Point)
     
  18. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
    Okay so it works for the most part. Small question, what if I want them to spawn (for example) 1 by 1, and not spawn as a group?
    i need Each zombie spawns somewhere different on the map except the non-spawn area, not together

    • Zombie Spawn Test
      • Events
        • Player - Player 1 (Red) types a chat message containing -coop as A substring
      • Conditions
      • Actions
        • Set Temp_Point = (Random point in Whole Map <gen>)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Dont Spawn Enemies <gen> contains Temp_Point) Equal to True
          • Then - Actions
            • Custom script: call RemoveLocation (udg_Temp_Point)
            • Trigger - Run (This trigger) (checking conditions)
          • Else - Actions
            • Unit - Create 1 Zombie 1 for Player 5 (Yellow) at Temp_Point facing Default building facing degrees
            • Unit - Create 1 Zombie 1 for Player 5 (Yellow) at Temp_Point facing Default building facing degrees
            • Unit - Create 1 Zombie 1 for Player 5 (Yellow) at Temp_Point facing Default building facing degrees


    I usually just copy/paste the create units and it works, but now they spawn in (this case) a group of 3.

    i do have the call RemoveLocation (udg_Temp_Point) in there, forgot to add it

    big thanks so far :)
     
    Last edited: May 29, 2014
  19. Solu9

    Solu9

    Joined:
    Jan 25, 2011
    Messages:
    2,165
    Resources:
    47
    Models:
    26
    Icons:
    16
    Skins:
    1
    Tools:
    1
    Maps:
    3
    Resources:
    47
    Yeah you will need to loop the trigger. But I need to hit the sack. Crazy tired.
    The problem with the loop is that in the "Then -" action you rerun the trigger.

    I'll get on it when I wake up. Or perhaps you are lucky someone else can give you the answer :)
    Nighty night.
     
  20. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
    Alright, thanks.

    I'll avoid this bit for now and work on the other parts.