Fatal errors, and other unexplained stuff

kallieblakie

New Member
Reaction score
5
EDIT:
Fatal Error script.

What's wrong with this script? anyone can help?

JASS:
function Trig_Arrow_Elunes_Arrow_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'AOsh' ) ) then
        return false
    endif
    return true
endfunction

function Arrow_Move takes nothing returns nothing
    local timer Loop = GetExpiredTimer()
    local unit arrow = H2U(GetHandleHandle(Loop, "arrow"))
    local real Angle = GetHandleReal(Loop, "Angle")
    local integer Range = GetHandleInt(Loop, "Range")
    local real Speed = GetHandleReal(Loop, "Speed")
    local integer PlayerNo = GetHandleInt(Loop, "PlayerNo")
    local real distanceCurrent = GetHandleReal(Loop, "distanceCurrent")
    local location C = GetUnitLoc(arrow)
    local location Next
    local real x 
    local real y
    if  (R2I(distanceCurrent) <= Range) then
       set distanceCurrent = distanceCurrent + Speed
       call SetHandleReal (Loop, "distanceCurrent", distanceCurrent)
       set x = GetLocationX(C) + Speed*Cos(Angle*bj_DEGTORAD)
       set y = GetLocationY(C) + Speed*Sin(Angle*bj_DEGTORAD)
       call RemoveLocation(C)
       set Next = Location(x,y) 
       call SetUnitPositionLoc( arrow, Next )
       call RemoveLocation(Next)
       set arrow = null
    elseif (R2I(distanceCurrent) > Range) then
       call KillUnit(arrow)
       call PauseTimer(Loop) 
       call RemoveLocation(Next)
       call RemoveLocation(C)
       set arrow = null        
       call FlushHandleLocals(Loop)
       call DestroyTimer(Loop) 
        call DisplayTextToForce( GetPlayersAll(), "OVER" )
    endif
    set x = 0.00
    set y = 0.00
endfunction

function Trig_Arrow_Elunes_Arrow_Actions takes nothing returns nothing
    local timer Loop = CreateTimer()
    local unit caster = GetSpellAbilityUnit()    
    local location casterPosition = GetUnitLoc(caster)
    local location targetPosition = GetSpellTargetLoc()    
   
    local integer PlayerNo = GetConvertedPlayerId(GetOwningPlayer(GetSpellAbilityUnit()))
    local integer radius = udg_Radius[PlayerNo]

    local real Angle = AngleBetweenPoints(casterPosition, targetPosition)
    local real x = GetLocationX(casterPosition) + 88*Cos(Angle*bj_DEGTORAD)
    local real y = GetLocationY(casterPosition) + 88*Sin(Angle*bj_DEGTORAD)    
    local real Scale = ( 100.00 * ( I2R(radius) / 80.00 ) )   
    local location shootPosition = Location(x,y) 


    local unit arrow = null

    local integer Range = udg_Range[PlayerNo]
    local real Speed = udg_Speed[PlayerNo]


    call CreateNUnitsAtLoc( 1, 'hpea', ConvertedPlayer(PlayerNo), shootPosition, Angle)
    set arrow = GetLastCreatedUnit()
    call SetUnitScalePercent( arrow, Scale, Scale, Scale )
    call SetUnitPathing( arrow, false )
    call RemoveLocation(shootPosition)
    call RemoveLocation(casterPosition)
    call RemoveLocation(targetPosition)    
    set x = 0.00
    set y = 0.00
   call SetHandleHandle(Loop, "arrow", arrow) //***********88
   call SetHandleReal(Loop, "Angle", Angle)  //***********88
   call SetHandleInt(Loop, "Range", Range)  //***********88
   call SetHandleReal(Loop, "Speed", Speed)  //***********88
   call SetHandleInt(Loop, "PlayerNo", PlayerNo) //*********88
    call TimerStart(Loop, 0.03, true, function Arrow_Move)
endfunction

function InitTrig_Arrow_Elunes_Arrow takes nothing returns nothing
    set gg_trg_Arrow_Elunes_Arrow = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Arrow_Elunes_Arrow, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Arrow_Elunes_Arrow, Condition( function Trig_Arrow_Elunes_Arrow_Conditions ) )
    call TriggerAddAction( gg_trg_Arrow_Elunes_Arrow, function Trig_Arrow_Elunes_Arrow_Actions )
endfunction
 
Reaction score
456
Show the code, as that part works as it should. And use Jass Help forum for jass questions.
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
call RemoveUnit(and lets say the jazz code for example last created)
Edit: like
GetLastCreatedUnit = last created unit
GetTriggerUnit = triggering unit
GetSpellAbilityUnit = casting unit
GetSpellTargetUnit = taget unit of ability bien cast
GetAttackedUnitBJ = attacked unit
GetAttacker = attacking unit

for example: call RemoveUnit(GetTriggerUnit())

if you want a specific unit like a pig on the map, make a varrible:
Code:
Set unit_varrible = Footman 0001 <gen>

and then call RemoveUnit(udg_unit_varrible)
 

kallieblakie

New Member
Reaction score
5
Doesn't move on to the "else" section

Hi i'm trying to create potm's arrow, and this is part of the script.


JASS:
    if  (R2I(distanceCurrent) &lt;= Range) then
       set distanceCurrent = distanceCurrent + Speed
       call SetHandleReal (Loop, &quot;distanceCurrent&quot;, distanceCurrent)
       set x = GetLocationX(C) + Speed*Cos(Angle*bj_DEGTORAD)
       set y = GetLocationY(C) + Speed*Sin(Angle*bj_DEGTORAD)
       call RemoveLocation(C)
       set Next = Location(x,y) 
       call SetUnitPositionLoc( arrow, Next )
       call RemoveLocation(Next)
       set arrow = null
    else
       call PauseTimer(Loop) 
       call RemoveLocation(Next)
       call RemoveLocation(C)
       call KillUnit(arrow)
       set arrow = null        
       call FlushHandleLocals(Loop)
       call DestroyTimer(Loop) 
        call DisplayTextToForce( GetPlayersAll(), &quot;OVER&quot; )
    endif


The problem is, it doesn't run the "else" script, even though the conditions for the "if" is not valid. How do i make it run the "else" script?
 

Seannny

Why GUI when you can Jass?
Reaction score
46
have you set pig to anything?
are you sure you set it to a unit?
Caps are important, Is it capitalized properly?

Post the code please.
 

Silvenon

New Member
Reaction score
19
It does, it has to, there's no question about it. For some reason your if was always true when you were testing it.
 

kallieblakie

New Member
Reaction score
5
it runs the script if it falls within the "if" category, but doesn't run at all when it doesn't.

I've tried it, and the arrow moves within the "if" category, and stops there, doesn't get removed, neither does the message display. what's wrong?
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
Try this:
JASS:
    if  (R2I(distanceCurrent) &lt;= Range) then
       set distanceCurrent = distanceCurrent + Speed
       call SetHandleReal (Loop, &quot;distanceCurrent&quot;, distanceCurrent)
       set x = GetLocationX(C) + Speed*Cos(Angle*bj_DEGTORAD)
       set y = GetLocationY(C) + Speed*Sin(Angle*bj_DEGTORAD)
       call RemoveLocation(C)
       set Next = Location(x,y) 
       call SetUnitPositionLoc( arrow, Next )
       call RemoveLocation(Next)
       set arrow = null
    elseif (R2I(distanceCurrent) &gt; Range) then
       call PauseTimer(Loop) 
       call RemoveLocation(Next)
       call RemoveLocation(C)
       call KillUnit(arrow)
       set arrow = null        
       call FlushHandleLocals(Loop)
       call DestroyTimer(Loop) 
        call DisplayTextToForce( GetPlayersAll(), &quot;OVER&quot; )
    endif
 

kallieblakie

New Member
Reaction score
5
that worked. thanks !


by the way,

why does This script cause


"FATAL ERROR!
Exception 0xC0000000005 (ACCESS_VIOLATION) at 001B:6F30CE3F

The instruction at ~~~~~~~blah blah blah."
 

kallieblakie

New Member
Reaction score
5
Fatal Error. MAYBE DUE TO LEAKS

I've been getting this fatal error problem, and i'm positive it's from this trigger.


JASS:
function Trig_Arrow_Elunes_Arrow_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == &#039;AOsh&#039; ) ) then
        return false
    endif
    return true
endfunction

function Arrow_Move takes nothing returns nothing
    local timer Loop = GetExpiredTimer()
    local unit arrow = H2U(GetHandleHandle(Loop, &quot;arrow&quot;))
    local real Angle = GetHandleReal(Loop, &quot;Angle&quot;)
    local integer Range = GetHandleInt(Loop, &quot;Range&quot;)
    local real Speed = GetHandleReal(Loop, &quot;Speed&quot;)
    local integer PlayerNo = GetHandleInt(Loop, &quot;PlayerNo&quot;)
    local real distanceCurrent = GetHandleReal(Loop, &quot;distanceCurrent&quot;)
    local location C = GetUnitLoc(arrow)
    local location Next
    local real x 
    local real y
    if  (R2I(distanceCurrent) &lt;= Range) then
       set distanceCurrent = distanceCurrent + Speed
       call SetHandleReal (Loop, &quot;distanceCurrent&quot;, distanceCurrent)
       set x = GetLocationX(C) + Speed*Cos(Angle*bj_DEGTORAD)
       set y = GetLocationY(C) + Speed*Sin(Angle*bj_DEGTORAD)
       call RemoveLocation(C)
       set Next = Location(x,y) 
       call SetUnitPositionLoc( arrow, Next )
       call RemoveLocation(Next)
       set arrow = null
    elseif (R2I(distanceCurrent) &gt; Range) then
       call KillUnit(arrow)
       call PauseTimer(Loop) 
       call RemoveLocation(Next)
       call RemoveLocation(C)
       set arrow = null        
       call FlushHandleLocals(Loop)
       call DestroyTimer(Loop) 
        call DisplayTextToForce( GetPlayersAll(), &quot;OVER&quot; )
    endif
    set x = 0.00
    set y = 0.00
endfunction

function Trig_Arrow_Elunes_Arrow_Actions takes nothing returns nothing
    local timer Loop = CreateTimer()
    local unit caster = GetSpellAbilityUnit()    
    local location casterPosition = GetUnitLoc(caster)
    local location targetPosition = GetSpellTargetLoc()    
   
    local integer PlayerNo = GetConvertedPlayerId(GetOwningPlayer(GetSpellAbilityUnit()))
    local integer radius = udg_Radius[PlayerNo]

    local real Angle = AngleBetweenPoints(casterPosition, targetPosition)
    local real x = GetLocationX(casterPosition) + 88*Cos(Angle*bj_DEGTORAD)
    local real y = GetLocationY(casterPosition) + 88*Sin(Angle*bj_DEGTORAD)    
    local real Scale = ( 100.00 * ( I2R(radius) / 80.00 ) )   
    local location shootPosition = Location(x,y) 


    local unit arrow = null

    local integer Range = udg_Range[PlayerNo]
    local real Speed = udg_Speed[PlayerNo]


    call CreateNUnitsAtLoc( 1, &#039;hpea&#039;, ConvertedPlayer(PlayerNo), shootPosition, Angle)
    set arrow = GetLastCreatedUnit()
    call SetUnitScalePercent( arrow, Scale, Scale, Scale )
    call SetUnitPathing( arrow, false )
    call RemoveLocation(shootPosition)
    call RemoveLocation(casterPosition)
    call RemoveLocation(targetPosition)    
    set x = 0.00
    set y = 0.00
   call SetHandleHandle(Loop, &quot;arrow&quot;, arrow) //***********88
   call SetHandleReal(Loop, &quot;Angle&quot;, Angle)  //***********88
   call SetHandleInt(Loop, &quot;Range&quot;, Range)  //***********88
   call SetHandleReal(Loop, &quot;Speed&quot;, Speed)  //***********88
   call SetHandleInt(Loop, &quot;PlayerNo&quot;, PlayerNo) //*********88
    call TimerStart(Loop, 0.03, true, function Arrow_Move)
endfunction

function InitTrig_Arrow_Elunes_Arrow takes nothing returns nothing
    set gg_trg_Arrow_Elunes_Arrow = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Arrow_Elunes_Arrow, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Arrow_Elunes_Arrow, Condition( function Trig_Arrow_Elunes_Arrow_Conditions ) )
    call TriggerAddAction( gg_trg_Arrow_Elunes_Arrow, function Trig_Arrow_Elunes_Arrow_Actions )
endfunction





I'm new to JASS so I don't know if there's any leaks. Anyone Please help !
 

Cohadar

master of fugue
Reaction score
209
EDIT: shit, wrong thread.
The most strangest thing happened, I posted in one thread, and that thread instantly dissapeared !!
and my post ended up here???

EDIT2:
Well since I am here lemme try to help:
Locust units cannot be picked by "pick every unit in an area" trigger.
Are you doing that?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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