What is vJASS?

sidove

Member
Reaction score
22
Yes this is a maybe a nooby question but what is vJASS? I have just learned the basics of JASS and I'm trying to learn more by going to hiveworkshop.com and look how some spells are created and structured. But like 80 - 70 % is in vJASS and i don't know what it is... Is it that the text is colored or what is it? Is vJASS the same coding as JASS or is it different please help and answer!

+rep ofc i you help me
 

sidove

Member
Reaction score
22
I have Jassgenewpack xD But it's not that i have opened a map on hive witch is in vJASS and it have some weird JASS coding, maybe the coding is normal and is just an alternate way of writing things but donnu... here is an example:
JASS:
/TESH.scrollpos=0
//TESH.alwaysfold=0
//=====================================================================================
//=====================================================================================
//==============================Teleporting=Shot=v1.3==================================
//=====================================================================================
//=====================================================================================
//==================================By=xD,Schurke======================================
//=====================================================================================
//=====================================================================================

scope teleportingshot initializer teleportInt
globals
    
    private integer DUMMY = 'h000' //dummy id: change to your map specific dummy raw code
    
    private integer SPELL_RAW = 'A000' //the spell rawcode: change to your map specific spell raw code
    private integer DUMMY_SPELL_RAW = 'A001' //the dummy spell rawcode: change to your map specific dummy spell raw code
    private integer DUMMY_SPELL_DEBUFF = 'B000' //the dummy spell debuff: change to your map specific dummy spell debuff raw code
    private integer TIMED_LIFE_RAW = 'BTLF' //don't change (timed life raw code)
    
    //the diffrent effect strings
    private constant string SPELL_SFX =  "Abilities\\Spells\\Undead\\DeathPact\\DeathPactTarget.mdl" //the effect of the wave
    private constant string SPELL_SFX_TWO = "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTo.mdl" //the effect, which is created at the casting point
    private constant string SPELL_SFX_THREE = "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" //the teleporting effect
    
    //below are some diffrent values
    private constant real Range = 950. //the max range of the spell, change to increase/decrease the range
    private constant real Interval = 0.1 //the timer interval DON'T CHANGE
    private constant real TELEPORT_INTERVAL = 1. //the interval after which time the units are teleported
    private constant real WAVE_SPEED = 45. //decrease/increase for a lower/higher speed
    private constant real CASTER_STOP = 90. //must always be a multiplicator of WAVE_SPEED
    private constant real DAMAGE = 50
    
    //the order strings
    private constant string curse = "curse" //dummy spell order string
    private constant string stop = "stop" //stop string for caster, because spell is based on channel
endglobals

//function for the damage calculation
private function damage takes integer lvl returns real
    return I2R(lvl)*DAMAGE
endfunction

private struct teleportstruct
    unit caster //stores the caster
    group g = CreateGroup() //stores the units for teleporting issues and only one time damage
    timer t //timer for executing the method effectmethod
    real curdis = 0 //distance, increases each 0.05 seconds by 20
    real x1 = 0 //x coordinate of the caster
    real y1 = 0 //y coordinate of the caster
    real x2 = 0 //x coordinate of the target point ability being cast (for getting the angle)
    real y2 = 0 //y coordinate of the target point ability being cast (for getting the angle)
    real angle = 0 //angle: for the direction of the spell
    effect sfx //the effect which is created at the casters point
        static method teleport takes nothing returns nothing
            local teleportstruct Dat = GetTimerData(GetExpiredTimer())
            local unit u
                //part where the units are teleported
                loop
                    set u = FirstOfGroup(Dat.g)
                    exitwhen u == null
                    if GetUnitState(u,UNIT_STATE_LIFE) > 0 then
                        call DestroyEffect(AddSpecialEffect(SPELL_SFX_THREE,GetUnitX(u),GetUnitY(u)))
                        call SetUnitPosition(u,Dat.x1,Dat.y1)
                        call UnitRemoveAbility(u,DUMMY_SPELL_DEBUFF)
                        call GroupRemoveUnit(Dat.g,u)
                    else
                        call GroupRemoveUnit(Dat.g,u)
                    endif
                endloop        
                call teleportstruct.destroy(Dat)
            set u = null      
        endmethod
        
        static method effectmethod takes nothing returns nothing
            local teleportstruct Dat = GetTimerData(GetExpiredTimer()) //gets the struct with the TimerUtiles function GetTimerData
            local group g = CreateGroup() //Group for damaging and later teleporting issues
            local unit u //group unit
            local real x //x for wave effect
            local real y //y for wave effect
            local unit dummy //dummy variable
                set Dat.curdis = Dat.curdis + WAVE_SPEED //increases the current distance for the next two lines nessesary
                set x = Dat.x1 + Dat.curdis * Cos(Dat.angle * bj_DEGTORAD)
                set y = Dat.y1 + Dat.curdis * Sin(Dat.angle * bj_DEGTORAD) 
                call DestroyEffect(AddSpecialEffect(SPELL_SFX,x,y)) //creates the effect and destroys it
                call GroupEnumUnitsInRange(g,x,y,150,null) //picks all units in a range of 150 of x and y (for damaging etc.) following loop for picking units
                loop
                    set u = FirstOfGroup(g)
                    exitwhen u == null
                    if IsUnitEnemy(u,GetOwningPlayer(Dat.caster)) and IsUnitType(u,UNIT_TYPE_STRUCTURE) != true and GetUnitState(u,UNIT_STATE_LIFE) > 0 and IsUnitInGroup(u,Dat.g) != true then //checks diffrent aspects for damaging target etc.
                        call UnitDamageTarget(Dat.caster,u,damage(GetUnitAbilityLevel(Dat.caster,SPELL_RAW)),false,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS) //damages the current unit u
                        //dummy part for adding debuff to unit u
                        set dummy = CreateUnit(GetOwningPlayer(Dat.caster),DUMMY,GetUnitX(u),GetUnitY(u),0)
                        call UnitAddAbility(dummy,DUMMY_SPELL_RAW)
                        call IssueTargetOrder(dummy,curse,u)
                        call UnitApplyTimedLife(dummy,TIMED_LIFE_RAW,1)
                        //=======================================
                        call GroupAddUnit(Dat.g,u) //adds the unit u to the group g in the struct teleportstruct
                        call GroupRemoveUnit(g,u) //removes current unit u from group g
                    else
                        call GroupRemoveUnit(g,u) //removes current unit u from group g
                    endif
                endloop
                call DestroyGroup(g) //destroys group g for preventing leaks
                if Dat.curdis == CASTER_STOP then //after a short time (0.25sec) the caster stops casting (because spell is based on channel)
                    call IssueImmediateOrder(Dat.caster,stop)
                endif
                
                //if the current distance (curdis) reachs (in this case 800) the method onDestroy is called
                if Dat.curdis >= Range then 
                    call PauseTimer(Dat.t)
                    call SetTimerData(Dat.t,Dat)
                    call TimerStart(Dat.t,TELEPORT_INTERVAL,false,function teleportstruct.teleport)
                endif
            //nullify the local vars
            set g = null
            set u = null
            set dummy = null
        endmethod
        
        //part for creating the struct and setting values to the vars
        static method create takes unit u, real x, real y returns teleportstruct
            local teleportstruct Dat = teleportstruct.allocate()
                set Dat.caster = u
                set Dat.x1 = GetUnitX(u)
                set Dat.y1 = GetUnitY(u)
                set Dat.x2 = x
                set Dat.y2 = y
                set Dat.angle = bj_RADTODEG * Atan2(Dat.y2 - Dat.y1, Dat.x2 - Dat.x1)
                set Dat.sfx = AddSpecialEffect(SPELL_SFX_TWO,GetUnitX(u),GetUnitY(u))
                set Dat.t = NewTimer()
                call SetTimerData(Dat.t,Dat)
                call TimerStart(Dat.t,Interval,true,function teleportstruct.effectmethod)
            return Dat
        endmethod
        
        //method which nullifys all struct variables and teleports the units in the struct group var g to the casting point
        method onDestroy takes nothing returns nothing
                call ReleaseTimer(.t) //a TimerUtiles function similar to DestroyTimer()
                set .t = null
                set .caster = null
                call DestroyGroup(.g)
                set .g = null
                call DestroyEffect(.sfx)
                set .sfx = null
        endmethod
endstruct

//returns every time false, so that we don't need an action function
private function teleportCond takes nothing returns boolean
    local teleportstruct Dat
        if GetSpellAbilityId() == SPELL_RAW then
            set Dat = teleportstruct.create(GetTriggerUnit(),GetLocationX(GetSpellTargetLoc()),GetLocationY(GetSpellTargetLoc())) //gives the needed values over to the struct and creates it
        endif
        return false
endfunction

//initialization function with preloading part
private function teleportInt takes nothing returns nothing
    local trigger int = CreateTrigger()
    local unit u
    local integer index = 0
        loop
            call TriggerRegisterPlayerUnitEvent(int, Player(index), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
            set index = index + 1
            exitwhen index == bj_MAX_PLAYER_SLOTS
        endloop    
        call TriggerAddCondition(int,Condition(function teleportCond))
    
    //Preloading
    set u = CreateUnit(Player(14),DUMMY,999999,999999,0)
    call UnitAddAbility(u,DUMMY_SPELL_RAW)
    call RemoveUnit(u)
    call Preload(SPELL_SFX)
    call Preload(SPELL_SFX_TWO) 
    call Preload(SPELL_SFX_THREE)
    set int = null
    set u = null
endfunction
endscope
 

sidove

Member
Reaction score
22
Ok XD Can anybody tell me whats about that
Code:
 private integer
stuff in the begging? Is it an alternate way of writing :
JASS:
function Trig_t_Cond takes nothing returns boolean
return GetSpellAbilityId() == 'A000'
? +rep if answered. Btw LearningCode you get your cookie too here you go :shades:
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
vJASS is an extension of the normal JASS language.
It offers greater functionality for spell and system making.

It also introduces OOP (Object-Oriented Programming) into the world of JASS.
I highly suggest learning vJASS. Some people actually feel it's easier to learn vJASS along with JASS.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Check them out in jasshelper's manual. :)
If you still don't understand, feel free to ask here.
 

sidove

Member
Reaction score
22
Thank you for clearing that out :) But i have 1 question more :O Is it harder to learn vJASS or is it almost the same?
 

sidove

Member
Reaction score
22
I want to just know how to make good systems and spells. Is that harder to achieve if you learn vJASS?
 

Jesus4Lyf

Good Idea™
Reaction score
397
Much easier.
I learned by learning JASS fairly thoroughly, then by reading the manual I posted above and understanding what it compiles to.

>Also its less buggy, faster
More buggy and slower* to the casual user.

Example:
JASS:
struct kk
method k takes nothing returns nothing
call .z()
call .z()
endmethod
method z takes nothing returns nothing
call BJDebugMsg("x")
call BJDebugMsg("x")
endmethod
endstruct

.z() would be called with [LJASS]TriggerEvaluate[/LJASS].
-->
JASS:
struct kk
method z takes nothing returns nothing
call BJDebugMsg("x")
call BJDebugMsg("x")
endmethod
method k takes nothing returns nothing
call .z()
call .z()
endmethod
endstruct

That is significantly more efficient (who's to know?).
 

sidove

Member
Reaction score
22
Ok ty both +rep for both but last question. Does it take longer time to learn vJASS?
 

Anachron

New Member
Reaction score
53
No. Learned GUI in 5 years, and vJass in one. However, if you know any other programming language its easier to understand. (Also depends on the time you can spend at it)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top