Warcraft III resources & community, 2003–2006 · archived

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

9 posts
#1

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

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?
#2
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 -.=
#3

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
#4

Re: thanks

taurenwarriorthats 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:
#5

Sorry

yeah I guess it is, basically all I want to know is if I can use variables in an event, e.g. variable 'unit' dies.

or do I have to stick with prelaced and generic events?
#6
No, you can't. Use "Generic Event" for this and refer to it via condition (unit comparison), as said above.
#7

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.
#8
Hm, dunno atm, but I think this time you need to put it "triggering unit" b/c there doesn't exist a specific comparison for this (like "training unit" or else).
#9
hmmm... triggering unit? I don't know it would make my life a lot easier, if it was I'll check it out.