[Trigger] Tree/Selectable in Game Function Via Trigger

Status
Not open for further replies.
Level 2
Joined
May 1, 2016
Messages
7
I'm working on a item based skill that allows the player to gather wood, but i want to be able to hide the the Art - SelectAble In Game Feature when the player isn't holding the Item(Axe)
And I was wondering if you need to make it a custom script or vJass for this, or even a means to change that

Trigger so far is this, looking up scripts and codes to even see what

Unit - A unit Acquires an Item

Item-type of Item being Manipulated equal to (Axe)

Pick Every Destructible in Playable Map Area and do (action)
If (Destructible-type of (Picked Destructible)) equal to Summer Tree Wall
Then
Now Call or Change --> All Picked Destructible, Art - Selectable In Game (True)
to be able to select any Tree in game,
Else
Do Nothing

Is this even possible?
 
Level 42
Joined
Feb 27, 2007
Messages
5,273
Afaik no you can't change their seletability via triggers; no object data can be edited at run-time. Single player or multiplayer map? The only solution I see is to have 2 versions of the trees in the Object Editor and use a trigger to either replace them all or hide the right ones whenever the right unit picks up or puts down an axe.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
@Pyrogasm

Hmmmm.... How about giving the harvest ability to the item?
Or replacing the hero when they acquire an axe with one that can interact with trees ?

Tbh, I am not 100% sure what OP needs with this as trees are not selectable in any way... They can be interacted (flashing yellow) but not selectable.
By OPs description, can trees be made into selectable destructible, like rocks or gates?

 
Level 2
Joined
May 1, 2016
Messages
7
Sorry for the late response,
@Pyrogasm
its a single player game, so i did a region based pick system after obtaining item to minimize lag issues, now the problem becomes detecting size/variation of the tree with is version of it, but it simple fix with time and creating more different types of trees to able to be selective.
@ nedio95
I need a item as it is hero base, vs resources, for what I'm making. And Under Object Editor/Destructibles/Ashenvale Tree Wall Art - Selectable In Game (True) you can make and allow players to be able to interact with tree's like rocks and gates and so on.

In the long run making a simple Gathering wood Profession,

Thx you for the idea Pyrogasm, back to work on what i'm making.

Now to make a Seed System/Detect Damage Taken from trees
 
Level 42
Joined
Feb 27, 2007
Messages
5,273
Did you try putting the ghoul harvest ability on to an item as Ned suggested? If that works it's a very elegant solution.

Here's another potential fix: when the unit picks up or puts down the axe item, Chaos morph or Raven Form morph it into a nearly identical unit that has the ghoul harvest ability. Morph back when they drop the item. Maybe you can just add the harvest ability to the unit when it picks up the axe and remove when it drops but I think harvesting bugs out when you do that.

Why specifically do you want them to only be selectable when the axe is equipped? Are you using the selection UI to display information about the tree? If you just need to stop them from being attacked and destroyed easily if they're selectable, you can prevent units from being able to attack them with triggers.
 
Status
Not open for further replies.
Top