Error

Tar-Quaeron

New Member
Reaction score
0
Could somebody please tell me what is wrong with this? It's obviously not finished. ^^ But what's wrong with what there is? Many thx.

JASS:
function ToxicGasBuff takes nothing returns nothing
    call UnitAddAbility(GetTriggerUnit(), 'A02N')
endfunction

function InitTrig_ToxicGas_Buff takes nothing returns nothing
    set udg_Trg_ToxicGasBuff = CreateTrigger()
    call TriggerAddAction(udg_Trg_ToxicGasBuff, function ToxicGasBuff)    
endfunction

function TrigCond_AddEvent_Trig_ToxicGasBuff takes nothing returns boolean
    return(GetUnitTypeId(GetConstructedStructure()) == 'o00Z')
endfunction

function AddEvent_Trig_ToxicGasBuff takes nothing returns nothing
    call TriggerRegisterUnitInRangeSimple(udg_Trg_ToxicGasBuff, 220.00, GetConstructedStructure())
endfunction

function InitTrig_AddEvent_Trig_ToxicGasBuff takes nothing returns nothing
    set udg_Trg_AddEvent_Trig_ToxicGasBuff = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(udg_Trg_AddEvent_Trig_ToxicGasBuff, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH)
    call TriggerAddCondition(udg_Trg_AddEvent_Trig_ToxicGasBuff, function TrigCond_AddEvent_Trig_ToxicGasBuff)
    //-----
    //This is the line that is declared as causing an error (wrong argument type, unknown type)
    //----- 
   call TriggerAddAction(udg_Trg_AddEvent_Trig_ToxicGasBuff, function AddEvent_Trig_ToxicGasBuff)
endfunction

//===========================================================================
function InitTrig_ToxicGasEffect takes nothing returns nothing
    set gg_trg_Toxic_Gas = CreateTrigger()
endfunction
 

Rushhour

New Member
Reaction score
46
JASS:

function ToxicGasBuff takes nothing returns nothing
    call UnitAddAbility(GetTriggerUnit(), 'A02N')
endfunction

function InitTrig_ToxicGas_Buff takes nothing returns nothing
    set udg_Trg_ToxicGasBuff = CreateTrigger()
    call TriggerAddAction(udg_Trg_ToxicGasBuff, function ToxicGasBuff)    
endfunction

function TrigCond_AddEvent_Trig_ToxicGasBuff takes nothing returns boolean
    return(GetUnitTypeId(GetConstructedStructure()) == 'o00Z')
endfunction

function AddEvent_Trig_ToxicGasBuff takes nothing returns nothing
    call TriggerRegisterUnitInRangeSimple(udg_Trg_ToxicGasBuff, 220.00, GetConstructedStructure())
endfunction

function InitTrig_AddEvent_Trig_ToxicGasBuff takes nothing returns nothing
    set udg_Trg_AddEvent_Trig_ToxicGasBuff = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(udg_Trg_AddEvent_Trig_ToxicGasBuff, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH)
    call TriggerAddCondition(udg_Trg_AddEvent_Trig_ToxicGasBuff, Condition(function TrigCond_AddEvent_Trig_ToxicGasBuff)) 
//you forget to add "condition" above this line here
   call TriggerAddAction(udg_Trg_AddEvent_Trig_ToxicGasBuff, function AddEvent_Trig_ToxicGasBuff)
endfunction

//===========================================================================
function InitTrig_ToxicGasEffect takes nothing returns nothing
    set gg_trg_Toxic_Gas = CreateTrigger()
endfunction

But you should really overthink your variable and function naming. At least I had great difficulties reading that.. :D
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
Vanilla jass ownz.

*Sigh*
Using cJass, vJass or Zinc would get compiled to 'Vanilla' jass one way or the other.
But you save heaps and heaps of time using any of the 3 that aren't vanilla jass.

Seriously, are you thinking clearly at the moment or is your mind filled with booze?
 

tooltiperror

Super Moderator
Reaction score
231
Vanilla JASS is fine for coding (DotA, anyone?)

And he may also be on a Mac, which explains why he wouldn't want to use it, after all, no one (I'm working on it...) has hacked WE for Macs and imported their own .DLL's into it to add a save-corrupt-code function, and no one has made JassHelper run on save yet, so coding in vJASS would be a pain in the arse.
 

Tar-Quaeron

New Member
Reaction score
0
Marvelous it works. ^^ Thx.

Haha, thx for the suggestions. The reason I don't use any of those "cracked" (are they all "cracked"?) is that I don't know about them/understand what they do. Scopes, Libraries, what else is there, structs? is all gibberish to me. Even the names of the add ons I don't know. vJass, cJass NewGen, vanilla Jass ??? I have no idea what exactly the difference between each one is and what they do. And then there is all these syntax checkers, other add ons, which I'm sure are very useful, but about which I haven't found a tutorial yet. I tried installing p-Jass because well, the default syntax checker in the WE sucks, but when I ran the p-Jass.exe file, all I got was an empty command line (the black thing in windows). Anyway, for what I'm doing the standard editor is enough, and it seems I can get by, or not (proof: this post XD) with the jass API browser and the standard WE.

By the way, don't boolean expr leak, and therefore you have to use filter functions? What does a filter function do? What's the difference with a bool expr? Why do filter functions not leak? (I'm getting this from the tutorial "how to create a passive ability in JASS.)

About the naming, well I thought it was pretty clear. You have the addevent_buff, which detects when you build a new building with the right ability (there's is only one building with the toxic gas ability), there's the toxicgas buff which adds the buff by adding an ability, and then there will be the periodic function which does the dps for the toxic gas (I didn't want to use immolation for all of this because two immolation abilities don't stack, and I'll have a demon hunter being able to use immolation himself).
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
By the way, don't boolean expr leak, and therefore you have to use filter functions? What does a filter function do? What's the difference with a bool expr? Why do filter functions not leak? (I'm getting this from the tutorial "how to create a passive ability in JASS.)

Boolean expressions take up memory, yes, but after they are made they are just reused rather than created over and over. Filter functions do the same, as they extend boolexpr anyway, so they do the same as conditions.

Basically, it takes up memory but you don't need to worry about it. It is up to you whether you want to use [ljass]Filter()[/ljass] or [ljass]Condition()[/ljass] for all your boolexpr needs.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top