Fatal from order, and unable to set point

Mikazuki

New Member
Reaction score
0
1.
I've got a trigger that forces a unit to stop whenever it's given any order and it has a specific buff on it. For whatever reason though, it crashes WC3 when you just right click. Here's the code;
JASS:
function Trig_SPfrozen_Conditions takes nothing returns boolean
    return((GetIssuedOrderId()!=852090)and(GetIssuedOrderId()!=852091)and(GetIssuedOrderId()!=852529)) //except magic shell and counterspell
endfunction

function Trig_SPfrozen_Actions takes nothing returns nothing
    if ((GetUnitAbilityLevel(GetTriggerUnit(),'B006') > 0)or(GetUnitAbilityLevel(GetTriggerUnit(),'B007') > 0)) then
        call IssueImmediateOrder(GetTriggerUnit(),"stop") //stop
    endif
endfunction

function InitTrig_SPfrozen takes nothing returns nothing
    set gg_trg_SPfrozen = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_SPfrozen, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_SPfrozen, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_SPfrozen, EVENT_PLAYER_UNIT_ISSUED_ORDER )
    call TriggerAddCondition( gg_trg_SPfrozen, Condition( function Trig_SPfrozen_Conditions ) )
    call TriggerAddAction( gg_trg_SPfrozen, function Trig_SPfrozen_Actions )
endfunction



2.
The trigger below sets four points to random points on the map, unless the random points picked are in any of four specific regions. The coordinates are being randomised properly, but the global array variable () for those four points aren't being set to the randomised coordinates.
JASS:
function Trig_UNITSPAWNffarandoms_Actions takes nothing returns nothing
    local integer i = 1
    local real x
    local real y
    local boolean b = false
    loop
    exitwhen i == 4
        loop
        exitwhen b == true
            set x = GetRandomReal(-2650.,2650.)
            set y = GetRandomReal(-3050.,2600.)
            if ((RectContainsCoords(gg_rct_Region_000,x,y)==false)and(RectContainsCoords(gg_rct_Region_001,x,y)==false)and(RectContainsCoords(gg_rct_Region_002,x,y)==false)and(RectContainsCoords(gg_rct_Region_003,x,y)==false)) then
                set b = true
            endif
        endloop
        set udg_GAMEINIT_spawnpoint<i> = Location(x,y)
        set i = i+1
    endloop
endfunction

function InitTrig_UNITSPAWNffarandoms takes nothing returns nothing
    set gg_trg_UNITSPAWNffarandoms = CreateTrigger(  )
    call DisableTrigger( gg_trg_UNITSPAWNffarandoms )
    call TriggerRegisterTimerEventPeriodic( gg_trg_UNITSPAWNffarandoms, 0.50 )
    call TriggerAddAction( gg_trg_UNITSPAWNffarandoms, function Trig_UNITSPAWNffarandoms_Actions )
endfunction</i>

(yes, this trigger does get enabled)



I've done quite a bit of experimenting, and I really can't find the problem in my code. Could anyone shed some light on this?
Thanks in advance.
 

Embrace_It

New Member
Reaction score
9
1.

First, try making spaces between your "and"'s and "or"'s.

I dont have WC3 in front of me right now, but you should try to locate the problem first. Try commenting the conditions out and see if it works, then try the actions (maybe only try to remove the buff check).

2.

I'm assuming the global variable is created somewhere else. For starters, the first element of an array is 0, not 1, therefore the last element of an array MyArray[4] (which has 4 elements) is 3. Right now, you are skipping the first element, by starting on 1.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Infinity loop!
Add the GetCurrentOrder != String2OrderId("stop")(I don't know the order id of "stop") in condition.
 
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

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top