• 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.

I NEED HELP WITH UNIT VARIABLES AND SELECTING A BUILDING!!!!

Status
Not open for further replies.
Level 11
Joined
Aug 15, 2004
Messages
710
If I (using a action) set the value of a unit variable to a building, how do I select that building in another trigger, for example if a use a specific unit event and try and use that unit variable alla that comes up are pre-placed units. I tried usuing 'a unit finishes training a unit' event but that only lets me slect the trained unit how do I manipulate the building if it is not preplaced and how do I manipulate only units that that building produces?
 

Rad

Rad

Level 5
Joined
Sep 11, 2004
Messages
163
dude that makes like no sense make it simpler... the way i see it u need it so when u add a unit (building) to a variable how do u select if (if it was created/spawned and not pre-placed)

event- Unit finishes construction

conditions...

action-
Add (constrcted structure) to [unit group variable] or if u want just a unit variable...
Set [unit variable] = (constructed structure)

when using another trigger to use that unit when u choose to pick a unit... instead of going to (select unit) select the variable in the white box...

if that wasnt what u wanted be more specific... we arent the one in the situation so its pretty confusing saying things when you dont say them in order -.=
 
Level 11
Joined
Aug 15, 2004
Messages
710
thanks

thats not exactly what I was meaning I mean, that if I cast an ability on a building how do I select the units it trains only and only when it trains them and not when the ability is cast. I guess I was a bit unclear, but I think I found the solution, i'll check it out
 

Rad

Rad

Level 5
Joined
Sep 11, 2004
Messages
163
Re: thanks

taurenwarrior said:
thats not exactly what I was meaning I mean, that if I cast an ability on a building how do I select the units it trains only and only when it trains them and not when the ability is cast. I guess I was a bit unclear, but I think I found the solution, i'll check it out

its still unclear... u mean like casting unit upgrade ability on a barracks to have it make super footmen or something?...

anyway just make it

Event-
Unit finishes casting an ability

Conditions-
Casting unit equal to (the caster)
_Targeted unit equal to building_ (not sure what condition that would be)

Actions- Add (_targeted unit_) to (effected building [unit group] variable)

that will make it so u can use other triggers using the units effected by the ability casted on the building... or something,

example:

Event:
Unit finished training

Conditions:
_training unit (??? again)_ equal to (unit in (effected building...group))

Actions:
Do whatever u want to the units here

this is all off my head so u gotta look for the _blanks_ :wink:
 
Level 11
Joined
Aug 15, 2004
Messages
710
thanks

okay, but how do I refer to the unit that trains the unit
event
e.g. a unit finishes training a unit

condition
------ is equal to 'variable' (unit comparison)

so what do I fill in to refer to the unit that finishes training the unit, or can somebody teach me a jass script that'll do that for me.
 
Status
Not open for further replies.
Top