Faust
You can change this now in User CP.
- Reaction score
- 123
NEVERMIND
EDIT: I fixed half the problem: C1 condition should have used filter unit, not trigger unit.
However it still lags like HELL.
I tried it with 4 units, and the lag was so heavy my pc almost blew up.
I am 100% certain that it's not the spells (I disabled them, I also disabled the special line damage attack, and still).
JASS:
scope AutoCastSystem initializer I
private struct ACS
timer clock = CreateTimer()
integer array orderid [5]
integer maxspells
unit caster
method onDestroy takes nothing returns nothing
call PauseTimer(.clock)
call ClearTimerStructA(.clock)
call DestroyTimer(.clock)
endmethod
endstruct
private function C1 takes nothing returns boolean
if GetUnitTypeId(GetTriggerUnit()) == 039;H029039; then
return true
elseif GetUnitTypeId(GetTriggerUnit()) == 039;H02B039; then
return true
endif
return false
endfunction
private function H takes nothing returns nothing
local ACS dat = GetTimerStructA(GetExpiredTimer())
local region r = CreateRegion()
local group g = CreateGroup()
local unit u
call RegionAddRect(r, bj_mapInitialPlayableArea)
if IsUnitInRegion(r, dat.caster) == false then
call dat.destroy()
endif
set udg_Player = GetOwningPlayer(dat.caster)
call GroupEnumUnitsInRange(g, GetUnitX(dat.caster), GetUnitY(dat.caster), 500, Condition(function IsUnitAnEnemy))
set u = FirstOfGroup(g)
if IssueTargetOrderById(dat.caster, dat.orderid[0], u) == false then
call BJDebugMsg("lolfalse")
if IssuePointOrderById(dat.caster, dat.orderid[1], GetUnitX(u), GetUnitY(u)) == false then
call IssueTargetOrder(dat.caster, "attack", u)
endif
endif
call RemoveRegion(r)
set r = null
call DestroyGroup(g)
set g = null
set u = null
endfunction
private function A takes nothing returns nothing
local ACS dat = ACS.create()
set dat.caster = GetTriggerUnit()
call BJDebugMsg(GetUnitName(dat.caster) + " is yay")
if GetUnitTypeId(GetTriggerUnit()) == 039;H029039; then
set dat.maxspells = 2
set dat.orderid[0] = 852600
set dat.orderid[1] = 852223
call SetTimerStructA(dat.clock, dat)
call TimerStart(dat.clock, 1.5, true, function H)
endif
endfunction
private function CC takes nothing returns boolean
return GetSpellAbilityId() == 039;Awrs039;
endfunction
//===========================================================================
private function I takes nothing returns nothing
local trigger t = CreateTrigger()
local region r = CreateRegion()
call RegionAddRect(r, bj_mapInitialPlayableArea)
call TriggerRegisterEnterRegion(t, r, Condition(function C1))
call TriggerAddAction(t, function A)
set t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function CC))
call TriggerAddAction(t, function A)
endfunction
endscope
I'm trying to create a small casting system for my map (far from being finished), and I'm testing it with a preplaced unit.
The problem is, when I set the timer frequency to 0.5 it started lagging a minute later and exiting was difficult.
Of course 1.5 is fine and I'm not going back to 0.5, but I have a problem.
To create and attach the struct to the prelaced unit I click it to use warstomp.
And that works, the unit then starts casting by itself.
However, there is a spell (the point targeted one) that uses another spell (it is triggered), which is casted by a Dummy, and, well, the message says...
Even if it has short lifespan, and if he is not on the map, his struct is removed.
The problem is, when I set the timer frequency to 0.5 it started lagging a minute later and exiting was difficult.
Of course 1.5 is fine and I'm not going back to 0.5, but I have a problem.
To create and attach the struct to the prelaced unit I click it to use warstomp.
And that works, the unit then starts casting by itself.
However, there is a spell (the point targeted one) that uses another spell (it is triggered), which is casted by a Dummy, and, well, the message says...
The dummy is not supposed to receive a struct...Dummy is yay
Even if it has short lifespan, and if he is not on the map, his struct is removed.
However it still lags like HELL.
I tried it with 4 units, and the lag was so heavy my pc almost blew up.
I am 100% certain that it's not the spells (I disabled them, I also disabled the special line damage attack, and still).