• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

LineAimer

Introduction

LineAimer is a System for Warcraft 3 V1.32 (Reforged). It provides additional informations to players when using some abilities.​
This is done by showing a hitzone and tinting targets while one selects a target for a direction based line dmg ability like Shockwave, Impale or Breath of Fire. The Hitzone and tinting only affects the player selecting the target, other players will not see it. Like one would expect it from a precast helper.​

How To Install

Find out the vm mode used in your map. Scenario - Map options - Bottom Part jass or Lua​
Copy "LineAimer Lua" or "LineAimer vjass" inside Trigger Editor into your Map​
Copy LightningData.slk found in the LineAimer Map's Asset manage into your map or, if your map already has a custom Splats/LightningData.Slk copy the "LAIM" row​
Register your Shockwaves into LineAimer.​

API

After your installed LineAimer into your Map you have to register the abilities benefiting from it.​
Lua:
function LineAimerRegister(spellCode, orderString[, hitEnemy, hitAlly])
    unmentioned hitEnemy, hitAlly results into -> true, false
JASS:
function LineAimerRegister(spellCode, orderString[, hitEnemy, hitAlly])

function LineAimerRegisterEx takes integer spellCode, string orderString returns nothing
//    wrapper for hitEnemy true, hitAlly false

Example

This is one of the in the demo included examples. It registers the ability 'AOs2' as "shockwave"​
LineAimerRegister('AOs2', "shockwave")
LineAimerRegister('ANbf', "breathoffire")
For easier usage the vjass version contains LineAimerRegisterEx which only tints enemies, as normal shockwave only affect enemies.​
call LineAimerRegisterEx('AUcs', "carrionswarm")
call LineAimerRegisterEx('ACmp', "impale")
Previews
Contents

LineAimer (Map)

Level 3
Joined
Nov 18, 2014
Messages
8
That's awesome !
Will be really great to see what can be done with those spells :thumbs_up:

Some ideas to explore this even further:

Extend to destructible

Some spells would destroy trees etc., so it would be great to know what you're hitting

Open to custom spells

One might want to have a aimer system for custom spells (maybe something like a shockwave which would go forward and backward).
From what I see, that would mean that someone could give your newaimTrigger a data object, containing AoeStart, AoeEnd, etc. but also adding a list of angles that would allow the mapper to create a spell that shoot in multiple directions.

Adapt when targeting out of range

This one is tricky, and I honestly don't know if something that would not end up really weird could be done.
When using your test map, I targeted a unit that was out of range, which means the caster had to move on order to cast. Thus the LineAimer doesn't show the unit that will be affected.

I think the simple way is to change the line color when target is out of range, which will warn the user that the caster will move.
Or we could go for the hard way :grin:
Something like a preview, which would show the caster position and the range/targets affected from here.
I don't know if I explained well, so you'll find a picture attached :wink: (Yellow is what we got now, red would be the "preview")



I hope I didn't scared you away with those ideas :cute:

English isn't my native language, so I might not explain well. Feel free to ask for any clarifications
 

Attachments

  • LineAimer - preview.png
    LineAimer - preview.png
    2.1 MB · Views: 65
vJASS:
    function isInTargetingMode takes nothing returns boolean
        local integer index = 0
        loop
            if BlzFrameIsVisible(BlzGetOriginFrame(ORIGIN_FRAME_COMMAND_BUTTON, index)) then
                exitwhen true
            endif
                set index = index + 1
            exitwhen index == 12 // when 12 is reached no button is visible
        endloop
        return index == 11 //when the loop broke in index == 11 its targeting mode

    endfunction
I'm not sure I understand this. So when you reach index == 12, that means the code has looped through all 12 frames on the command card (ORIGIN_FRAME_COMMAND_BUTTON 0 to 11) and found all of them to be hidden? Does ORIGIN_FRAME_COMMAND_BUTTON 11 stay visible during targetting or something?
 
I'm not sure I understand this. So when you reach index == 12, that means the code has looped through all 12 frames on the command card (ORIGIN_FRAME_COMMAND_BUTTON 0 to 11) and found all of them to be hidden? Does ORIGIN_FRAME_COMMAND_BUTTON 11 stay visible during targetting or something?
They are only visible when the command card uses the slot. During Targeting only the cancel command is used normaly the last button, which is index 11. This assumes one did not change the cancel position.
When it reaches 12 no button is used by the command card.
 
They are only visible when the command card uses the slot. During Targeting only the cancel command is used normaly the last button, which is index 11. This assumes one did not change the cancel position.
When it reaches 12 no button is used by the command card.
Ooh, so you check for the cancel button. Smart. I wonder if I could use this technique for detecting when selecting which building to build from the command card.

Also, why not detect the cancel button after a mouse click event instead of constantly?
 
Last edited:
Top