• 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.

vjass problem

Status
Not open for further replies.
Level 12
Joined
Jan 30, 2009
Messages
1,067
If you mean that you can't PLAY them, as in wc3 won't load them, then that's probably because the code abuses an old bug that's been fixed. The return bug.

If that's not what you meant, I'm afraid you'll have to elaborate more.
 
Level 5
Joined
Oct 14, 2010
Messages
100
There's an option in TESH (the vjass trigger editor in Newgen) that saves the scroll position. If you're using the "test map" button, the map will save but jasshelper will not run, causing your code not to be compiled into jass.
To solve that problem, save your map manually before clicking the 'test map' button. Make sure you don't scroll through your code inbetween those steps.

Another possibility is that you've just created the map. Newly created maps must be saved twice.

If that's not the problem, are you getting any compile errors?
 
There's an option in TESH (the vjass trigger editor in Newgen) that saves the scroll position. If it's enabled (by default), every time you scroll in the trigger editor your code is changed (in the background) and you must save it again.
Unless you disable it, do not scroll through your code after saving your map.

If that's not the problem, are you getting any compile errors?

I set it to true, but it does not cause bugs for me, since Warcraft only uses the last saved instance of the map... so even if your map is currently unsaved you can still play it...
 
Level 4
Joined
Oct 15, 2010
Messages
71
I have the latest patch and the latest jass helper, still it wont work



Heres a map that has vjass and cannot be played into my warcraft 3
 

Attachments

  • (4)PoC_Source_1.24.w3x
    3.1 MB · Views: 98
tested the map (its running, all codes are disabled), opened in NewGenWE, tried to enable the disabled codes one by one

and saw four libraries which contains errors



first, it uses the return bug which is removed on recent patches:
JASS:
//this is the return bug, it causes error
private function h2i takes handle h returns integer 
    return h
    return 0
endfunction

next on the functions GetStoredInteger, FlushStoredMission, HaveStoredInteger and StoreInteger
you use GetCache() to get the game cache, but GetCache returns a hashtable not a game cache, so another error.



on these two libraries the problem lies with the functions:
JASS:
GetRecycledUnit()
GetRecycleDummyUnit()
RecycleUnit(GetSoldUnit())
ReplaceDummy

why? because those functions don't exist in your map, I think they are on a library that you forgot to import




almost same problem as the two libraries above:

AddConversion does not exist in your map...




Note:
The map has other errors that does not return a compile error which I'm kinda tired to find out (you can try to find them

yourself by disabling all codes again, enable one, save, open map in war3, then repeat the process until your map becomes

unopenable in WE, then you will be sure that the last code that you enabled has an error).

I suggest a complete code revamp on your map... and be careful when importing codes next time, and be sure to follow all

instructions...
 
how can i fix this? cause i'm not good a vjass.

well you need to find the library that has those functions and import them... for the return bug, you need to revamp that whole code...

and since there are still some errors which I havent seen, I suggest a complete revamp of the map...

basically before you import a library into the map, read it first, look on how to use it, how to import etc...
 
Level 4
Joined
Oct 15, 2010
Messages
71
How can make this trigger into gui because it makes it easier for me, its a spell from DotA.


JASS:
function Damage takes integer level returns real //   Ravage Damage
                                                 //
    local real Base_Damage       =   150.0       //   This function defines how much damage ravage will do.
    local real Damage_Per_Level  =   100.0       //   The Base_Damage variable is a constant damage amount
                                                 //   that stays the same regardless of the level.
return Base_Damage+Damage_Per_Level*level        //   The Damage_Per_Level is just how much more damage will
endfunction                                      //   be dealt each level.
                                                 //   By default its set to do 250/350/450 damage per level.
                                                 //
                                                 //
                                                 //
function Speed takes nothing returns real        //   Ravage Speed
                                                 //
    local real speed             =   1000.0      //   This is how fast the spikes spread out from the hero
                                                 //   By Default its set to 1000 ms.
return speed*0.025                               //                  
endfunction                                      //           
function AoE takes integer level returns real    //   Ravage Area of Effect
                                                 //
    local real Base_Area         =   375.0       //   Like the damage, this part of the skill can change per
    local real Area_Per_Level    =   150.0       //   level.
                                                 //   By default its set to have an AoE radius of 525/675/825.
return Base_Area+Area_Per_Level*level            //
endfunction                                      //
                                                 //
function Ability_ID takes nothing returns integer//   Base Ability Code
                                                 //
    local integer ID             =   'A000'      //   This is the ability code of the base ability that will
                                                 //   start the trigger. In this map the base is 'A000' but in
return ID                                        //   your map it might be very different. To get the ability
endfunction                                      //   code of a skill open up the object editor, go to the
                                                 //   abilities tab, and press Control+D at the same time. This
                                                 //   will then show the ability codes of the all the abilities
                                                 //   in your game. Simply replace the current code with the code
                                                 //   of the base skill in your game.
                                                 //
                                                 //
                                                 //
function Dummy_ID takes nothing returns integer  //    Dummy Ability Code     
                                                 //
    local integer ID             =   'h000'      //    To stun the units a dummy skill is need to provide this
                                                 //    effect. Like the base skill, you need to enter the correct
return ID                                        //    ability code for the dummy ability as well. When making the
endfunction                                      //    dummy skill, just copy and paste the dummy skill in this map
                                                 //    since it has all the correct values that you need. Then just
                                                 //    change the ability code.
                                                 //
                                                 //
                                                 //
function Fake_ID takes nothing returns integer   //    Dummy Unit Code
                                                 //
    local integer ID             =   'A001'      //    This is the Unit Code of the dummy unit that will cast the
                                                 //    dummy ability that will stun any targeted units. To get the
return ID                                        //    Unit Code of a unit, go to the unit tab in the object editor
endfunction                                      //    and press Control+D as the same time. Then go to your dummy
                                                 //    and copy its Unit Code. Then just enter in the correct code
                                                 //    here.
                                                 //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function Flying_Duration takes nothing returns nothing
    local unit target = null
    local boolean active = false
    local integer loopA = 1
    local integer info = GetHandleId(udg_time[2])
    local integer count = LoadInteger(udg_table,0,info)
    local integer z
    loop
    exitwhen loopA > count
        if LoadInteger(udg_table,loopA,info)==0then
            set active = true
            set target = LoadUnitHandle(udg_table,info,loopA-1)
            set z = LoadInteger(udg_table,info,loopA)
            if 21>z then
                call SetUnitFlyHeight(target,275-(z-10)*(z-10),0)
                call SaveInteger(udg_table,info,loopA,z+1)
            else
                call SetUnitFlyHeight(target,GetUnitDefaultFlyHeight(target),0)
                call SaveInteger(udg_table,loopA,info,1)
                call PauseUnit(target,false)
            endif

            set target = null
        endif
    set loopA = loopA + 2
    endloop
    if active then
        call ResumeTimer(udg_time[2])
    else
        call PauseTimer(udg_time[2])
        set loopA = 1
        loop
        exitwhen loopA > count
            call SaveInteger(udg_table,loopA,info,0)
        set loopA = loopA + 2
        endloop
        call FlushChildHashtable(udg_table,info)
        call SaveInteger(udg_table,0,info,0)
    endif
endfunction
function Ravage_Targets takes nothing returns nothing
    local unit dummy = null
    local unit target = GetFilterUnit()
    local unit caster = LoadUnitHandle(udg_table,99999,1)
    local group targets = LoadGroupHandle(udg_table,99999,2)
    local integer info
    local integer count
    if GetWidgetLife(target)>0.405and IsUnitEnemy(caster,GetOwningPlayer(target))and IsUnitInGroup(target,targets)==false then
        set info = GetHandleId(udg_time[2])
        set count = LoadInteger(udg_table,0,info)
        set dummy = CreateUnit(GetOwningPlayer(target),Dummy_ID(),0,0,0)
        call UnitRemoveAbility(dummy,'Amov')
        call UnitApplyTimedLife(dummy,'BTLF',1)
        call UnitAddAbility(dummy,Fake_ID())
        call SetUnitAbilityLevel(dummy,Fake_ID(),GetUnitAbilityLevel(caster,Ability_ID()))
        call IssueTargetOrder(dummy,"thunderbolt",target)
        call PauseUnit(target,true)
        call ResumeTimer(udg_time[2])
        call UnitAddAbility(target,'Arav')
        call UnitRemoveAbility(target,'Arav')
        call SaveUnitHandle(udg_table,info,count,target)
        call SaveInteger(udg_table,info,count+1,0)
        call SaveInteger(udg_table,0,info,count+2)
        call UnitDamageTarget(caster,target,Damage(GetUnitAbilityLevel(caster,Ability_ID())),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
        call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Undead\\Impale\\ImpaleHitTarget.mdl",GetWidgetX(target),GetWidgetY(target)))
        call GroupAddUnit(targets,target)
        set dummy = null
    endif
    set targets = null
    set target = null
    set caster = null
endfunction
function Ravage_Duration takes nothing returns nothing
    local boolean active = false
    local integer show
    local integer loopA = 1
    local integer info = GetHandleId(udg_time[1])
    local integer count = LoadInteger(udg_table,0,info)
    local real angle
    local real x1
    local real y1
    local real x
    local real y
    loop
    exitwhen loopA > count
        if LoadInteger(udg_table,loopA,info)==0then
            set active = true
            set x = LoadReal(udg_table,info,loopA+2)
            set y = LoadReal(udg_table,info,loopA+3)
            set x1 = LoadReal(udg_table,info,loopA+4)
            set y1 = LoadReal(udg_table,info,loopA+5)
            if SquareRoot((x-x1)*(x-x1)+(y-y1)*(y-y1))<=LoadReal(udg_table,info,loopA+6)then
                set angle = LoadReal(udg_table,info,loopA+1)
                set x1 = x1+Speed()*Cos(angle*bj_DEGTORAD)
                set y1 = y1+Speed()*Sin(angle*bj_DEGTORAD)
                set show = LoadInteger(udg_table,info,loopA+7)
                call SaveUnitHandle(udg_table,99999,1,LoadUnitHandle(udg_table,info,loopA-1))
                call SaveGroupHandle(udg_table,99999,2,LoadGroupHandle(udg_table,info,loopA))
                if show==R2I(80.0/Speed())then
                    call SaveInteger(udg_table,info,loopA+7,0)
                    call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Undead\\Impale\\ImpaleMissTarget.mdl",x1,y1))
                else
                    call SaveInteger(udg_table,info,loopA+7,show+1)
                endif
                call GroupEnumUnitsInRange(udg_targets,x1,y1,125.0,Condition(function Ravage_Targets))
                call SaveReal(udg_table,info,loopA+4,x1)
                call SaveReal(udg_table,info,loopA+5,y1)
            else
                call SaveInteger(udg_table,loopA,info,1)
            endif
        endif
    set loopA = loopA + 9
    endloop
    if active then
        call ResumeTimer(udg_time[1])
        call FlushChildHashtable(udg_table,99999)
    else
        call PauseTimer(udg_time[1])
        set loopA = 1
        loop
        exitwhen loopA > count
            call SaveInteger(udg_table,loopA,info,0)
            call DestroyGroup(LoadGroupHandle(udg_table,info,loopA))
        set loopA = loopA + 9
        endloop
        call FlushChildHashtable(udg_table,info)
        call SaveInteger(udg_table,0,info,0)
    endif
endfunction
function Ravage_Start takes nothing returns nothing
    local group targets = CreateGroup()
    local unit caster = GetTriggerUnit()
    local integer loopA = 0
    local integer info = GetHandleId(udg_time[1])
    local integer count = LoadInteger(udg_table,0,info)
    local real x = GetWidgetX(caster)
    local real y = GetWidgetY(caster)
    loop
    exitwhen loopA > 11
        call SaveUnitHandle(udg_table,info,count,caster)
        call SaveGroupHandle(udg_table,info,count+1,targets)
        call SaveReal(udg_table,info,count+2,loopA*30)
        call SaveReal(udg_table,info,count+3,x)
        call SaveReal(udg_table,info,count+4,y)
        call SaveReal(udg_table,info,count+5,x)
        call SaveReal(udg_table,info,count+6,y)
        call SaveReal(udg_table,info,count+7,AoE(GetUnitAbilityLevel(caster,Ability_ID())))
        call SaveInteger(udg_table,info,count+8,0)
        set count = count + 9
    set loopA = loopA + 1
    endloop
    call ResumeTimer(udg_time[1])
    call SaveInteger(udg_table,0,info,count)
    set targets = null
    set caster = null
endfunction
function Spell_Start takes nothing returns nothing
if GetSpellAbilityId()==Ability_ID()then
    call Ravage_Start()
endif
endfunction
function InitTrig_Ravage takes nothing returns nothing
    set udg_table = InitHashtable()
    set gg_trg_Ravage = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_trg_Ravage,EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(gg_trg_Ravage,Condition(function Spell_Start))
    call TimerStart(udg_time[1],0.025,true,function Ravage_Duration)
    call TimerStart(udg_time[2],0.025,true,function Flying_Duration)
    call PauseTimer(udg_time[1])
    call PauseTimer(udg_time[2])
    set gg_trg_Ravage =  null
endfunction
 
For ravage... just create a unit ability based on impale... give it the same levels as the ability your hero has...

now when you cast ravage, create dummy units on the caster's position, maybe 12 or 16 depending on what you want

then give them the dummy impale, and make them cast it on projected points around the caster...
 
but my ravage code is a bit different because it doesn't need impale, it only needs a stun skill and a dummy unit

well, you can try to find a jump system available in GUI for the throw part...

but basically using impale is an easier way to do it in GUI...

but why would you want to transform that code into GUI? that code is nice. ^_^
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
You can't take a Jass Code and easily convert it to GUI. Unless you were the one who turned it from GUI to Jass to begin with. And recently, so you can Undo the action.

The only way to turn Jass into GUI otherwise is to do it manually. Which then would require revamping the code (Especially considering all the locals, hf with that), which then would require knowledge of Jass to begin with...WHICH DEFEATS THE PURPOSE!

AKA: Do it all over in GUI. Or leave it as Jass, since it's better, ;)
 
Level 4
Joined
Oct 15, 2010
Messages
71
my ravage gui trigger did not work, it keeps going on the wrong direction


and i just want to know how to make ravage in jump system and i already have it.
 
Last edited:
one question: how much experience do you have in using the editor?

coz ravage using impale dummies is a pretty easy spell to make in GUI...

  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • Ability being cast is equal to Ravage
  • Actions
    • Set TempInt = Unit - Get Level of Ravage for triggering unit
    • Set TempLoc = Position of TriggeringUnit
    • Set TempOwner = Owner of Triggering Unit
    • For each integer A from 1 to 16 do actions
      • Do - Actions
        • Unit - Create 1 DummyUnit for TempOwner on TempLoc facing (360/16)x(Integer A)
        • Set Dummy = Last created unit
        • Unit - Add ImpaleDummy to Dummy
        • Unit - Set Level of ImpaleDummy for Dummy equal to TempInt
        • Set TempTarget = TempLoc offset by 100 towards (360/16)*IntegerA
        • Unit - Order Dummy to Crypt Lord - Impale TempTarget
        • Unit - Apply a 1 second generic expiration timer to Dummy
        • Custom script: call RemoveLocation(udg_TempTarget)
    • Custom script: call RemoveLocation(udg_TempLoc)
 
Level 4
Joined
Oct 15, 2010
Messages
71
and can you create a map with rupture spell and black hole spell in it because all these spells that i find are in vjass.

and how do i put ramdom fire on goldmines and trees and blight on trees using triggers?
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
Triple posting is bad. Use the Edit button.

As for that, it probably means there's something wrong with the code.
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
To follow up on Adiktuz's comment...

If that's the case, uninstall both wc3 and newgen/jasshelper.

Then reinstall wc3, and then JNGP and lastly update jasshelper. That may help.

As a last resort.
 
Status
Not open for further replies.
Top