• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!
xAerox
Reaction score
7

Profile posts Latest activity Postings Experience Albums Resources About

  • I don't want to put this in the require since this does not require Table.
    It is better to use it that's all.
    You can freely declare mutliple triggers ofc.
    Don't use triggeraction ;)

    I'll see for the fear zzz

    Library requires Library2 will not compile if there is not the Library2 :)
    Library code is put all above the rest of the code so you can safely use the funcs inside it anywhere else ;)

    Don't automatically use struct extends array if you don't like it :)
    hy there ^^
    thx for the greetings before,

    sry for alte reply, im being inactive here for a while hehe
    oh, my God!! it's exactly the same as mine D:D:D:D:D:
    have you tried to run wc3 as administator? or try changing your player name, you know what I mean..
    can you tell me your wc3 version? it's at bottom right of the main screen..
    I have update the flappy bird again :)
    I found some mistakes on preloads, hope the problem has gone ;)
    Readonly can be whatever you want inside but only readable outside.

    struct a
    endstruct
    ->
    //JASSHelper struct globals:
    constant integer si__a=1
    integer si__a_F=0
    integer si__a_I=0
    integer array si__a_V


    //Generated allocator of a
    function s__a__allocate takes nothing returns integer
    local integer this=si__a_F
    if (this!=0) then
    set si__a_F=si__a_V[this]
    else
    set si__a_I=si__a_I+1
    set this=si__a_I
    endif
    if (this>8190) then
    call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,1000.,"Unable to allocate id for an object of type: a")
    return 0
    endif

    set si__a_V[this]=-1
    return this
    endfunction

    //Generated destructor of a
    function s__a_deallocate takes integer this returns nothing
    if this==null then
    call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,1000.,"Attempt to destroy a null struct of type: a")
    return
    elseif (si__a_V[this]!=-1) then
    call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,1000.,"Double free of type: a")
    return
    endif
    set si__a_V[this]=si__a_F
    set si__a_F=this
    endfunction


    struct a extends array
    endstruct
    ->
    //JASSHelper struct globals:
    constant integer si__a=1


    So extends array mean that you have to do everything.
    Struct extends array doesn't generate allocate/deallocate and vars to do so.

    Readonly is member that are only readable outside the struct.
    It's pretty hard.
    Even me I got very hard times with those ^^'
    Because we can only create rects :/

    There is a trick : Create three invisible missiles that goes with different angles and they will damage the units :p
    Yep it will only affect Player(0) in your case.
    But beware that might cause desync... For example putting a special effect for only one player can cause crash.
    SO just use some cameras thingies or so ^^


    What are you talking about leak ?
    I made a GetLocalPlayer() == GetOwningPlayer(targeted_unit)

    Now make GetLocalPlayer() == DesiredPlayer :D
    No problem at all.
    SO bad that you are the only one on SourceForge for the moment since I really need this :(
    WOOW TQ, I will test it
    Sorry for long time not Online, because I got on Vacation that time ;) ;)
    Excuse me I made a mistake yesterday :
    scope BLSpell
    native UnitAlive takes unit id returns boolean

    globals
    private constant integer SPELL_ID = 'A000'
    endglobals

    private constant function Damage takes integer lvl returns real
    return 0.
    endfunction

    private constant function Aoe takes integer lvl returns real
    return 1000.
    endfunction

    private function UnitFilter takes unit targ, player source returns boolean
    return UnitAlive(targ) and IsUnitEnemy(targ, source) and not IsUnitType(targ, UNIT_TYPE_MAGIC_IMMUNE) and not IsUnitType(targ, UNIT_TYPE_STRUCTURE)
    endfunction

    private struct BL extends array
    static group g

    static method c takes nothing returns boolean
    local unit u
    local integer i
    local unit v
    local player p
    local real x
    local real y
    local real r
    if GetSpellAbilityId() == SPELL_ID then
    set u = GetTriggerUnit()
    set i = GetUnitAbilityLevel(u, SPELL_ID)
    set p = GetOwningPlayer(u)
    set x = GetUnitX(u)
    set y = GetUnitY(u)
    call GroupEnumUnitsInRange(g, GetSpellTargetX(), GetSpellTargetY(), Aoe(i), null)
    loop
    set v = FirstOfGroup(g)
    exitwhen v==null
    call GroupRemoveUnit(g, v)
    set r = RAbsBJ(Atan2(GetUnitY(v)-y, GetUnitX(v)-x)*bj_RADTODEG - GetUnitFacing(v))
    if UnitFilter(v,p) and r<=225. and r>=135 then
    if GetLocalPlayer() == GetOwningPlayer(v) then
    call CinematicFilterGenericBJ( 3.00, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 100, 100, 100, 100, 0, 0, 0, 0 )
    endif
    endif
    endloop
    set u = null
    set p = null
    endif
    return false
    endmethod

    static method onInit takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t, Condition(function thistype.c))
    set g = CreateGroup()
    set t = null
    endmethod
    endstruct
    endscope
    scope BLSpell
    native UnitAlive takes unit id returns boolean

    globals
    private constant integer SPELL_ID = 'A000'
    endglobals

    private constant function Damage takes integer lvl returns real
    return 0.
    endfunction

    private constant function Aoe takes integer lvl returns real
    return 1000.
    endfunction

    private function UnitFilter takes unit targ, player source returns boolean
    return UnitAlive(targ) and IsUnitEnemy(targ, source) and not IsUnitType(targ, UNIT_TYPE_MAGIC_IMMUNE) and not IsUnitType(targ, UNIT_TYPE_STRUCTURE)
    endfunction

    private struct BL extends array
    static group g

    static method c takes nothing returns boolean
    local unit u
    local integer i
    local unit v
    local player p
    local real x
    local real y
    if GetSpellAbilityId() == SPELL_ID then
    set u = GetTriggerUnit()
    set i = GetUnitAbilityLevel(u, SPELL_ID)
    set p = GetOwningPlayer(u)
    set x = GetUnitX(u)
    set y = GetUnitY(u)
    call GroupEnumUnitsInRange(g, GetSpellTargetX(), GetSpellTargetY(), Aoe(i), null)
    loop
    set v = FirstOfGroup(g)
    exitwhen v==null
    call GroupRemoveUnit(g, v)
    if UnitFilter(v,p) and RAbsBJ(Atan2(GetUnitY(v)-y, GetUnitX(v)-x)*bj_RADTODEG - GetUnitFacing(v))<180. then
    if GetLocalPlayer() == GetOwningPlayer(v) then
    call CinematicFilterGenericBJ( 3.00, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 100, 100, 100, 100, 0, 0, 0, 0 )
    endif
    endif
    endloop
    set u = null
    set p = null
    endif
    return false
    endmethod

    static method onInit takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t, Condition(function thistype.c))
    set g = CreateGroup()
    set t = null
    endmethod
    endstruct
    endscope
    For blinding light spell.
    I give you the code and not a map because I can't test it alone xD
    Not really to save space but you can use static_if like this :
    static if LIBRARY_Table then
    ...
    endif

    //Or like this
    statif if nameOfFunc.exists then
    ...
    endif
    It is not better..
    It is a choice.
    globals
    private constant boolean WANT_SPECIAL_FEATURE = false
    endglobals

    static if WANT_SPECIAL_FEATURE then
    //The code of the feature
    endif
    If the user set the constant to true it will COMPILE the special feature and if it set to false it will not compile so the code won't be in the map ;)
    Static if can only takes boolean expression and if the condition is false then the code between the if statement will not compile
    Oh no problem.
    But there were a bug there ^^

    OH NO IT IS FROM FEAR SYSTEM WHAT YOU LINKED SORRY EPIC FAIL XD
    Test this LL_Alloc :
    library LLAlloc
    //! textmacro LL_Alloc takes status
    private thistype p
    private thistype n
    debug private boolean b
    private static integer c = 0

    $status$ static method allocate takes nothing returns thistype
    local thistype this
    if thistype(0).p == 0 then
    set c = c + 1
    set this = c
    else
    set this = thistype(0).p
    set thistype(0).p = thistype(0).p.p
    endif
    debug set this.b = false
    return this
    endmethod

    $status$ method chain takes nothing returns nothing
    debug if not this.b then
    if thistype(0).n != 0 then
    set thistype(0).n.p = this
    endif
    set this.n = thistype(0).n
    set thistype(0).n = this
    set this.p = thistype(0).p
    debug set this.b = true
    debug else
    debug call BJDebugMsg("You're chaining an already chained instance !")
    debug endif
    endmethod

    $status$ method unchain takes nothing returns nothing
    debug if this.b then
    if this.n != 0 then
    set this.p.n = this.n
    endif
    set this.n.p = this.p
    debug set this.b = false
    debug else
    debug call BJDebugMsg("You're unchaining an already unchained instance !")
    debug endif
    endmethod

    $status$ method deallocate takes nothing returns nothing
    set this.p = thistype(0).p
    set thistype(0).p = this
    endmethod

    $status$ method empty takes nothing returns boolean
    return thistype(0).next == 0
    endmethod
    //! endtextmacro
    endlibrary
    Oh ok.

    Debug is a special vJASS keyword that makes the code line compile only if the debug mode is activated :)
    CreatorD..... wanted gui (dunno if you did it in Gui can't dl now) so tell me if you did it in gui or so
    The piece of code you pasted is my linked list xD ?
    If yes there is a known bug ....
    I'll have to fix it sorry ^^

    I don't know really for formulas it depends on your number and ect...
    Aah for what you told me in PM you could post it in VM it is easier for me to answer ;)
    Do you mind to give the link of the post :) ?
    If you use my missile thingy I gave you it has a member called steps :)
    And when steps == 0 then it is finished for this one :)
    No do as if you were casting the spells trice.
    Make a method periodic three times that will cast the three missiles.

    Then in a periodic method loop through all your missiles :)
  • Loading…
  • Loading…
  • Loading…
  • Loading…
  • Loading…
  • Loading…
Top