Map Crashing

Prometheus

Everything is mutable; nothing is sacred
Reaction score
590
In my footies map, when units are spawned they will goto the main buildings rally point. Great huh? I know.
Thing is, I'm getting a crash. Here's how I got it.
I set the rally point somewhere on the map, not on the main building. I then continue upgrading my units and number of units spawned. Ect. Upgrading building....
After a while, if I set the rally point to the main building again then it goes kaboom. Crash. Close.
Here's the code. Yes, units spawn fine.

JASS:
scope Spawning initializer Init
    globals
    //Arrays for setting each level of each tier.
        private integer array HUMANTIER
        private integer array COVENANTTIER
        private integer array FLOODTIER
        
    //Bases
        private constant integer HUMANBASE = 'hC01'
        private constant integer COVBASE = 'oC02'
        private constant integer FLOODBASE = 'uC03'
        
    //Increase Tier Upgrade ID
        private constant integer TIERUP = 'R002'
    //The number spawned.
        private integer array NUMSPWNED [12]
    //A safety so the units don't run to the middle aimlessly.
        private location array SAFETY
    //Used for SUPOT.
        public integer array UQID [12]
    //The type of spawn.
        private integer array SPWNTYPE [12]
    //The frequency of the spawn.
        private real array SPWNFREQ [12]
    //Increase # Of Units Spawned Upgrade ID
        private constant integer INCSPWN = 'R000'
    //The unit tier level for each player.
        private integer array TIERLEVEL[12]
    //The location the units run to.
        private location array RUNTO [12]
    endglobals
    
    private function StartingC takes nothing returns boolean
        return GetUnitTypeId(GetTriggerUnit()) == HUMANBASE or GetUnitTypeId(GetTriggerUnit()) == COVBASE or GetUnitTypeId(GetTriggerUnit()) == FLOODBASE
    endfunction
    
    private function Starting takes nothing returns nothing
        local integer i = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
        local real x = GetUnitX(GetTriggerUnit())
        local real y = GetUnitY(GetTriggerUnit())
        set NUMSPWNED<i> = 1
        set SPWNFREQ<i> = 5
        set SAFETY<i> = GetUnitRallyPoint(BASE<i>)
        if GetUnitTypeId(GetTriggerUnit()) == HUMANBASE then
            //Start Spawning Humans
            set UQID<i> = SUPOT_Start(GetOwningPlayer(GetTriggerUnit()),HUMANTIER[TIERLEVEL<i>],NUMSPWNED<i>,SPWNFREQ<i>,x,y)
            set SPWNTYPE<i> = 0
        elseif GetUnitTypeId(GetTriggerUnit()) == COVBASE then
            //Start Spawning Covenant
            set UQID<i> = SUPOT_Start(GetOwningPlayer(GetTriggerUnit()),COVENANTTIER[TIERLEVEL<i>],NUMSPWNED<i>,SPWNFREQ<i>,x,y)
            set SPWNTYPE<i> = 1
        else
            //Start Spawning Flood
            set UQID<i> = SUPOT_Start(GetOwningPlayer(GetTriggerUnit()),FLOODTIER[TIERLEVEL<i>],NUMSPWNED<i>,SPWNFREQ<i>,x,y)
            set SPWNTYPE<i> = 2
        endif
    endfunction
    
    private function TierUpC takes nothing returns boolean
        return GetResearched() == TIERUP
    endfunction
    
    private function TierUpA takes nothing returns nothing
    //Increases the tier level for a player.
        local integer i = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
        set TIERLEVEL<i> = TIERLEVEL<i>+1
        if SPWNTYPE<i> == 0 then
            call SUPOT_ChangeUnitID(UQID<i>, HUMANTIER[TIERLEVEL<i>])
        elseif SPWNTYPE<i> == 1 then
            call SUPOT_ChangeUnitID(UQID<i>, COVENANTTIER[TIERLEVEL<i>])
        else
            call SUPOT_ChangeUnitID(UQID<i>, FLOODTIER[TIERLEVEL<i>])
        endif
    endfunction
    
    private function IncSpwnC takes nothing returns boolean
        return GetResearched() == INCSPWN
    endfunction
    
    private function IncSpwnA takes nothing returns nothing
        local integer i = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
        set SPWNFREQ<i> = SPWNFREQ<i>+4
        set NUMSPWNED<i> = NUMSPWNED<i>+1
        call SUPOT_ChangeSpawnTime(UQID<i>,SPWNFREQ<i>)
        call SUPOT_ChangeSpawnAmount(UQID<i>,NUMSPWNED<i>)
    endfunction
    
    private function MoveRally takes nothing returns nothing
        local integer i = 0
        loop
        exitwhen i &gt; 11
            //Rally Point Update
            set RUNTO<i> = GetUnitRallyPoint(BASE<i>)
            set i = i + 1
        endloop
    endfunction
    
    private function MoveUnit takes nothing returns nothing
        local integer i = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
        if RUNTO<i> != SAFETY<i> and IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO) == false then
            //If rally point isn&#039;t at base, then make units attack walk to it.
                call IssuePointOrder(GetTriggerUnit(),&quot;attack&quot;,GetLocationX(RUNTO<i>),GetLocationY(RUNTO<i>))
        endif
    endfunction
    
    private function Init takes nothing returns nothing
        local trigger t = CreateTrigger()
        local timer t2 = CreateTimer()
        local trigger t3 = CreateTrigger()
        local trigger t4 = CreateTrigger()
        local trigger t5 = CreateTrigger()
        local integer i = 0
        
        //What spawns per tier.
    //Humans
        set HUMANTIER[0] = &#039;hfoo&#039;
        set HUMANTIER[1] = &#039;hrif&#039;
        set HUMANTIER[2] = &#039;hkni&#039;
        set HUMANTIER[3] = &#039;hgry&#039;
        set HUMANTIER[4] = &#039;hrtt&#039;
    //Covenant
        set COVENANTTIER[0] = &#039;ogru&#039;
        set COVENANTTIER[1] = &#039;ohun&#039;
        set COVENANTTIER[2] = &#039;orai&#039;
        set COVENANTTIER[3] = &#039;otau&#039;
        set COVENANTTIER[4] = &#039;n00N&#039;
    //Flood
        set FLOODTIER[0] = &#039;ugho&#039;
        set FLOODTIER[1] = &#039;ucry&#039;
        set FLOODTIER[2] = &#039;uabo&#039;
        set FLOODTIER[3] = &#039;ufro&#039;
        set FLOODTIER[4] = &#039;e001&#039;
        
        loop
        exitwhen i &gt; 11
            call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_UPGRADE_FINISH,Condition(function FailSafe))
            call TriggerRegisterPlayerUnitEvent(t4,Player(i),EVENT_PLAYER_UNIT_RESEARCH_FINISH,Condition(function FailSafe))
            call TriggerRegisterPlayerUnitEvent(t5,Player(i),EVENT_PLAYER_UNIT_RESEARCH_FINISH,Condition(function FailSafe))
            call TriggerRegisterEnterRectSimple(t3,bj_mapInitialPlayableArea)
            set TIERLEVEL<i> = 0
            set i = i + 1
        endloop
        //For starting the spawn.
        call TriggerAddCondition(t,Condition(function StartingC))
        call TriggerAddAction(t,function Starting)
        
        //Triggers for increasing the tiers.
        call TriggerAddAction(t4,function TierUpA)
        call TriggerAddCondition(t4,Condition(function TierUpC))
        
        //Triggers for increasing the number of units spawned.
        call TriggerAddAction(t5,function IncSpwnA)
        call TriggerAddCondition(t5,Condition(function IncSpwnC))
        
        //Move unit when spawned.
        call TriggerAddAction(t3,function MoveUnit)
        
        //Rally Point Updating
        call TimerStart(t2,1,true,function MoveRally)
    endfunction
endscope</i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i>


And here's the error.

attachment.php
 

Attachments

  • W3ERR.JPG
    W3ERR.JPG
    18.8 KB · Views: 180

Xorifelse

I'd love to elaborate about discussions...........
Reaction score
87
Remember that day where I was saying in channel you didn't know vJass.
I was partially wrong, you do know it but poorly.

I'll help you out, contact me on MSN and I'll provide you with some code and I'll teach you the best way on making things like this.
Though, of course I can make it for you but having a tutor on this will make you learn the use of it much faster.

Anyways, I was unable to find where the crash is caused.
However I did find a few bugs:
JASS:

    private function AtkMove takes nothing returns nothing
        local integer i = GetPlayerId(GetOwningPlayer(GetEnumUnit()))
        call IssuePointOrder(GetEnumUnit(),&quot;attack&quot;,GetLocationX(RUNTO<i>),GetLocationY(RUNTO<i>))
    endfunction</i></i>


GetEnumUnit() returns null and so the player ID is 0.
In other words, this will only work for Player 1.

I believe, however I'm not 100% sure that the order string should be: "attackmove".
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
590
Actually AtkMove was an old, and now unused, function.
I had simply forgotten to remove it. It is "attack" and I'm on MSN waiting.
 

emjlr3

Change can be a good thing
Reaction score
395
"attackmove" is hardly a function.....looks more like a string to me...

a quick read through and I see no reason why it would crash....maybe its some where else
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
590
The only functions involved in this are in the above trigger, but here's the map.
 

Attachments

  • H3F.w3x
    1 MB · Views: 65
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