Tacticians Ultimate

Report bugs.
Message
Author
User avatar
DarkNemesis
Retired
Retired
Posts: 993
Joined: November 10th, 2008, 11:33 pm
Realm: Lordaeron (U.S. West)
Battle.net name: Dark_Nemesis

Tacticians Ultimate

#1 Post by DarkNemesis »

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.

User avatar
Tehw00tz
Corpse
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

#2 Post by Tehw00tz »

Yes.
ДɷϣRØLEɷӟP

User avatar
DarkNemesis
Retired
Retired
Posts: 993
Joined: November 10th, 2008, 11:33 pm
Realm: Lordaeron (U.S. West)
Battle.net name: Dark_Nemesis

Re: Tacticians Ultimate

#3 Post by DarkNemesis »

Tehw00tz wrote:Yes.
Yes is a horrible answer.
Reaper: If you seriously think America is the best country ever you are brainwashed. Fact.
DarkNemesis: Reaper, you're an idiot.

User avatar
Tehw00tz
Corpse
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

#4 Post by Tehw00tz »

Is no better?


It currently only works when you're on the high elves side.
ДɷϣRØLEɷӟP

User avatar
DarkNemesis
Retired
Retired
Posts: 993
Joined: November 10th, 2008, 11:33 pm
Realm: Lordaeron (U.S. West)
Battle.net name: Dark_Nemesis

Re: Tacticians Ultimate

#5 Post by DarkNemesis »

Tehw00tz wrote:Is no better?


It currently only works when you're on the high elves side.
Thank you. That is what I wanted to know.

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.

User avatar
DarnYak
Site Admin
Site Admin
Posts: 2364
Joined: August 12th, 2006, 2:54 pm

Re: Tacticians Ultimate

#6 Post by DarnYak »

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

User avatar
Perhaps
Retired
Retired
Posts: 811
Joined: September 14th, 2007, 1:24 am
Contact:

Re: Tacticians Ultimate

#7 Post by Perhaps »

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.
Image

User avatar
Discombobulator
Retired
Retired
Posts: 710
Joined: September 19th, 2006, 4:16 pm
Battle.net name: Karunecm
Contact:

Re: Tacticians Ultimate

#8 Post by Discombobulator »

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.
Shoy up and die.
I'm this forum's MVP.

User avatar
DarnYak
Site Admin
Site Admin
Posts: 2364
Joined: August 12th, 2006, 2:54 pm

Re: Tacticians Ultimate

#9 Post by DarnYak »

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

CryptLord1234
Addict
Addict
Posts: 365
Joined: August 19th, 2006, 8:53 pm

Re: Tacticians Ultimate

#10 Post by CryptLord1234 »

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?
"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.

User avatar
DarnYak
Site Admin
Site Admin
Posts: 2364
Joined: August 12th, 2006, 2:54 pm

Re: Tacticians Ultimate

#11 Post by DarnYak »

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.
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).

DarnYak

CryptLord1234
Addict
Addict
Posts: 365
Joined: August 19th, 2006, 8:53 pm

Re: Tacticians Ultimate

#12 Post by CryptLord1234 »

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.

User avatar
DarkNemesis
Retired
Retired
Posts: 993
Joined: November 10th, 2008, 11:33 pm
Realm: Lordaeron (U.S. West)
Battle.net name: Dark_Nemesis

Re: Tacticians Ultimate

#13 Post by DarkNemesis »

[Reaper] - Portion removed

Btw, glad to see your back Perhaps! Glad the trolls didn't let you down. :D
Reaper: If you seriously think America is the best country ever you are brainwashed. Fact.
DarkNemesis: Reaper, you're an idiot.

User avatar
Perhaps
Retired
Retired
Posts: 811
Joined: September 14th, 2007, 1:24 am
Contact:

Re: Tacticians Ultimate

#14 Post by Perhaps »

CryptLord1234 wrote:Ah, I was gonna say, "Then what's ____ function for?" when I realized. . .There IS no unit attacks function. Bugger.
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.

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
You'll notice GetAttacker()
Image

CryptLord1234
Addict
Addict
Posts: 365
Joined: August 19th, 2006, 8:53 pm

Re: Tacticians Ultimate

#15 Post by CryptLord1234 »

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.

User avatar
Perhaps
Retired
Retired
Posts: 811
Joined: September 14th, 2007, 1:24 am
Contact:

Re: Tacticians Ultimate

#16 Post by Perhaps »

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
For GUI it can be found in the unit data type functions as "Event Response - Attacking Unit". Something I must imput that you've probably heard to a tiring extent; just forget GUI and learn Jass. It can be a pain to first learn it, but it's much nicer than GUI simply because of local variables and user defined functions. Multi-Instability is already hard enough for certain things even with user defined functions and local variables let alone in GUI without those things. Vexorian has a really good guide for learning Jass basics, but if that doesn't work, I suppose I could help, after all it's good practice for myself.

Vexorian's Introduction to Jass Guide
Image

User avatar
DarnYak
Site Admin
Site Admin
Posts: 2364
Joined: August 12th, 2006, 2:54 pm

Re: Tacticians Ultimate

#17 Post by DarnYak »

That's because there is no need for one because Unit Attacked and Unit Attacking are the same damn thing
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.

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

User avatar
Perhaps
Retired
Retired
Posts: 811
Joined: September 14th, 2007, 1:24 am
Contact:

Re: Tacticians Ultimate

#18 Post by Perhaps »

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?
Image

User avatar
DarnYak
Site Admin
Site Admin
Posts: 2364
Joined: August 12th, 2006, 2:54 pm

Re: Tacticians Ultimate

#19 Post by DarnYak »

it's a one to one thing no matter what angle you go at it
Um, yes and no. Lets put it this way, rough combat "log"

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

User avatar
Perhaps
Retired
Retired
Posts: 811
Joined: September 14th, 2007, 1:24 am
Contact:

Re: Tacticians Ultimate

#20 Post by Perhaps »

You never answered the only one unit for an event part. >_>
Image

User avatar
DarnYak
Site Admin
Site Admin
Posts: 2364
Joined: August 12th, 2006, 2:54 pm

Re: Tacticians Ultimate

#21 Post by DarnYak »

If I'm understanding you right, not short of destroying and recreating the trigger.

DarnYak

User avatar
Perhaps
Retired
Retired
Posts: 811
Joined: September 14th, 2007, 1:24 am
Contact:

Re: Tacticians Ultimate

#22 Post by Perhaps »

Slightly off topic, do you make sure to destroy boolean expressions?
Image

User avatar
DarnYak
Site Admin
Site Admin
Posts: 2364
Joined: August 12th, 2006, 2:54 pm

Re: Tacticians Ultimate

#23 Post by DarnYak »

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

User avatar
Perhaps
Retired
Retired
Posts: 811
Joined: September 14th, 2007, 1:24 am
Contact:

Re: Tacticians Ultimate

#24 Post by Perhaps »

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.

Code: Select all

local <type> <var> = Create<object>< variant >(arguments)

call <Destroy/Remove><Type>(<var>)
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?
Image

User avatar
Perhaps
Retired
Retired
Posts: 811
Joined: September 14th, 2007, 1:24 am
Contact:

Re: Tacticians Ultimate

#25 Post by Perhaps »

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. >_>
Image

Post Reply