• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[JASS] Is there a problem/bug here?

Status
Not open for further replies.
Level 19
Joined
Aug 31, 2008
Messages
1,779
a1-1024x593.jpg

a2-1024x540.jpg

a3-1024x469.jpg


JASS:
function IsNotHero takes nothing returns boolean
if IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false then
call UnitAddAbility(GetFilterUnit(),’Aloc’)
return true
endif
return false
endfunction

function PerspclreWork takes nothing returns nothing
local real x=GetUnitX(gg_unit_Ewar_0759)
local real y=GetUnitY(gg_unit_Ewar_0759)
local real x1=GetUnitX(GetEnumUnit())
local real y1=GetUnitY(GetEnumUnit())
local real d=SquareRoot((x-x1)*(x-x1)+(y-y1)*(y-y1))
local integer t=R2I(0.255*d)
if t>255 then
set t=255
endif
call SetUnitVertexColor(GetEnumUnit(),255,255,255,t)
endfunction

function PerspclreDone takes nothing returns nothing
call SetUnitVertexColor(GetEnumUnit(),255,255,255,255)
endfunction

function Perspclre takes nothing returns nothing
if IsUnitInRegion(udg_rg,gg_unit_Ewar_0759) then
set udg_b=true
call ForGroup(udg_g,function PerspclreWork)
else
if udg_b then
set udg_b=false
call ForGroup(udg_g,function PerspclreDone)
endif
endif
endfunction

function SystemInit takes nothing returns nothing
local boolexpr b=Condition(function IsNotHero)
call GroupEnumUnitsInRect(udg_g,bj_mapInitialPlayableArea,b)
call DestroyBoolExpr(b)
set b=null
call RegionAddRect(udg_rg,gg_rct_r01)
call RegionAddRect(udg_rg,gg_rct_r02)
call RemoveRect(gg_rct_r01)
call RemoveRect(gg_rct_r02)
call TimerStart(CreateTimer(),0.1,true,function Perspclre)
call DestroyTrigger(GetTriggeringTrigger())
endfunction
 
Level 9
Joined
Nov 4, 2007
Messages
931
... Please be at least a little specific as to what you think there might be a problem or bug with and elaborate on your coding and screenshots as many of us lack the ability to read minds over the internet.
 
Status
Not open for further replies.
Top