Search results

  1. L

    Dynamically allocating array size

    There is no direct way to do this, but you've got some choices. First of all, you can use the (dated) Dary system[1]. Or have a look at vJass' dynamic arrays[2]. And at last, there are always Tables[3]. _______ e: i can't get the links inline, so here they are [1]...
  2. L

    Discussion Vertical Pathing System

    Oh welp, that makes it way, way more complex. And normal wc3 pathfinding wouldn't work, but i think that's also an issue for bridges.
  3. L

    Discussion Vertical Pathing System

    It's not really hard. And i must know, since i already did it ;) But go ahead and build it since it's a nice project. Just look at the bridges as rects or regions an check on entering if the unit is high enough. Also, try to allow bridges above other bridges. But i guess that leaving bridge...
  4. L

    Double Free Error: What is this exactly?

    It means, that you destroy an struct instance which was already destroyed previously.
  5. L

    code array. is it possible ?

    No but you can use vjass function interfaces.
  6. L

    Snippet GetNearestUnit

    It is nice that you reuse other libraries but this really is not the fastest way to get the unit(s).
  7. L

    Snippet GetNearestUnit

    Try it yourself. Or tell me where that this comes from in the method shown below taken from the op. Or tell me where it returns some value of type thistype. static method for takes real x, real y, real r, boolexpr c returns thistype local List node local...
  8. L

    Snippet GetNearestUnit

    Maybe it's just me, but your code in the first post does not compile.
  9. L

    Functions calling themselves, +rep for answers

    Nah, Jass supports recursion. So the above will work. It does not support calling a function which was not defined before calling, so smth like this wont work: function even takes integer i returns boolean if i == 0 then return true else return odd(i-1) endif...
  10. L

    W3O File Specification

    http://tools.assembla.com/svn/war3tools/luadriven/docs/InsideTheW3M.html
  11. L

    Using Code for dynamic functions, is it possible? +rep for answers

    http://wc3c.net/vexorian/jasshelpermanual.html#funcinterf Doesn't work with natives though (or functions in Blizzard.j afair).
  12. L

    Inheritance in JASS

    http://wc3c.net/vexorian/jasshelpermanual.html#extendstruct Uhm? They do. //Generated allocator of Parent function s__Parent__allocate takes nothing returns integer local integer this=si__Parent_F if (this!=0) then set si__Parent_F=si__Parent_V[this] else set...
  13. L

    Static ifs on Zinc

    module SomeModule{ static method A(){ static if(SomeMethod.exists){ SomeMethod(); } } } :confused:
  14. L

    Snippet Minimum Binary Heap

    Using a heap for n insertions you get a time-complexity of O(n*ln n). Everyone agrees? (Don't know if i use the right terminology, correct me if im wrong.) Now lets consider this: globals unit minUnit real minDist real tmpX real tmpY endglobals function foldl takes nothing...
  15. L

    Snippet Minimum Binary Heap

    But you don't need a heap to do that. Atleast not if you only want the one nearest unit.
  16. L

    Multiboard Shenanigans

    You can have a global Multiboard, but you can't initialize it inside of the globals block. globals Board m=Board.create() //Error Board n //works endglobals Then you can acces n in your functions. You create the actual multiboard inside of an init function library bla...
  17. L

    Need help storing diffrent struct into one array.

    Just rtfm. It's actually all explained there. If you glance over the TOC you'll even see a point "Extending structs".
  18. L

    Need help storing diffrent struct into one array.

    Dunno, you dont gave that much informations, but this may help http://www.wc3c.net/vexorian/jasshelpermanual.html#interfs Another possiblity is ofcourse http://www.wc3c.net/vexorian/jasshelpermanual.html#typecast But i think it's a dirtier approach. Really depends on your situatuion.
  19. L

    entab

    Tabs are no replacements for a fixed amount of spaces. They align at multiple of the tab-width-amount (normally 4 or 8). a a aa a aaa a aaaa a aaaaa a aaa a a aaaa aaa a Spoiler: So, if you want to replace spaces with tabs, you have to count the position where the next non-space...
  20. L

    Multiple Calls vs A Variable

    Care to elaborate? I mean i'm all for readability and i would use the local too but im not 100% sure it's actually faster. In comparison we've got two native calls versus one native call, one local declaration and two local reads. So the local declaration and two reads have to be faster...
Top