Help in Ability

MaaxeEvid

New Member
Reaction score
8
Well, im trying to make a ability, only for testing my knowledge in handles, the following ability its a Storm Bolt, wich poisons the target.

but when i try to run my map, it justs close the WE,:( dont give any errors, just close and shows a message , worldeditor.exe need to be closed blablabla, + REP for the helps wich resolve my prob !:cool:

JASS:
function Trig_Storm_Bolt_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A000'
endfunction

function Storm_Poison takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local integer i = GetHandleInt(t, "level")
    local unit u = GetHandleUnit(t, "caster") 
    local unit target = GetHandleUnit(t, "vitima")
    local real dur = GetHandleReal(t, "dur")
    local real upd = GetHandleReal(t, "upd")
    if upd < dur then
        loop
            set upd = upd + 0.5
            exitwhen upd = dur
            call UnitDamageTarget (u, target, 15*i, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_POISON, null)
        endloop
    else
        call FlushHandleLocals(t)
    endif
    set u = null
    set target = null
    set t = null
    call DestroyTimer(t) 
endfunction   

function Trig_Storm_Bolt_Actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local unit target = GetSpellTargetUnit()
    local real tx = GetUnitX(target)
    local real ty = GetUnitY(target)
    local integer level = GetUnitAbilityLevel(caster, 'A000')
    local timer t = CreateTimer()
    local real duration = 7
    local real update = 0.5
    call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl", tx, ty)
    call SetHandleInt (t, "level", level)
    call SetHandleHandle (t, "caster", caster)
    call SetHandleHandle (t, "vitima", target)
    call SetHandleReal (t, "dur", duration)
    call SetHandleReal (t, "upd", update)
    call TimerStart(t, update, true, function Storm_Poison)
    set caster = null
    set target = null
    set t = null
endfunction

//===========================================================================
function InitTrig_Storm_Bolt takes nothing returns nothing
    set gg_trg_Storm_Bolt = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Storm_Bolt, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Storm_Bolt, Condition( function Trig_Storm_Bolt_Conditions ) )
    call TriggerAddAction( gg_trg_Storm_Bolt, function Trig_Storm_Bolt_Actions )
    call Preload ("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl")
endfunction
 

Hero

─║╣ero─
Reaction score
250
The only way it would do that when you press Test Map
Would be if you didn't import KaTTana's Handle System correctly

Did you make a global variable for it?
Did you edit the part of the code that to the name of your game cache?
Are there any repeated functions in your map?
 
1

1337JASSer

Guest
I can't actually find the problem...

There are some possibilities though:

1) Do you have the handle system in your map's header?
2) Are the handle functions you called in the system?
3) Try to change the "vitima" part for the target to "target" instead and see if that works.
4)
JASS:
    native UnitDamageTarget            takes unit whichUnit, widget target, real amount, boolean attack, boolean ranged, attacktype attackType, damagetype damageType, weapontype weaponType returns boolean


You nulled the weapontype part, try to enter an actual weapontype instead such as:


Or something like that.

I am pretty sure that only booleans take nulls, and they take true or false as well. ;)
 

Hero

─║╣ero─
Reaction score
250
OH wait..I think I see some problem

I don't think your suppose to null the variable t which is your timer in the

function Trig_Storm_Bolt_Actions takes nothing returns nothing
 
1

1337JASSer

Guest
Ah... Yes, I see it as well. You need not null your variables that are being transferred because you cannot actually transfer a nulled variable because it would be moved as "nothing" which obviously caused a syntax when tested. Null target and the timer in the second function instead.... Remember that "DestroyTimer(t)" should be before the null otherwise you are destroying nothing and I think it may leave a leak. ;)
 

Hero

─║╣ero─
Reaction score
250
Also before you Destroy a timer make sure you PAUSE it first....it can still run if it de-syncs
 

MaaxeEvid

New Member
Reaction score
8
well, i found the problem, its with the Handle System, i need to change the LocalVars() with 1 udg variable of type Game Cache, but i dont know how to do it correctly, just return udg_GameCache, its correct?
 

SFilip

Gone but not forgotten
Reaction score
634
> correct
Partially.
You need to define that GameCache variable in the variable editor and you need to set it on Map Initialization.
Custom Script: set udg_GameCache = InitGameCache("jasslocalvars.w3v")
 

MaaxeEvid

New Member
Reaction score
8
well for dont create a new thread, i will post my other question here

i have a 90% read trigger, i only have problems, with the Pick Every Unit in 500 of caster , and order it to attack him...look the trigger below

JASS:
function Trig_Provoke_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A02M'
endfunction

function ProvokeId takes nothing returns integer
    return 'A02M'
endfunction

function ProvokeAtk takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local unit c = GetHandleUnit(t, "caster")
    local group g = GetHandleGroup(t, "grupo")
    local real upd = GetHandleReal(t, "dur")+0.5
    if upd < 5 then
        call SetHandleReal(t,"dur", upd)
        ????????????????????????????????????
        else
        call DestroyGroup(g)
        call PauseTimer(t)
        call DestroyTimer(t)
        call FlushHandleLocals(t)
    endif
    set c = null
    set g = null
    set t = null
endfunction

function Provoke_Filter takes nothing returns boolean
    return IsPlayerEnemy(GetOwningPlayer(GetTriggerUnit()), GetOwningPlayer(GetFilterUnit()))      
endfunction

function Trig_Provoke_Actions takes nothing returns nothing
    local unit c = GetTriggerUnit()
    local group g = CreateGroup()
    local timer t = CreateTimer()
    local boolexpr b = Condition(function Provoke_Filter)
    local real tpmB = 0.5
    call GroupEnumUnitsInRange(g, GetUnitX(c),GetUnitY(c), 500, b)
    call SetHandleHandle (t, "caster", c)
    call SetHandleHandle (t, "grupo", g)
    call SetHandleReal (t, "dur", tpmB)
    call TimerStart(t, tpmB, TRUE, function ProvokeAtk )
    call DestroyGroup(g)
    call DestroyBoolExpr(b)
    set b = null
    set c = null
    set g = null
    set t = null
endfunction

//===========================================================================
function InitTrig_Provoke takes nothing returns nothing
    set gg_trg_Provoke = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Provoke, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Provoke, Condition( function Trig_Provoke_Conditions ) )
    call TriggerAddAction( gg_trg_Provoke, function Trig_Provoke_Actions )
endfunction


well, i dunno how can i do this, i created the group "g", add the units to it(dunno if i do correctly) then i wish to the "picked unitss" attack the caster "c"...need help in that function ^^
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
if u wish picked units to attack caster then u need to use ForGroup which makes the loop for group:
if i remember right it's like this:
JASS:
call ForGroup(Group,function) 
//u need to make a function for these actions and in this function u could use picked units

i hope it's clear enough :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      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