1. Head to the 33rd Modeling Contest Poll and drink to your heart's desire.
    Dismiss Notice
  2. Choose your means of doom in the 17th Mini Mapping Contest Poll.
    Dismiss Notice
  3. A slave to two rhythms, the 22nd Terraining Contest is here.
    Dismiss Notice
  4. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  5. The die is cast - the 6th Melee Mapping Contest results have been announced. Onward to the Hive Cup!
    Dismiss Notice
  6. The glory of the 20th Icon Contest is yours for the taking!
    Dismiss Notice
  7. 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.
IcemanBo
Joined:
Sep 6, 2013
Messages:
6,532
Media:
100
Albums:
10

Awarded Medals 1

    1. Chaosy
      Chaosy
      What about a real event that you can use to see when a unit reaches one way point? I think it could have a few uses.
    2. Chaosy
      Chaosy
      Thanks! Come at me vjass pros.

      I am thinking of adding the following functions:

      RemoveWaypoint(integer id) or RemoveWaypoint(location loc)
      AddWaypoint(location loc, integer position)
      StopPatrol(unit u)

      Anything else you can come up with?

      Anyway, for a DEMO I plan to use an patrol ability. The best would be to replace the original patrol to be honest, I think I can manage to do that as well. I might do both actually.
    3. Chaosy
      Chaosy
      -i is such a cheat solution xD [SPOILER]

      I am glad you kept the current method I used though. I was planning to upload it to the spell section in due time so it wouldn't be nice if you remade everything x)
    4. Chaosy
      Chaosy
      I will check.

      edit: seems to work fine indeed. Did you find out what the original mistake was? I don't want to repeat it.
    5. Chaosy
      Chaosy
      I think it's rather short. It is supposed to make a unit patrol between a few way points. This is WIP and not working so I replaced a few variables with RAW values to prevent bugs just in case.
      globals
      group patrolUnits = CreateGroup()
      hashtable patrolHash = InitHashtable()
      endglobals

      function patrol takes unit u, integer locationCount returns nothing
      local integer i = GetHandleId(u)
      local integer loopCount = 0
      local real array x
      local real array y
      call GroupAddUnit(patrolUnits, u)
      loop
      exitwhen loopCount > locationCount
      set loopCount = loopCount + 1
      set x[loopCount] = GetLocationX(udg_patrol_points[loopCount])
      set y[loopCount] = GetLocationY(udg_patrol_points[loopCount])
      endloop
      call SaveInteger(patrolHash, i, 0, locationCount)

      call SaveReal(patrolHash, i, 1, x[1])
      call SaveReal(patrolHash, i, 3, x[2])
      call SaveReal(patrolHash, i, 5, x[3])
      call SaveReal(patrolHash, i, 7, x[4])

      call SaveReal(patrolHash, i, 2, y[1])
      call SaveReal(patrolHash, i, 4, y[2])
      call SaveReal(patrolHash, i, 6, y[3])
      call SaveReal(patrolHash, i, 8, y[4])

      call IssuePointOrderLocBJ(u, "attack", Location(LoadReal(patrolHash, i, 3), LoadReal(patrolHash, i, 4)))
      endfunction

      function Group takes nothing returns nothing
      local unit u = GetEnumUnit()
      local integer h = GetHandleId(u)
      local location array locs
      local location uLoc = GetUnitLoc(u)
      local integer i = -1
      local integer i2 = 0
      loop
      exitwhen i2 > LoadInteger(patrolHash, h, 0)
      call BJDebugMsg(R2S(DistanceBetweenPoints(uLoc, locs[i])))
      set i = i + 2
      set i2 = i2 + 2
      set locs[i2] = Location(LoadReal(patrolHash, h, i), LoadReal(patrolHash, h, i2))
      if DistanceBetweenPoints(uLoc, locs[i2]) < 50 then
      if i2 >= 5 then
      call IssuePointOrderLocBJ(u, "attack", locs[1])
      call BJDebugMsg("new order 1")
      else
      call IssuePointOrderLocBJ(u, "attack", locs[i2 + 1])
      call BJDebugMsg("new order + 1")
      endif

      endif
      endloop
      endfunction

      function patrolUpdate takes nothing returns nothing
      call ForGroup(patrolUnits, function Group)
      endfunction

      //===========================================================================
      function InitTrig_Patrol_System takes nothing returns nothing
      set gg_trg_Patrol_System = CreateTrigger( )
      call TriggerRegisterTimerEventPeriodic( gg_trg_Patrol_System, 0.03 )
      call TriggerAddAction( gg_trg_Patrol_System, function patrolUpdate )
      endfunction

      Patrol Demo
      Events
      Time - Elapsed game time is 1.00 seconds
      Conditions
      Actions
      Set patrol_points[1] = (Center of Region 003 <gen>)
      Set patrol_points[2] = (Center of Region 002 <gen>)
      Set patrol_points[3] = (Center of Region 001 <gen>)
      Set patrol_points[4] = (Center of Region 000 <gen>)
      Set patrol_count = 4
      Set patrol_unit = Marine 0004 <gen>
      Custom script: call patrol(udg_patrol_unit, 4)
    6. Chaosy
      Chaosy
      well I can see why thistype is better, easier to keep in mind, in most cases. It was just an example, someone suggestesd to replace SetUnitState to SetWidgetState, it's kinda the same thing :P

      Well most of you more experienced users are!

      edit:

      Mind taking a look on another code of mine? it isn't working as I want it x)
    7. Chaosy
      Chaosy
      The global block ruins it a little indeed, so if I make a variable inside the struct static it will still be global?

      And well, I know how fussy you jass experts are. "OMFG if you use bullshit.create instead create.bullshit you will actually save 1 microbyte ram which is very important since you only got 8 gig RAM."

      "And if you replace <struct name> with thistype your processor actually needs to work 0.001% less!"

      If you ask me, my solution is good but not optimal. Sadly that's not good enough for the spell section when the speed lovers comment.

      edit: no offense meant, I just love to over do it.
    8. Chaosy
      Chaosy
      What do you have against my solutions? D: It works fine!

      Well your solution is better for sure, but I prefer easier and less complicated solutions. (the exact reason I use hashtables instead of indexing in GUI)
    9. Chaosy
    10. GywGod133
      GywGod133
      IcemanBo

      Its allowed here in hive If I create How to create Aghanims's Scepter Tutorial?
      I search in Google and nothing ^.^
    11. GywGod133
      GywGod133
    12. Deleted member 219079
      Deleted member 219079
      If the mod says I'll have to take the part where I praise it out, I'll take it.
    13. Deleted member 219079
      Deleted member 219079
      why you linked extends array info..

      im not against wurst if you think so >.<
    14. GywGod133
      GywGod133
      -.- Dota so genuise
    15. edo494
      edo494
      you ain't there! :D
    16. GywGod133
      GywGod133
      Hello IcemanBo

      Look this picture
      [IMG]

      Just look the Gold Tooltip, how he put that?
    17. edo494
      edo494
      Its actually typed cyka, but ok :D
    18. edo494
      edo494
      you be judgin? :D do you think its hard? :D I may ask for judge place too maybe :D
    19. Deleted member 219079
    20. Deleted member 219079
      Deleted member 219079
  • Loading...
  • Loading...
  • Interact

    Signature

  • Loading...
  • Loading...
  • Loading...
  • Loading...