Problem with jass

Sonic

New Member
Reaction score
10
I did jass spell, and when I wanted to check the spell , but the map wasn't loading it was an error , I saved a map and checked then map worked perfectly , but when I wanted to check again , it wasn't loading it works only after saving
How to fix this problem?+rep
 

Sonic

New Member
Reaction score
10
But the spell is not my, I downloaded from hiveworkshop but if you need map say me
Code:
scope arcanebubble

//Descripitons may contain strange grammar

globals
private constant integer SID = 'A05K'
//You need to enter the spell rawcode here

private constant integer DID ='h01P'
//You need to enter the dummy rawcode here

private constant string sfx = "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl"
//You may change the special effect wich is created when the units fall on the ground

private constant string attatch_p = "origin"
//You may change the positon where the special effect is attatch to its target

private constant real damage_factor = 200
//You may adjust the damage dealt when a target is smashed onto the ground; Please notice this value will be multiplied with the level of this ability

private constant real range = 400
//You may change the range in wich a target has to stay, to be taken into the air

private constant real bubble_height = 800
//You may change the height the bubble is rising to

private constant real flyspeed = 320
//You may change the speed the bubble and the targets are flying into the air

private constant real fallspeed = 2000
//You may change the speed the targets are falling with onto the ground

private constant real stay_in_air = 5
//You may adjust how long the targets are staying in the air

private constant real craterdur = 0.7
//You may adjust the time for creating a crater at the targets position

private constant real crater_range = 120
//You may range the craters radius

private constant real crater_depth = 150
//You  may change the craters depth

//***************************************************************************************
//Global variables to cache some data for minimal amount of time; DO NOT MODIFY !
private player temp
private real temp_r
private unit temp_c
//***************************************************************************************
endglobals

//This struct will contain the main data for this spell
private struct BubbleData
unit caster
unit bubble
group targets
endstruct

//This struct will contain the data for smashing the targets on the ground
private struct FallData
unit caster
unit target
real amount
endstruct

//A filter function to prevent that the bubble takes up the wrong units
private function IsValidTarget takes nothing returns boolean
return IsUnitEnemy(GetFilterUnit(),temp) == true and GetUnitState(GetFilterUnit(),UNIT_STATE_LIFE) > 0 and IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false and IsUnitType(GetFilterUnit(), UNIT_TYPE_MECHANICAL) == false and IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE) == false and IsUnitType(GetFilterUnit(), UNIT_TYPE_ANCIENT) == false
endfunction

//GUI condition func that checks if this spell is being cast
private function Trig_Arcane_Bubble_Conditions takes nothing returns boolean
return GetSpellAbilityId() == SID
endfunction

//A function wich prepares all targets and sends them into the air; Callback for a FORGROUP CALL
private function MakeUnitsFly takes nothing returns nothing
call UnitAddAbility(GetEnumUnit(),'Arav')
call PauseUnit(GetEnumUnit(),true)
call SetUnitPathing(GetEnumUnit(),false)
call SetUnitTimeScale(GetEnumUnit(),0)
call SetUnitFlyHeight(GetEnumUnit(),GetRandomReal(bubble_height * 0.5,bubble_height * 0.85),flyspeed)
endfunction

//This function will reset each target and deals the the damage; Callback for a TIMER
private function Reset takes nothing returns nothing
local timer t = GetExpiredTimer()
local FallData r = FallData(GetHandleInt(t,"fall"))
call UnitRemoveAbility(r.target,'Arav')
call PauseUnit(r.target,false)
call SetUnitPathing(r.target,true)
call SetUnitTimeScale(r.target,1)
call UnitDamageTarget(r.caster,r.target,r.amount,false,false,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
call TerrainDeformCrater(GetUnitX(r.target),GetUnitY(r.target),crater_range,crater_depth,R2I(1000 * craterdur),false)
call DestroyEffect(AddSpecialEffectTarget(sfx,r.target,attatch_p))
call DestroyTimer(t)
set t = null
call r.destroy()
endfunction

//This funciton will send the targets back onto the ground and also sets up the data for the second struct; Callback for a FORGROUP CALL
private function MakeUnitsFall takes nothing returns nothing
local timer t = CreateTimer()
local FallData d = FallData.create()
set d.target = GetEnumUnit()
set d.caster = temp_c
set d.amount = temp_r
call SetHandleInt(t,"fall",d)
call TimerStart(t,GetUnitFlyHeight(d.target) / fallspeed,false,function Reset)
call SetUnitFlyHeight(d.target,GetUnitDefaultFlyHeight(d.target),fallspeed)
set t = null
endfunction

//This function will initiallze the reset and fall function after the units stayed in the air; Callback for TIMER
private function Init_Fall takes nothing returns nothing
local timer t = GetExpiredTimer()
local BubbleData f = BubbleData(GetHandleInt(t,"Bubble"))
set temp_r = damage_factor * I2R(GetUnitAbilityLevel(f.caster,SID))
set temp_c = f.caster
call RemoveUnit(f.bubble)
call ForGroup(f.targets,function MakeUnitsFall)
call TimerStart(t,bubble_height / fallspeed,false,null)
call f.destroy()
set t = null
endfunction

//Mainfunction wich will be called when the spell is being cast; It will prepare any necessary data and units
private function Trig_Arcane_Bubble_Actions takes nothing returns nothing
local BubbleData d = BubbleData.create()
local conditionfunc CON = Condition(function IsValidTarget)
local timer t = CreateTimer()
set d.caster = GetTriggerUnit()
set temp = GetOwningPlayer(d.caster)
set d.bubble = CreateUnit(temp,DID,GetLocationX(GetSpellTargetLoc()),GetLocationY(GetSpellTargetLoc()),0)
set d.targets = CreateGroup() 
call GroupEnumUnitsInRange(d.targets,GetLocationX(GetSpellTargetLoc()),GetLocationY(GetSpellTargetLoc()),range,CON) 
call PauseUnit(d.bubble,true)
call SetUnitFlyHeight(d.bubble,bubble_height,flyspeed)
call ForGroup(d.targets,function MakeUnitsFly)
call SetHandleInt(t,"Bubble",d)
call TimerStart(t,stay_in_air,false,function Init_Fall)
call DestroyCondition(CON)
set CON = null
set t = null
endfunction

//Obviously the triggerregister func...
function InitTrig_Arcane_Bubble_Copy takes nothing returns nothing
    local trigger gg_trg_Arcane_Bubble_Copy = CreateTrigger(  )
    local integer i = 0
    loop
        call TriggerRegisterPlayerUnitEvent(gg_trg_Arcane_Bubble_Copy,Player(i),EVENT_PLAYER_UNIT_SPELL_CAST,null)
        set i = i + 1
        exitwhen i == 16
    endloop
    call TriggerAddCondition( gg_trg_Arcane_Bubble_Copy, Condition( function Trig_Arcane_Bubble_Conditions ) )
    call TriggerAddAction( gg_trg_Arcane_Bubble_Copy, function Trig_Arcane_Bubble_Actions )
    set gg_trg_Arcane_Bubble_Copy = null
endfunction

endscope



And this
Code:
library  KattanaAttatchSys
//Shortform
globals
gamecache mapcache = InitGameCache("arcanebubble.x")
endglobals
function H2I takes handle h returns integer
    return h
    return 0
endfunction
function LocalVars takes nothing returns gamecache
    return mapcache
endfunction
function SetHandleHandle takes handle subject, string name, handle value returns nothing
    if value==null then
        call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreInteger(LocalVars(), I2S(H2I(subject)), name, H2I(value))
    endif
endfunction
function SetHandleInt takes handle subject, string name, integer value returns nothing
    if value==0 then
        call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreInteger(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction
function GetHandleInt takes handle subject, string name returns integer
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
endfunction
endlibrary
 

Hellohihi

New Member
Reaction score
42
Yes it is vjass.

You need newgen world editor (vjass preprocessor) to compile it.

And you have to save everytime before testing map.
 

13lade619

is now a game developer :)
Reaction score
399
I did jass spell, and when I wanted to check the spell , but the map wasn't loading it was an error , I saved a map and checked then map worked perfectly , but when I wanted to check again , it wasn't loading it works only after saving

you cant just use the Test Map button if you have vjass..
that way vjass isnt 'saved' and wont load the map.

you need to hit SAVE before hitting the TestMap button.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top