- Joined
- Jul 26, 2008
- Messages
- 1,009
Alright, I have a minor bug running in the four systems I have in my map that enhance spells.
The 4 systems I use are KaTTaNa's HandleVars, Vexorian's Caster System, and Knutz NewPos, and some custom functions by Blade.dk. I think it's the NewPos thats causing the problem, but I'm not familiar enough with JASS to tell. The knutz spellpack I DLed was from wc3campaigns, and came with KaTTaNa's HandleVars.
What happens is whenver the hero casts a spell, they face odd angels. My Volley spell from Blade.dk causes the hero to face a random angel.(It's blizzard based) and any stomp spell cast causes the hero to face to the east. This would be minor, but a specific JASS spell I would like to implement relies on the hero facing a specific way, and I think the facing issue is causing graphic problems with Volley.
I'm really not sure. I'm also gonna add Daminon's system, which has had weird errors too when sometimes coupled with these systems.
Anyways, if someone has an idea what's causing this please tell me. Provided are the 4 systems intertwined:
There will also be an index system by Clan NgO activated soon, which may cause conflict. Not shown is Vexorian's Caster System, which can be DLed easily enough and is quiet large, containing 6 seperate triggers.
The 4 systems I use are KaTTaNa's HandleVars, Vexorian's Caster System, and Knutz NewPos, and some custom functions by Blade.dk. I think it's the NewPos thats causing the problem, but I'm not familiar enough with JASS to tell. The knutz spellpack I DLed was from wc3campaigns, and came with KaTTaNa's HandleVars.
What happens is whenver the hero casts a spell, they face odd angels. My Volley spell from Blade.dk causes the hero to face a random angel.(It's blizzard based) and any stomp spell cast causes the hero to face to the east. This would be minor, but a specific JASS spell I would like to implement relies on the hero facing a specific way, and I think the facing issue is causing graphic problems with Volley.
I'm really not sure. I'm also gonna add Daminon's system, which has had weird errors too when sometimes coupled with these systems.
Anyways, if someone has an idea what's causing this please tell me. Provided are the 4 systems intertwined:
JASS:
/Return Bug
function H2I takes handle h returns integer
return h
return 0
endfunction
function I2H takes integer i returns handle
return i
return null
endfunction
function I2U takes integer i returns unit
return i
return null
endfunction
function I2G takes integer i returns group
return i
return null
endfunction
function I2E takes integer i returns effect
return i
return null
endfunction
function I2T takes integer i returns timer
return i
return null
endfunction
function I2TD takes integer i returns terraindeformation
return i
return null
endfunction
//External Functions:
function GetTableTriggerCondition takes string table, string field returns triggercondition
return GetStoredInteger(CSCache(),table,field)
return null
endfunction
function GetTableTextTag takes string table, string field returns texttag
return GetStoredInteger(CSCache(),table,field)
return null
endfunction
//##End of External functions##
//#########################################################
// Check Pathability
// By Vexorian
//
//#########################################################
function CheckPathabilityTrickGet takes nothing returns nothing
set bj_rescueChangeColorUnit = bj_rescueChangeColorUnit or (GetEnumItem()!=bj_itemRandomCurrentPick)
endfunction
function CheckPathabilityTrick takes item p, real x, real y returns boolean
local integer i=30
local rect r
call SetItemPosition(p,x,y)
if ((Pow(GetItemX(p)-x,2)+Pow(GetItemY(p)-y,2))<=100) then
return true
endif
set r=Rect(x-i,y-i,x+i,y+i)
set bj_itemRandomCurrentPick=p
set bj_rescueChangeColorUnit=false
call EnumItemsInRect(r,null,function CheckPathabilityTrickGet)
call RemoveRect(r)
set r=null
return bj_rescueChangeColorUnit
endfunction
function CheckPathability takes real x, real y returns boolean
local item it = CreateItem('ciri',x,y)
local boolean b = CheckPathabilityTrick(it,x,y)
call SetItemVisible(it,false)
call RemoveItem(it)
set it=null
return b
endfunction
//***********************************************
//* knutz_Functions v 1.1
//* By knutz
//*
//***********************************************
//***********************************************
//*
//* knutz_NewPos
//*
//* Description
//* -----------
//* Given a point of origin, a distance (c)
//* and an angle (A) this function will return
//* the position of the destination. You will
//* need Vexorian's Caster System (paste this
//* (paste this function under the CS code).
//* You will also need Vexorian's CheckPathability
//* code ABOVE this function.
//*
//* IMPORTANT: If you set check_path to true,
//* ensure you check the return value isn't null
//* before assigning it to any objects.
//*
//************************************************
function knutz_NewPos takes location origin, real c, real A, boolean check_path returns location
local real oX = GetLocationX(origin)
local real oY = GetLocationY(origin)
local real newX = CS_SafeX(oX+(Cos(A*bj_DEGTORAD)*c))
local real newY = CS_SafeY(oY+(Sin(A*bj_DEGTORAD)*c))
if ((check_path == true) and (CheckPathability(newX,newY) != true)) then
return null
endif
return Location(newX,newY)
endfunction
//***********************************************
//*
//* knutz_NewPosZ
//*
//* Description
//* -----------
//* Given a point of origin, a distance (c)
//* and an angle (A - from the ground) this function
//* will return a location. This is NOT to be used
//* as a location, but a convenient way of returning
//* 2 real values from a single function.
//* The X value is the distance along the ground
//* The Y value is the fly height/z offset
//*
//************************************************
function knutz_NewPosZ takes real c,real A returns location
local real a = Sin(A*bj_DEGTORAD)*c
local real b = Cos(A*bj_DEGTORAD)*c
return Location(b,a)
endfunction
//KATTANAS HANDLEVAR SYSTEM
// By KaTTaNa
function LocalVars takes nothing returns gamecache
if (udg_handlevars==null) then
set udg_handlevars=InitGameCache("jasslocalvars.w3v")
endif
return udg_handlevars
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 SetHandleReal takes handle subject, string name, real value returns nothing
if value==0 then
call FlushStoredReal(LocalVars(), I2S(H2I(subject)), name)
else
call StoreReal(LocalVars(), I2S(H2I(subject)), name, value)
endif
endfunction
function SetHandleString takes handle subject, string name, string value returns nothing
if value==null then
call FlushStoredString(LocalVars(), I2S(H2I(subject)), name)
else
call StoreString(LocalVars(), I2S(H2I(subject)), name, value)
endif
endfunction
function SetHandleBoolean takes handle subject, string name, boolean value returns nothing
if value==false then
call FlushStoredBoolean(LocalVars(), I2S(H2I(subject)), name)
else
call StoreBoolean(LocalVars(), I2S(H2I(subject)), name, value)
endif
endfunction
function GetHandleHandle takes handle subject, string name returns handle
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleInt takes handle subject, string name returns integer
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleReal takes handle subject, string name returns real
return GetStoredReal(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleString takes handle subject, string name returns string
return GetStoredString(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleBoolean takes handle subject, string name returns boolean
return GetStoredBoolean(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleUnit takes handle subject, string name returns unit
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleTimer takes handle subject, string name returns timer
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleTrigger takes handle subject, string name returns trigger
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleEffect takes handle subject, string name returns effect
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleLightning takes handle subject, string name returns lightning
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleGroup takes handle subject, string name returns group
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleWidget takes handle subject, string name returns widget
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function FlushHandleLocals takes handle subject returns nothing
call FlushStoredMission(LocalVars(), I2S(H2I(subject)) )
endfunction
//***Handle Vars End***
//***TimedBoolean Start***
// By Blade.dk
function SetHandleBooleanTimed_Child takes nothing returns nothing
local timer t = GetExpiredTimer()
local handle subject = GetHandleHandle(t, "handle")
call SetHandleBoolean(subject, GetHandleString(t, "string"), false)
call FlushHandleLocals(t)
call DestroyTimer(t)
set t = null
set subject = null
endfunction
function SetHandleBooleanTimed takes handle subject, string name, real duration returns nothing
local timer t = CreateTimer()
call SetHandleBoolean(subject, name, true)
call SetHandleHandle(t, "handle", subject)
call SetHandleString(t, "string", name)
call TimerStart(t, duration, false, function SetHandleBooleanTimed_Child)
set subject = null
set t = null
endfunction
//***TimedBoolean End***
There will also be an index system by Clan NgO activated soon, which may cause conflict. Not shown is Vexorian's Caster System, which can be DLed easily enough and is quiet large, containing 6 seperate triggers.