• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

How to order unit to reveal a point?

Status
Not open for further replies.
Level 11
Joined
Dec 8, 2006
Messages
334
Hi, I have a unit with ability based on Reveal
I want to order the unit to use it via triggers
How would I go about doing something like that?
I tried this:
JASS:
call IssuePointOrderLocBJ( unit_u, "neutraldetectaoe", Location_l )
But it doesn't seem to work :|
 
Level 11
Joined
Dec 8, 2006
Messages
334
Generally, you are not encouraged to use locations.

Good to know, thanks (why?)
Also, the line you posted still doesn't work for some reason :O
can anyone help?

JASS:
call IssuePointOrderLocBJ( unit_u, "neutraldetectaoe", Location_l )
are you sure that the orderstring is "neutraldetectaoe"?
you probably will have to do it like Pharaoh_'s way by using orderid.

Kinda, it left me confused, because neutral buildings reveal returns "neutraldetectaoe", and humans reveal doesn't return anything :|
 
This code works for me:
JASS:
function Spell_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'AHbn'
endfunction

function Spell_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local real x = GetUnitX(u)
    local real y = GetUnitY(u)
    local unit dummy = CreateUnit (GetOwningPlayer(u), 'h000', x, y, 0.)
    call UnitAddAbility (dummy, 'A000')
    call IssuePointOrderById (dummy, 852270, x, y)
    call UnitApplyTimedLife (dummy, 'BTLF', 2.)
    set u = null
    set dummy = null
endfunction

//===========================================================================
function InitTrig_Spell takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ (t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition (t, Condition(function Spell_Conditions))
    call TriggerAddAction (t, function Spell_Actions)
endfunction

Proof map here:
View attachment Reveal Cast.w3x
 
Level 11
Joined
Dec 8, 2006
Messages
334
Lul
Thanks for finding the time for making that map, it works now that I copy'n'pasted it from there :S
No idea what could be the problem before, probably syntax lulz of some kind.
edit: AH Yes I know, there's a difference between neutral Reveal, and human Reveal
That must be the case

+rep

edit: eh, it wont allow me to rep you for some reason o_O
(You must spread some Reputation around before giving it to Pharaoh_ again)
 
Level 11
Joined
Dec 8, 2006
Messages
334
Tried already, still don't see it tho :\

rawdata.jpg

(I cropped the image due to filesize, but the spell I have selected is Reveal)
 
Oh I am so sorry. You meant 852270? Well, I misunderstood.
Use this in your map and memorize the ID of the spell; then, go and use it wherever you want.
  • Tr
  • Events
    • Unit - A unit is issued an order with no target
    • Unit - A unit is issued an order targeting an object
    • Unit - A unit is issued an order targeting a point
  • Conditions
  • Actions
    • Custom script: local integer i = GetIssuedOrderId()
    • Custom script: call BJDebugMsg (I2S(i))
 
Status
Not open for further replies.
Top