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
  • The Helper The Helper:
    I just got to watch the video because even though I was there I was trying to work out tech problems with the chat since I was the social media guy so I was distracted but check it out guys the video is super fucking great!
    +1
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top