View Single Post
Old 01-22-2010, 09:09 PM   #10
Michael Peppers
Lepus?
 
Michael Peppers's Avatar
 
Join Date: Jan 2009
Posts: 1,308

Michael Peppers is a jewel in the rough (188)Michael Peppers is a jewel in the rough (188)Michael Peppers is a jewel in the rough (188)

Default

Quote:
Originally Posted by Sunwarrior25
DestCheck and UnitCheck are currently both GUI triggers with a debug message. I'll expand them later to have the loops/arrays and stuff that determine what messages/events the player gets by clicking on this or that unit. (Checking first for specific units/destructibles, and then for unit/destructible-type if the 'Interact' ability isn't used on any specific unit (and maybe finishing it off with a "..." message to the player if I forgot to add a unit/destructible-type to the list.))
Both of these GUI triggers are initially off.
Trigger:
Collapse DestCheck
Events
Conditions
Collapse Actions
Game - Display to (All players) the text: You are interacting...
Collapse UnitCheck
Events
Conditions
Collapse Actions
Game - Display to (All players) the text: You are talking to ...

Ah, ok
Quote:
Originally Posted by Sunwarrior25
EDIT: Like this? Attachment 47612
Uhm... may bad, uncheck debris, check decoration, but maybe destructible interaction is simply hardcoded in some skills, gotta test.
Quote:
Originally Posted by Sunwarrior25
Collapse JASS:
function Trig_Interact_Conditions takes nothing returns boolean
    return (GetSpellAbilityId() == 'A600')
endfunction

function Trig_Interact_Actions takes nothing returns nothing

if GetSpellTargetDestructable() != null then
        set udg_CheckDest = GetSpellTargetDestructable()
        call ConditionalTriggerExecute( gg_trg_DestCheck )

    elseif GetSpellTargetUnit() != null then
        set udg_CheckUnit = GetSpellTargetUnit()
        call ConditionalTriggerExecute( gg_trg_UnitCheck )

    endif

endfunction

//===========================================================================
function InitTrig_Interact takes nothing returns nothing
    set gg_trg_Interact = CreateTrigger(  )
    call TriggerRegisterPlayerUnitEventSimple( gg_trg_Interact, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Interact, Condition( function Trig_Interact_Conditions ) )
    call TriggerAddAction( gg_trg_Interact, function Trig_Interact_Actions )
endfunction
Fine, also use TriggerExecute() instead of ConditionalTriggerExecute(), it's faster... well, unless you need conditions later on
__________________
Projects:Tutorials: Competitive AI Step by Step with AI Editor (Pending)
Resources: [AI Script] Michael Peppers's Melee AI template (Pending)
Michael Peppers is offline   Reply With Quote