• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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 :|
 
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
 
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)
 
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.
Back
Top