• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Caster System & Spell Templates -- MUI Bug Help

Status
Not open for further replies.
Hey, I'm building a mod with Vexorian's Caster System translated from vJASS to JASS manually with cmdline and jasshelper, and the Spell Templates system, all embedded inside the "Scripts\Blizzard.j" file for my mod.

I'm currently using that file as a library for a unit data map as I develop the mod. However, there is a problem. Normally, the leap looks good like this:
attachment.php


But, if I get ~12 wolves too all Leap together at once [over and over], one or two of them will stick. They become permanently paused in mid air, and never return back to user control. In addition, sometimes one or more wolves will start getting stuck in place, where the user can control them and have them leap to another location, but they continually run in place and can't be moved by the user.

attachment.php


Here is the code used in my map (apart from the Blizzard.j library):
Code:
//===========================================================================
function InitTrig_Leap takes nothing returns nothing
local integer s

 //===================================================================================================
 // Leap ('AFlw')
 //
 set s = SetSpellTemplate('AFlw' , "JumpTemplateNX")
    call SetAbilityDataInt(s , "UseOtherModel" , 0 , 0) //Use another model
    call SetAbilityDataInt(s , "Spell" , 0 , 'AFls') //Spell to cast is AFls (flashy stomp)
    call SetAbilityDataInt(s , "OrderId" , 0 , OrderId("thunderclap")) //Its orderid is thunderclap
    call SetAbilityDataString(s , "JumpAnim" , 0 , "walk") //Play walk animation
    call SetAbilityDataString(s , "EndAnim" , 0 , "birth") //Play birth animation when jump ends
    call SetAbilityDataReal(s , "RecDelay" , 0 , 0.00)
endfunction
 

Attachments

  • BadLeap.png
    BadLeap.png
    1.1 MB · Views: 251
  • GoodLeap.png
    GoodLeap.png
    742.5 KB · Views: 264
  • Work_1b_leap_test.w3x
    704.3 KB · Views: 57
Level 14
Joined
Nov 18, 2007
Messages
816
There is a potential division by 0 in Vex's CasterSystem.

In your Blizzard.j, go to line 14523 and replace that line (and only that line) with the following:
JASS:
        if time == 0 then
            set v = ( z2 - z1 ) / 0.0001
        else
            set v = ( z2 - z1 + 0.5 * g * time * time ) / time //z speed
        endif

See if that helps.

EDIT:
I think i should mention that this is not a good fix, usually. Ideally, control flow would never even bring you to the point that you have to check against 0. However, i wanted to keep the changes to as little as possible while still fixing the problem and also be able to reason about the changes without a deeper understanding of the code-base.

So if anyone has more time, feel free to suggest a better fix.

EDIT 2:
Let me also mention that what you're doing is not something i would advise anyone to do. Set up a development environment where you can use vJass directly, without having to push it through jasshelper manually.
Replacing Blizzard.j is, again, not something i think anyone should do.

I dont know why exactly youre converting everything to JASS manually and then sticking it into your map, but i would suggest you ask around for help in setting up a good development environment. Maybe its done with using JNGP, maybe you need something special. Anyway, ask others.
 
Thanks a ton!

The reason it is embedded in Blizzard.j is that it will have to be when the map becomes part of the Heaven's Fall mod. Is there a way to compile a MOD mpq with vJASS other than that way?

I'm using it as a library like that because it will eventually just have all the triggers condensed into Blizzard.j and embedded into the Heaven's Fall v2 mod release.
 
Status
Not open for further replies.
Top