• 🏆 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!

Would this work?

Status
Not open for further replies.

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
Hey, I came across a neat idea in the jass section. They like to use libs there and I thought I could create something reminding of that but in a jass/GUI way. So my main concern here is if the real value I use for the event works fine for MUI and also if there is any kind of improvements.

note that I will use gui variables if it works as I want but I don't care about that know

based on: http://www.hiveworkshop.com/forums/jass-resources-412/snippet-getlastcastability-220717/

JASS:
function store takes nothing returns nothing
    set udg_caster = GetTriggerUnit()
    set udg_x = GetUnitX(udg_caster)
    set udg_y = GetUnitY(udg_caster)
    set udg_target = GetSpellTargetUnit()
    set udg_targetx = GetSpellTargetX()
    set udg_targety = GetSpellTargetY()
    set udg_ID = GetSpellAbilityId()
    set udg_IDevent = 1.00
    set udg_IDevent = 0.00
endfunction

function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Untitled_Trigger_001, EVENT_PLAYER_UNIT_SPELL_EFFECT )
endfunction
  • Untitled Trigger 002
    • Events
      • Game - IDevent becomes Equal to 1.00
    • Conditions
    • Actions
      • Custom script: if udg_ID == 'A000' then
      • -------- stuff here --------
      • Custom script: endif
 
Last edited:

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
@maker as said I will use GUI variables aka udg_name it's just for test


Well I thought it would be useful for any map with triggered spells, close to every spell uses a caster variable a target variable and so on this way you use less variables and less lines of code/actions. This is not to be a public resource so yeah :)
oh and yes, I use the real event because then it fire after the variables is succesfully stored so it wont bug in some way
 
Status
Not open for further replies.
Top