Tacticians Ultimate
- DarkNemesis
- Retired
- Posts: 993
- Joined: November 10th, 2008, 11:33 pm
- Realm: Lordaeron (U.S. West)
- Battle.net name: Dark_Nemesis
Tacticians Ultimate
What's up with Tacticians ult? I can't seem to cast it on units. Is it a Elf thing or what?
Reaper: If you seriously think America is the best country ever you are brainwashed. Fact.
DarkNemesis: Reaper, you're an idiot.
DarkNemesis: Reaper, you're an idiot.
- DarkNemesis
- Retired
- Posts: 993
- Joined: November 10th, 2008, 11:33 pm
- Realm: Lordaeron (U.S. West)
- Battle.net name: Dark_Nemesis
Re: Tacticians Ultimate
Yes is a horrible answer.Tehw00tz wrote:Yes.
Reaper: If you seriously think America is the best country ever you are brainwashed. Fact.
DarkNemesis: Reaper, you're an idiot.
DarkNemesis: Reaper, you're an idiot.
- Tehw00tz
- Corpse
- Posts: 1520
- Joined: August 13th, 2006, 3:14 pm
- Realm: Azeroth (U.S. East)
- Battle.net name: ДɷϣRØLEɷӟP
- Location: New Orleans, ДɷϣRØLEɷӟP, ДɷϣRØLEɷӟP
Re: Tacticians Ultimate
Is no better?
It currently only works when you're on the high elves side.
It currently only works when you're on the high elves side.
ДɷϣRØLEɷӟP
- DarkNemesis
- Retired
- Posts: 993
- Joined: November 10th, 2008, 11:33 pm
- Realm: Lordaeron (U.S. West)
- Battle.net name: Dark_Nemesis
Re: Tacticians Ultimate
Thank you. That is what I wanted to know.Tehw00tz wrote:Is no better?
It currently only works when you're on the high elves side.
Btw, why is it only the Elves?
Reaper: If you seriously think America is the best country ever you are brainwashed. Fact.
DarkNemesis: Reaper, you're an idiot.
DarkNemesis: Reaper, you're an idiot.
Re: Tacticians Ultimate
Because coding the ult requires creating 12 unit types per race, and that's not something i want to do for just one ult, so instead i need to recode it.
Odds are it'll be changed to something like "Spawns a captain unit for every 3 base spawn units", so it'll spawn the same units but in addition (rather then upgrading)
DarnYak
Odds are it'll be changed to something like "Spawns a captain unit for every 3 base spawn units", so it'll spawn the same units but in addition (rather then upgrading)
DarnYak
Re: Tacticians Ultimate
Or you could add appropriate skills and stats to the units while giving a dummy aura "Promotion [Level X]"
if CasterCheck(unit) then
<Add Ability (caster ability)>
<Add Ability (caster's self-centered radius aura)>
<Add Max Health>
<Add Max Mana>
set count = count + 1
elseif RangeTypeCheck(tnit) then
<Add Ability (Range-type ability)>
<Add Ability (Range-Type's self-centered radius aura)>
<Add Max Health>
<Add Max Mana>
set count = count + 1
elseif FighterCheck(unit) then
<Add Ability (Fighter ability)>
<Add Ability (Fighter's self-centered radius aura)>
<Add Max Health>
<Add Max Mana>
set count = count + 1
endif
Doing such you'd only have to create checks for 10 units, and as for promoting them, all that'd be needed is level as a modifier without creating units.
if CasterCheck(unit) then
<Add Ability (caster ability)>
<Add Ability (caster's self-centered radius aura)>
<Add Max Health>
<Add Max Mana>
set count = count + 1
elseif RangeTypeCheck(tnit) then
<Add Ability (Range-type ability)>
<Add Ability (Range-Type's self-centered radius aura)>
<Add Max Health>
<Add Max Mana>
set count = count + 1
elseif FighterCheck(unit) then
<Add Ability (Fighter ability)>
<Add Ability (Fighter's self-centered radius aura)>
<Add Max Health>
<Add Max Mana>
set count = count + 1
endif
Doing such you'd only have to create checks for 10 units, and as for promoting them, all that'd be needed is level as a modifier without creating units.
- Discombobulator
- Retired
- Posts: 710
- Joined: September 19th, 2006, 4:16 pm
- Battle.net name: Karunecm
- Contact:
Re: Tacticians Ultimate
Shoy up and die.Perhaps wrote:Or you could add appropriate skills and stats to the units while giving a dummy aura "Promotion [Level X]"
if CasterCheck(unit) then
<Add Ability (caster ability)>
<Add Ability (caster's self-centered radius aura)>
<Add Max Health>
<Add Max Mana>
set count = count + 1
elseif RangeTypeCheck(tnit) then
<Add Ability (Range-type ability)>
<Add Ability (Range-Type's self-centered radius aura)>
<Add Max Health>
<Add Max Mana>
set count = count + 1
elseif FighterCheck(unit) then
<Add Ability (Fighter ability)>
<Add Ability (Fighter's self-centered radius aura)>
<Add Max Health>
<Add Max Mana>
set count = count + 1
endif
Doing such you'd only have to create checks for 10 units, and as for promoting them, all that'd be needed is level as a modifier without creating units.
I'm this forum's MVP.
Re: Tacticians Ultimate
The problem with that is units don't seem to use abilities added to them (thus why abberration has got issues). So you end up having to give units their own mini ai, which isn't really acceptable.
DarnYak
DarnYak
-
- Addict
- Posts: 365
- Joined: August 19th, 2006, 8:53 pm
Re: Tacticians Ultimate
Yak, just out of curiosity, why wouldn't you use a "On Unit Attack. . ." event, with conditions "If unit has buff Aberration" and "lvl of Aberration >= X", then just have it cast the spell on its target? Maybe increase the cooldown of Aberration to reduce the overall number of calls to the function, to balance out the increase in (traffic? memory usage?) when that happens.
. . .Longest question ever. Why wouldn't you do that stuff above?
. . .Longest question ever. Why wouldn't you do that stuff above?
"L4D2 promises to set a new benchmark for co-op games. . ." Like L4D promised to hand us new maps, survivors, and zombies? We've seen how that works.
Re: Tacticians Ultimate
There's no on attack, only on attacked/damaged. And that's effectively what i did, when a unit's attakced it'll randomly use its abilities. It doesn't seem to be terribly effective though (not sure why).CryptLord1234 wrote:Yak, just out of curiosity, why wouldn't you use a "On Unit Attack. . ." event, with conditions "If unit has buff Aberration" and "lvl of Aberration >= X", then just have it cast the spell on its target? Maybe increase the cooldown of Aberration to reduce the overall number of calls to the function, to balance out the increase in (traffic? memory usage?) when that happens.
DarnYak
-
- Addict
- Posts: 365
- Joined: August 19th, 2006, 8:53 pm
Re: Tacticians Ultimate
Ah, I was gonna say, "Then what's ____ function for?" when I realized. . .There IS no unit attacks function. Bugger.
"L4D2 promises to set a new benchmark for co-op games. . ." Like L4D promised to hand us new maps, survivors, and zombies? We've seen how that works.
- DarkNemesis
- Retired
- Posts: 993
- Joined: November 10th, 2008, 11:33 pm
- Realm: Lordaeron (U.S. West)
- Battle.net name: Dark_Nemesis
Re: Tacticians Ultimate
[Reaper] - Portion removed
Btw, glad to see your back Perhaps! Glad the trolls didn't let you down.
Btw, glad to see your back Perhaps! Glad the trolls didn't let you down.
Reaper: If you seriously think America is the best country ever you are brainwashed. Fact.
DarkNemesis: Reaper, you're an idiot.
DarkNemesis: Reaper, you're an idiot.
Re: Tacticians Ultimate
That's because there is no need for one because Unit Attacked and Unit Attacking are the same damn thing with the exceptions of "Unit attacking destructible" or "unit attacking destructible," which aren't aren't concerns in this case. Unit being attacked has all the data you need for "Unit attacking." TriggerUnit (Attacked unit), Attacking unit (unit attacking attacked unit), Triggering Player (player of attacked unit) and well I suppose the Attacking unit's player is excluded in which case you can just get the owning player of the attacking unit.CryptLord1234 wrote:Ah, I was gonna say, "Then what's ____ function for?" when I realized. . .There IS no unit attacks function. Bugger.
Code: Select all
unction PlayerColor takes integer PID returns string
if PID == 0 then
return "|cFFFF0000"
elseif PID == 1 then
return "|cFF0000FF"
elseif PID == 2 then
return "|cFF00FFFF"
elseif PID == 3 then
return "|cFFFF00FF"
elseif PID == 4 then
return "|cFFFFFF00"
elseif PID == 5 then
return "|cFFFF1500"
elseif PID == 6 then
return "|cFF00FF00"
elseif PID == 7 then
return "|cFFFF5088"
elseif PID == 8 then
return "|cFFD5D5D5"
elseif PID == 9 then
return "|cFFA5D5FF"
elseif PID == 10 then
return "|cFF00D500"
elseif PID == 11 then
return "|cFF905510"
endif
return "|cFFFFFFFF"
endfunction
function GetTextRandom takes unit Attacker returns string
local integer PID = GetPlayerId(GetOwningPlayer(Attacker))
local string colortag = PlayerColor(PID)
local string closetag = "|r"
local integer random = GetRandomInt( 1, 100 )
if random < 25 then
return colortag+"En Garde!"+closetag
elseif random < 50 then
return colortag+"watashi wa shine! SHINENZU!"+closetag
elseif random < 75 then
return colortag+"Do you feel lucky? Punk!"+closetag
endif
return null
endfunction
function Trig_Unit_Attacks_Actions takes nothing returns nothing
local unit Attacker = GetAttacker()
local string s = GetTextRandom(Attacker)
local texttag tag = CreateTextTagUnitBJ( s, Attacker, 20.00, 10, 100, 100, 100, 0 )
if ( not ( s == null ) ) then
call PolledWait(1.2)
endif
call DestroyTextTag(tag)
endfunction
//===========================================================================
function InitTrig_Unit_Attacks takes nothing returns nothing
set gg_trg_Unit_Attacks = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Unit_Attacks, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddAction( gg_trg_Unit_Attacks, function Trig_Unit_Attacks_Actions )
endfunction
-
- Addict
- Posts: 365
- Joined: August 19th, 2006, 8:53 pm
Re: Tacticians Ultimate
Yeah, I noticed that function and wondered if there was a GUI equivalent.
"L4D2 promises to set a new benchmark for co-op games. . ." Like L4D promised to hand us new maps, survivors, and zombies? We've seen how that works.
Re: Tacticians Ultimate
Code: Select all
Unit Attacks GUI
Events
Unit - A unit Is attacked
Conditions
Actions
Floating Text - Create floating text that reads En Garde above (Attacking unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Vexorian's Introduction to Jass Guide
Re: Tacticians Ultimate
That's not entirely accurate. If you're tying triggers to specific units to minimize cpu time, unit attacked has to run for every single attack done to find if that unit attacked another, whereas unit attacked could only run for that one specific attack. For EotA, this is a LOT of attacks running non stop with as many spawnies as there are.That's because there is no need for one because Unit Attacked and Unit Attacking are the same damn thing
Admittedly, I don't know how they do the actualy events internally, so it's quite possible it wastes nearly as much cpu as its currently implimented, although at least it doesn't need to jump into jass interpretation which makes it inheriently significantly faster.
DarnYak
Re: Tacticians Ultimate
Think of it this way, when a unit is attacked a unit has attacked, it's a one to one thing no matter what angle you go at it except for the already said exceptions of a unit attacking a non-unit such as an item or a destructible which in an AoE is probably not needed. As for unit specific, if I'm right you can't change the units for those right?
Re: Tacticians Ultimate
Um, yes and no. Lets put it this way, rough combat "log"it's a one to one thing no matter what angle you go at it
Footman1 attacks Hero1
Footman2 attacks Hero1
Ghoul1 attacks Hero2
Footman1 attacks Hero1
Ghoul1 attacks Hero2
Hero1 attacks Hero2
Hero2 attacks Hero1
For "a unit is attacked", the trigger will be executed 7 times. If you could instead tie it to "Hero1 attacks", it would only be executed once. Sure, 6 of the 7 get resolved fast because the first thing it does will be "Is Attacking Unit equal to Hero1?", but it still has to setup an event frame and run it.
EotA usualy has around 200 units constantly invovled in combat, with average attack speeds somewhere between 1.5 and 2.0 seconds each, so you can expect to have to run it around 100-130ish times per second. On top of that, that's only assuming one ability you need to check against. If Hero2 also has an "on unit attacks" required ability, the needed checks double.
Even if blizz internally had to do the same checks, it wouldn't be done through the interpreted language, and wouldn't require spawning event frames to run the interpreted code, so would inheriently run magnitudes faster. Implimenting it through "unit is attacked" in EotA would certainly increase lag, although i'm not sure to what magnitude.
And just fyi, the actual event we're talking about is probably "Unit is damaged",
DarnYak
Re: Tacticians Ultimate
If I'm understanding you right, not short of destroying and recreating the trigger.
DarnYak
DarnYak
Re: Tacticians Ultimate
Most of them should be (specificly for filters, i assume you mean?)
There's some legacy code that leaks, but most of it runs infrequently (if more then once), so all answers like this will be "most" ;P
DarnYak
There's some legacy code that leaks, but most of it runs infrequently (if more then once), so all answers like this will be "most" ;P
DarnYak
Re: Tacticians Ultimate
Yes, filter<widget> or in Jass boolexpr for the variable datatype. Along with timers it's apparently one of the most notorious memory leaks. Though from playing, they actually seem easy to prevent leaking as most objects seem to be.
Anyways, I'm not big on the captain idea, but that's just me. Have you tried going to TheHelp or Wc3Campaign forums and asking how to get units to effectively use abilities that are added to them?
Code: Select all
local <type> <var> = Create<object>< variant >(arguments)
call <Destroy/Remove><Type>(<var>)
Re: Tacticians Ultimate
Oh yeah. Since you're using the frowned upon dynamic triggers anyways. Have you considered, when a hero acquires a target, smart clicks, or attack orders an enemy unit, create a trigger with "unit is damaged/attacked" event, then destroy the trigger when the hero no longer is to attack the unit, or that unit dies? It'd still require that you check for every time that unit gets hit that the hero is hitting, but it's only one unit a time to be checked. >_>