I'm currently having a problem on how to use the data markers. I'll first explain what I want to do so you may understand easily :
I have a unit which has two spells : "Create a mine" and "Explode mine". When my unit creates a mine at a location, it can't create a mine anymore, and the "Explode mine" button becomes active. Well, when I press the button, it should make the mine created by this unit explode.
When I use "Explode mine", it'll search in a huge area all the mines, but how to know that the mines found have been created by the caster ?
I don't know how to link the mine to it's creator. I guess I should use markers, but after a lot of searches, I didn't find so much interesting stuff. Do you guys know how I could do ?
The only solution I've seen for this is script-based and kind of clunky at that. It involves using a data table to simulate a dynamic array and adding each mine to its own spot in the table, then recalling it ie: "Mine_" + ToString(1) etc
If there was an easy way to do this via Data, I and I'm sure many others would be very interested to hear it.
Here's a demo I put together. When a mine is placed, a behavior is added to the unit placing the mine. When the mine is detonated, the behavior is removed. This method might not be expandable to more than a single mine per unit. At least I don't know how.
Hey,
I'm currently having a problem on how to use the data markers. I'll first explain what I want to do so you may understand easily :
I have a unit which has two spells : "Create a mine" and "Explode mine". When my unit creates a mine at a location, it can't create a mine anymore, and the "Explode mine" button becomes active. Well, when I press the button, it should make the mine created by this unit explode.
When I use "Explode mine", it'll search in a huge area all the mines, but how to know that the mines found have been created by the caster ?
I don't know how to link the mine to it's creator. I guess I should use markers, but after a lot of searches, I didn't find so much interesting stuff. Do you guys know how I could do ?
Thanks alot for any answers. :)
Romm'
@Rommsteinz: Go
The only solution I've seen for this is script-based and kind of clunky at that. It involves using a data table to simulate a dynamic array and adding each mine to its own spot in the table, then recalling it ie: "Mine_" + ToString(1) etc
If there was an easy way to do this via Data, I and I'm sure many others would be very interested to hear it.
yeah i definitely would
@Chiquihuite: Go
Ok thanks a lot.
Yeah !
You could use requirements for this task.
Here's a demo I put together. When a mine is placed, a behavior is added to the unit placing the mine. When the mine is detonated, the behavior is removed. This method might not be expandable to more than a single mine per unit. At least I don't know how.
Hey !
Thanks alot, that's exactly what I wanted. <3
And by the way, it's possible to have several mines per unit, just test it. ;)