System Spawn Units at Point Over Time (SUPOT)

Discussion in 'Systems and Snippets' started by Prometheus, Aug 7, 2008.

  1. Flare

    Flare Stops copies me! Staff Member

    Ratings:
    +662 / 0 / -0
    Ah, I see you mentioned the .destroy part, but I don't see (or amn't fully understanding) where you mentioned anything about
    (I'll be able to test those things I mentioned in the next few hours once I get home)
     
  2. Prediter[BuB

    Prediter[BuB Well-Known Member

    Ratings:
    +35 / 0 / -0
    Maybe I'm a nub but what exactly does this do?
     
  3. Prometheus

    Prometheus Everything is mutable; nothing is sacred Staff Member

    Ratings:
    +592 / 0 / -0
    Lets say you have a footies map. You can just spawn everything with one function call.
    I'm having issues with my latest version because it's returning a struct and it isn't assigning properly.
     
  4. Flare

    Flare Stops copies me! Staff Member

    Ratings:
    +662 / 0 / -0
    You're having problems with v4.0 or a version-in-development?

    And what exactly isn't assigning properly? The returned value?
     
  5. Prometheus

    Prometheus Everything is mutable; nothing is sacred Staff Member

    Ratings:
    +592 / 0 / -0
    Yeah, I'll hit you up on MSN so we can try to fix it.
     
  6. Prometheus

    Prometheus Everything is mutable; nothing is sacred Staff Member

    Ratings:
    +592 / 0 / -0
    Updated to 4.5
    Tis cool n all nao.

    Edit
    4.6
    Safeties added
     
  7. Flare

    Flare Stops copies me! Staff Member

    Ratings:
    +662 / 0 / -0
    Your ChangePlayer safeties are incomplete - you haven't made anything that stops Player (-1) or Player (16) [etc] being used

    Also, the addition of a LastStarted variable may be useful if, say, someone wanted to stop the last started spawn from another trigger (but they may not have access to the instance variable because it was a local and/or the other trigger is located in another scope/library)
     
  8. Prometheus

    Prometheus Everything is mutable; nothing is sacred Staff Member

    Ratings:
    +592 / 0 / -0
    Should I do like
    if player != Player(0) -- Player(15) or player = null then
     
  9. Flare

    Flare Stops copies me! Staff Member

    Ratings:
    +662 / 0 / -0
    JASS:
    if GetPlayerId (whichPlayer) < 0 or GetPlayerId (whichPlayer) > 15 or whichPlayer == null then
    //I assume you're using a player type variable and not an integer for handling the players?
    //Also, I'm not sure if GetPlayerId actually exists, it could be just PlayerId, not really sure :P
      call StopTryingToBreakThingsPlease ()
      return
    endif
     
  10. Artificial

    Artificial Without Intelligence

    Ratings:
    +325 / 0 / -0
    > anything that stops Player (-1) or Player (16)
    Umm... He can't? The game will crash immediately when you call Player() with a bad argument whether it is for this system or not... :p
    And making it take the player as an integer just to prevent this would be stupid, as it is really the user's job to not try to get Player(1337).
     
  11. Flare

    Flare Stops copies me! Staff Member

    Ratings:
    +662 / 0 / -0
    Good point :p Seems it's either use an integer, or hope that people won't be stupid about things :p
     
  12. TheDamien

    TheDamien _

    Ratings:
    +332 / 0 / -0
    I don't think it is necessary. Invalid arguments for Player crash the game, so the chance of one ever been tested for successfully by GetPlayerId is pretty slim. I don't think all those null compares in the System are necessary either. I don't know why reals and integers are being compared to null at all, because it is basically the same as comparing to 0.

    It is also worth noting that the correct spelling is "purpose", and that this system provides no way of handling the units after they have been spawned.
     
  13. Prometheus

    Prometheus Everything is mutable; nothing is sacred Staff Member

    Ratings:
    +592 / 0 / -0
    I've updated to 4.8.

    @TheDamien
    This spawns the units, I'd think you would spawn them into a region to do something.
     
  14. Darthfett

    Darthfett Super Mod

    Ratings:
    +614 / 0 / -0
    Sorry kc, but QFT.

    It's the reason I haven't been paying much attention to the system.
     
  15. Flare

    Flare Stops copies me! Staff Member

    Ratings:
    +662 / 0 / -0
    Perhaps a GetUnitsFromInstance and GetLastUnitFromInstance function might help to get over that?
     
  16. TheDamien

    TheDamien _

    Ratings:
    +332 / 0 / -0
    In most cases, people will want to do something with the units so they will need to set up a region, a trigger and a condition to make sure that only spawned units trigger off the actions. It would be pretty easy to allow the user to provide a function to run on the spawned units, and also to provide functions to grab the id of the triggering spawner, the unit spawned, etc.

    EDIT:

    JASS:
    toggle != true or toggle != false


    Also known as:

    JASS:
    false
     
  17. Prometheus

    Prometheus Everything is mutable; nothing is sacred Staff Member

    Ratings:
    +592 / 0 / -0
    4.9



    4.10
     
  18. emjlr3

    emjlr3 Change can be a good thing Staff Member

    Ratings:
    +396 / 0 / -0
    there is still one fundamental flaw with this system

    your struct is private, thus, your returned integer is of no value to the user

    also, who the hell is emjir3?
     
  19. Prometheus

    Prometheus Everything is mutable; nothing is sacred Staff Member

    Ratings:
    +592 / 0 / -0
    I'll make the struct open.

    Your MSN says emjir3.


    Edit: 5.0 Released
     
  20. Flare

    Flare Stops copies me! Staff Member

    Ratings:
    +662 / 0 / -0
    That's what the modification functions are for - I did pretty much the same thing with my TimedLightning system (I left out the cast to struct, must add that sometime), and it works. If the struct is made available to people, it's just begging for someone to break things with negative/invalud inputs

    Ha, I was right! In your face kc :D
     

Share This Page