Search results

  1. T

    Order of creation triggers

    It seems that when you save the map, the order of triggers in the trigger editor is kept, not like the wc3 editor. I mean if you create 4 trigger with the event "map initialization" , the first created trigger will be the most on the top, and the last the most on the bottom. And if you change...
  2. T

    Discussion A way to detect if an handle is invalid

    Maybe most of you already know but you can't store a "null" handle in an hashtable, neither an invalid handle, for example an handle which was destroyed but not setted to null. I've just realized recently we can use that for safety checks. library CheckHandles initializer onInit globals...
  3. T

    Snippet UnitList

    library UnitList requires AutoIndex struct UnitList readonly integer Count = 0 readonly thistype First = 0 readonly thistype Next = 0 readonly thistype Prev = 0 readonly thistype Last = 0 implement AutoDestroy method clear takes nothing returns...
  4. T

    A bot as a player ?

    Is it possible to simulate a player in a local area network game, with only one machine(computer) ? I ask it because sometimes, computer slots are not enough for my tests. For example i can't trade gold/wood if there is not at least 2 players (myself included). It's annoying to ask someone else...
  5. T

    Abilities Events

    I've made this because SpellStruct is truly overkilled for my needs and anyway as SpellEvent don't do all the stuff i want. Here these lack of features : - In SpellStruct when the ENDCAST event fire you have to figure yourself it the spell was successfully casted or interrupted before the...
  6. T

    Virtually decrease PC performances ?

    Hi. I have a quite good pc, totally overskilled for warcraft 3, which make me hard to test if something can be improved when i make a custom map. Without change any thing in my pc, can i decrease temporally these performances in a some stable and accurate way ?
  7. T

    Snippet IsIssuedOrderInterrupting

    I have the need to know if an issued order can interrupt the current order of an unit or not (like for example "defend" order doesn't interrupt current orders), i've found this solution. Maybe it's not obvious for all, so i post this snippet. But you should simply inline GetIssuedOrderId() ==...
  8. T

    On an unit creation, unit life == full ?

    I'm wondering if only structures which are building enter the map with not full hp. I think so, but maybe i miss a case ? For starters : And no even preplaced unit enter the map with full hp, their life is modified later internally in the map script
  9. T

    GroupEnumInRect + 'Aloc' units

    library TestEnum initializer onInit private function filter takes nothing returns boolean // you can write what you want, this text won't be showed anyway call BJDebugMsg("Me > Chuck Norris") return false endfunction private function onInit takes nothing returns nothing call...
  10. T

    Construction events

    I'm working for a library which provide custom construction events. Why ? Because we don't have a native GetBuilder(), and the way how a structure is build only depends the race of the builder, so therefore if i want GetBuilder() working for all races i need custom events, and a custom...
  11. T

    Could you test it on plz ?

    I want to know how fast/slow is gamecache sync. library SyncDatas initializer onInit globals private trigger array Trig private gamecache array GC private timer array Tim private force Players private integer I endglobals private function Actions takes nothing returns...
  12. T

    Template IsWar3Minimized

    It's a script for the lul'z. By war3 minimized i mean when you reduce it to use an other software, i'm not talking about the window mode. It won't work on single player mode because war3 is paused when you minimize it, but war3 won't be paused when you play on local area network...
  13. T

    Build the list of all orderids with constant integers

    I usually use orderids instead of strings because : - if you do a typo it won't compile and show you the error instead of compile and don't work in game with an invalid string. - sometimes there is not the string equivalent and constant integers make them fully friendly usable - they are faster...
  14. T

    Where can I find a complete list of orderid ?

    I usually use orderids instead of strings because : - sometimes there is not the string equivalent and constant integers make them fully usable - they are faster (even if dunno how many and i think it should be irrelevant) - "easier" to store/link with - if you do a typo it won't compile and...
  15. T

    best way to know if an unitid is valid or not ?

    Because of this bug it isn't so easy. library IsUnitIdValid globals private unit U endglobals function IsUnitIdValid takes integer i returns boolean if IsGameLoaded() then // ofc i plan to store the result, to avoid the creation of the unit all the time, when it was already checked...
  16. T

    Snippet IsGameLoaded

    If i could post on graveyard i would post in it directly, i just want to show a bug. Anyway even if there wasn't this bug this function would be totally useless. function IsGameLoaded takes nothing returns boolean return UnitId2String('hfoo')==null endfunction Note that is the...
  17. T

    Snippet SetUnitSelection

    library SetUnitSelection initializer init // save your map, leave it, reopen it and then comment the line below //! external ObjectMerger w3a AOre Ires anam "Dummy Instant Ressurect Ability" achd 0 Ore1 1 0 aeat "" aher 0 aeff 1 "" function SetUnitSelection takes unit u , boolean...
  18. T

    Snippet SetTrade

    library SetTrade initializer init uses DRES globals public constant integer ALL = 3 public constant integer GIVE = 4 public constant integer RECEIVE = 5 endglobals globals private integer ResourceType private integer TradeType private boolean Enable...
  19. T

    System Detect Resource Exchange

    Here is a simple and short system : //============================================================================== // DRES -> DETECT RESOURCE EXCHANGE SYSTEM -- v 2.1 // by Troll-Brain //============================================================================== // //...
  20. T

    Snippet ConstructionStatus

    Requires vJass and GroupUtils. This is just a simple library to know if an unit is being built, upgraded or finished, it will return false if the unit is dead. library ConstructionStatus initializer init uses GroupUtils globals private constant real TIME_OUT = 30.0 // It is the...