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. Lead your forces to battle in the 15th Techtree Contest. The call is yours, commander!
    Dismiss Notice
  4. The reforging of the races is complete. Come see the 14th Techtree Contest Results.
    Dismiss Notice
  5. It's time to choose your horse in the race - the 32nd Modeling Contest Poll is up!
    Dismiss Notice
  6. 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. Solu9

    Solu9

    Joined:
    Jan 25, 2011
    Messages:
    2,165
    Resources:
    47
    Models:
    26
    Icons:
    16
    Skins:
    1
    Tools:
    1
    Maps:
    3
    Resources:
    47
    Alright. Try this:

    • Untitled Trigger 001
      • Events
        • Player - Player 1 (Red) types a chat message containing -coop as An exact match
      • Conditions
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Spawn_Integer Greater than 5
          • Then - Actions
            • Set Temp_Point = (Random point in (Playable map area))
            • 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 for Player 5 (Yellow) at Temp_Point facing Default building facing degrees
                • Set Spawn_Integer = (Spawn_Integer + 1)
                • Custom script: call RemoveLocation (udg_Temp_Point)
                • Trigger - Run (This trigger) (checking conditions)
          • Else - Actions
            • Set Spawn_Integer = 0


    Spawn_Integer is an Integer variable
    Temp_Point is a Point variable


    If you want to spawn more (or less) than 5 units, then just change the "5" in:
    "Spawn_Integer Greater than 5"
    To whatever amount you need.
     
  2. 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
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Spawn_Integer Greater than 3
          • Then - Actions
            • Set Temp_Point = (Random point in (Playable map area))
            • 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 3 Zombie 1 for Player 5 (Yellow) at Temp_Point facing Default building facing degrees
                • Set Spawn_Integer = (Spawn_Integer + 1)
                • Custom script: call RemoveLocation (udg_Temp_Point)
                • Trigger - Run (This trigger) (checking conditions)
          • Else - Actions
            • Set Spawn_Integer = 0


    For Set Spawn_Integer = (Spawn_Integer + 1) , i used arithmatic

    However, no enemies spawn on the map at all.
     
  3. Solu9

    Solu9

    Joined:
    Jan 25, 2011
    Messages:
    2,165
    Resources:
    47
    Models:
    26
    Icons:
    16
    Skins:
    1
    Tools:
    1
    Maps:
    3
    Resources:
    47
    Ah crap.

    It should be:
    Spawn_Integer Less than or equal to 3

    Yes. it's an arithmetic.
     
  4. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
    Yes! It works perfectly :DDD

    Thanks, it really means a lot to me :)
    credits given in maps once its finished
     
  5. Solu9

    Solu9

    Joined:
    Jan 25, 2011
    Messages:
    2,165
    Resources:
    47
    Models:
    26
    Icons:
    16
    Skins:
    1
    Tools:
    1
    Maps:
    3
    Resources:
    47
    Great!
    It was a long journey huh? ;)
    I suggest you look the trigger over and try to understand why it does what it does. There is some very basic stuff there that you need to know.
     
  6. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
    I noticed that because of Set Spawn_Integer = (Spawn_Integer + 1), that adds +1 to a group

    So if i wanted 25 groups, it needs to be set to "Spawn_Integer Greater than 24"

    then the Units created determines how many enemies in those said given groups
     
  7. Solu9

    Solu9

    Joined:
    Jan 25, 2011
    Messages:
    2,165
    Resources:
    47
    Models:
    26
    Icons:
    16
    Skins:
    1
    Tools:
    1
    Maps:
    3
    Resources:
    47
    That's right.
    Why do you need to set the Temp_Point before actually creating the units?
     
  8. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
    To tell where the units can spawn?
     
  9. Solu9

    Solu9

    Joined:
    Jan 25, 2011
    Messages:
    2,165
    Resources:
    47
    Models:
    26
    Icons:
    16
    Skins:
    1
    Tools:
    1
    Maps:
    3
    Resources:
    47
    So simple :)
     
  10. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
    I appreciate your help, i knew this would be the hardest part of this map franchise i plan to make.

    My goal in these is to make them easily customizable by other people, being how the map looks and such.