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

[JASS] Get Built Unit

Status
Not open for further replies.
Event response - Constructed structure.
Btw why do this thread is marked as
JASS:
?[/QUOTE]
>>Event response - Constructed structure.
Constructed structure does not work. The building was built using an ability, not a build order.

>>Btw why do this thread is marked as [code=jass]?
I am a Jass user - I do not use GUI. I want the answer in Jass since I code in Jass so I mark my thread Jass... Simple as... I don't mind GUI answers, however - I'll convert them to Jass myself.
 
Level 9
Joined
Apr 3, 2008
Messages
700
Maybe smth like

  • Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to
    • Actions
      • Unit Group - Pick every unit in (Units within 512.00 of (Position of (Triggering unit)) matching ((Unit-type of (Matching unit)) Equal to Town hall)) and do (Actions)
        • Loop - Actions
          • Set Unit=picked unit
 
Level 8
Joined
Sep 13, 2006
Messages
431
You can use either of these to reference the unit. It is, as I suspected, still being constructed, even though it's build order is initiated by an ability...

For this:
  • Events
    • Unit - A unit Begins construction
Use 'Event Response - Constructing Structure' as the ref. This will let you reference the unit when it is initially 'placed' for construction.

For this:
  • Events
    • Unit - A unit Finishes construction
Use 'Event Response - Constructed Structure' for this one to reference the unit upon its completion.

I've tested both, and they both work fine. I'll leave you to convert it to JASS, but in any case, I hope this helps you!
 
Level 9
Joined
Apr 3, 2008
Messages
700
Ehm, didn't I write about the constructed structure in the second post of this thread?...

That's one I tried already - it's not completely bugproof - there could be another within the area.
You could create a global unitgroup and check if unit is in unitgroup. If he isn't, set variable = unit and add unit to unitgroup.

You've missunderstood me in both cases xD
 
Ehm, didn't I write about the constructed structure in the second post of this thread?...


You could create a global unitgroup and check if unit is in unitgroup. If he isn't, set variable = unit and add unit to unitgroup.

You've missunderstood me in both cases xD
No, I haven't. At the beginning of the thread you said to put constructed structure in the trigger which detects the spell. That doesn't work. You need another trigger.

The Pick every unit in Group and do (Actions) doesn't work either because you don't know which unit in particular you're searching for. Yes you could search for a unit owned by the player, of the same type as the one being built, but you don't know if that unit is the one you just built or another one which was built before.

So I didn't misunderstand you. You were on the right path, but neither of those works properly. Dalaran Guard had it right. You did not.
 
Status
Not open for further replies.
Top