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.

[Trigger] Just a helpful RPG trigger, Spawns (not a help request)

Discussion in 'Triggers & Scripts' started by gavdaman88, Jun 17, 2008.

  1. gavdaman88

    gavdaman88

    Joined:
    Oct 24, 2007
    Messages:
    428
    Resources:
    1
    Maps:
    1
    Resources:
    1
    OK firstly this trigger leaks big time I'm sure, but it didn't lag up a 6 person battlenet game in the ten trials it received. Basicaly I thought I'd upload it to show the hive just because around about 8 or so people begged me to explain how the trigger worked in a battlenet game (while testing online with random people).

    It is a spawn trigger, that remembers the location of every unit at the beginning of a map, in the event a unit dies who is an enemy, half a minute later it is respawned at that target location, so on, so forth.

    It's probably better suited to single player RPG's but eitherway hope this helps people make RPG's better with this trigger or similar.
     

    Attached Files:

  2. Huurka

    Huurka

    Joined:
    May 6, 2008
    Messages:
    1,606
    Resources:
    0
    Resources:
    0
    There's already a tutorial for it.
     
  3. Kwah

    Kwah

    Joined:
    May 9, 2007
    Messages:
    3,391
    Resources:
    8
    Icons:
    5
    Maps:
    1
    Tutorials:
    2
    Resources:
    8
    Hmm, to post your triggers as triggers right click on the trigger in the area where you modify it. Right click and use Copy as Text.

    Then go to advanced > trigger tags and wrap this around the copied text.

    Hope this helps!
     
  4. spiwn

    spiwn

    Joined:
    Apr 27, 2008
    Messages:
    1,228
    Resources:
    0
    Resources:
    0
    I will not say anything about the leaks(if I said, it would be how to fix them in those particular triggers).
    I will just say that you should not use "for each integer from 1 to 999" but "for each integer from 1 to unitnumber"
    Also u do not need that condition inside the loop(for each integer...) - just store the position directly.
    You should remove the wait - it is useless there, besides waits have issues so avoid them every time when it is possible(example wait time is less than 0.2 or it is in the end of a trigger)
     
  5. Kwah

    Kwah

    Joined:
    May 9, 2007
    Messages:
    3,391
    Resources:
    8
    Icons:
    5
    Maps:
    1
    Tutorials:
    2
    Resources:
    8
  6. spiwn

    spiwn

    Joined:
    Apr 27, 2008
    Messages:
    1,228
    Resources:
    0
    Resources:
    0
    Now that I think about it the loop is unnecessary.
    Do everything in the 'pick up'
    P.s. First Trigger does not Leak!
    I just ran out of nerves to wait to open the other one(my isp is killing me for no particular reason).
     
  7. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,877
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    They do exactly the same thing.

    And what is this thread supposed to be for ? There are countless of threads about this and also a few systems (there is a great RPG Systems map).
    I do not see any use of posting this, especially when it leaks and inefficient.
     
  8. gavdaman88

    gavdaman88

    Joined:
    Oct 24, 2007
    Messages:
    428
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Like I said initially, I posted this due to a group of questions about a system, I wasn't sure how faulty the system was but some of the points made helped me fix it, so thanks guys. If this isn't required I'm not worried if a moderator would rather get rid of the topic, the original spawning tutorial was moreso made for an AOS rather than an rpg, I did check it. The rpg tutorial used region spawns, which are much less effective than positional spawns.
     
  9. spiwn

    spiwn

    Joined:
    Apr 27, 2008
    Messages:
    1,228
    Resources:
    0
    Resources:
    0
    The only problem about this "system" is the second trigger(as I said - first does not leak).
    It uses 90 sec wait and after that dying unit and creates a special effect that is never destroyed.
    The 90 sec wait is just awful and will cause many problems.
     
  10. ban-lord

    ban-lord

    Joined:
    May 26, 2007
    Messages:
    204
    Resources:
    2
    Models:
    1
    Tutorials:
    1
    Resources:
    2
    Heres my trigger

    • Events
      • Map initialization
    • Conditions
    • Actions
      • set temporaryInteger = 0
      • set temporary_Group = (Units in (Playable map area) owned by Neutral Hostile
      • Unit Group - Pick every unit in temporary_Group and do (Actions)
        • Loop - Actions
          • Set unitPoint[temporaryInteger] = (Position of (Picked unit))
          • Set units[temporaryInteger] = (Unit-type of (Picked unit))
          • Unit - Set the custom value of (Picked unit) to temporaryInteger
          • Set temporaryInteger = (temporaryInteger + 1)
      • Custom script: call DestroyGroup(udg_temporary_Group)


    • Events
      • Unit - A unit owned by Neutral Hostile Dies
    • Conditions
      • ((Dying unit) is Summoned) Equal to (==) False
    • Actions
      • Wait (Random real number between 45.00 and 60.00 game-time seconds
      • Unit - Create 1 units[(Custom value of (Dying unit))] for Neutral Hostile at unitPoint[(Custom value of (Dying unit))] facing Default building facing 270.0 degrees
      • Unit - Set the custom value of (Last created unit) to (Custom value of (Dying unit))


    Enjoy. Oh, and for those who don't know. It will revive the unit that dies at the position it started at.
     
    Last edited: Jun 18, 2008
  11. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,877
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    It will bug. Like I've been saying in about 30 threads, Dying Unit (or CAsting Unit or Crappy Unit or anything beside Triggering Unit) bugs after waits. Well, not really bugs, but it is a freaking GLOBAL. It holds ONE UNIT. Therefore, if you kill two units (and it's quite easy to kill two units in 60 seconds) it will only revive the second one.
    For god sake, use Triggering Unit already and stop this bad habit -.-

    set temporary_Group = ...
    Custom script: call DestroyGroup(udg_Temp_Group)


    Removing the wrong group ?
     
  12. ban-lord

    ban-lord

    Joined:
    May 26, 2007
    Messages:
    204
    Resources:
    2
    Models:
    1
    Tutorials:
    1
    Resources:
    2
    Haha, fixed. Thanks for noticing.