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!
What is the best way to detect that selected unit/object is of a certain type? For example, I want my spell to select all objects in area 300 and move the ones that have property X? (don't want to do it through Buff) Is group the only way?
I have to guess you need to mark some units as special to do something with them later? That is why you don't use game's own unit types etc?
Why not add them to a special group when they enter the map and when the spell is activated, compare distance for all units in that group. Only units within 300 area will be affected.
Pick every unit in radius -> If picked unit meets X condition -> Move picked unit
Pick every destructable in radius -> If picked destructable meets X condition -> Move picked destructable
Those are the only two objects you can really move, unless you have some custom objects you've created. In that case you could store them in an Array and enumerate over them, finding whichever ones meet your desired conditions.
For property X, storing properties can be done in may ways. I often tell GUI users to create hidden passive abilities and use them as "classifications". Then you can check the level of these abilities on the unit -> If level of Dragon Classification for (Picked unit) Equal to 1 then...
You could use a Hashtable to track a Boolean for the desired Object. If Load 0 of Handle(Object) in Hashtable Equal to True then...
Pick every unit in radius -> If picked unit meets X condition -> Move picked unit
Pick every destructable in radius -> If picked destructable meets X condition -> Move picked destructable
Those are the only two objects you can really move, unless you have some custom objects you've created. In that case you could store them in an Array and enumerate over them, finding whichever ones meet your desired conditions.
For property X, storing properties can be done in may ways. I often tell GUI users to create hidden passive abilities and use them as "classifications". Then you can check the level of these abilities on the unit -> If level of Dragon Classification for (Picked unit) Equal to 1 then...
You could use a Hashtable to track a Boolean for the desired Object. If Load 0 of Handle(Object) in Hashtable Equal to True then...
I was thinking that it might be possible to make a variable inside an instance of my choice that indicates that it is an object I want. To put into perspective, I use a misissle system. I want my spell to check all missiles in the area and then do actions only with a specific type of a missile. I know that I can add all my type to the group, but I thought there might be a better way.
Introduction to vJASS, Structs and Good JASS Technique Note: I will convert this to a tutorial for everyone, but I am teaching Flame and he needs this now. An Introduction to vJASS, Structs, and Good Programming Practice Introduction to Structs Methods Scopes Structs Structs Structs are part of...
Introduction to vJASS, Structs and Good JASS Technique Note: I will convert this to a tutorial for everyone, but I am teaching Flame and he needs this now. An Introduction to vJASS, Structs, and Good Programming Practice Introduction to Structs Methods Scopes Structs Structs Structs are part of...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.