I'm trying to get a queen creates tumor when ever its possible, but with a region stuck to it wich check if there's is already a tumor in it.
The queen moving to random direction except when it leaves the creep, in wich case she's go back in the direction of the hive.
The first part works fine, the queen, move and create tumor when it got 20 energy, but for a reason that I ignore, it sometimes create tumor near a previous one.
My region is big enough I think (8.0), but it doesn't seems to detect the presence of the tumor.
This is my script, hope someone can help me to figure out what's going wrong.
But yeah for data you would use an if then kind of an effect
you have a behavior on the queen that runs an effect
this effect runs a search effect for a tumor in a given range and if there is not tumor in range then you create a new tumor at the position of the queen if there is a tumor in range do nothing
Im not very good with using condition effects. Im more of a trigger kinda guy. but I really think you should give it a try.
And heres how I would do it with a trigger
Events
Timer - Periodic 1 second
Conditions
Actions
Pick each Unit in unit group Unit Group(convert Units(of type "Queen") any ammount in region (playable map area) matching conditions
If
Conditions
(Num units in Unit Group(convert Units(of type "tumor") any ammount in region (convert Point to region( position of picked Unit radius of "5") matching conditions) < 1)
Then
create tumor at position of picked unit for owner of (picked unit)
Logic of Trigger
Runs every second
Loops through all Queens on map
checks to see if there are any tumors with in a radius of 5 from the queen (youll notice Im not using regions but a point convert to region method) You will also notice that im using this as a conditions ... so its number of units of that type in the vacinity of the queen its checking
if it finds less then 1 of the matching units it will spawn a tumor at the position of the queen
I use pure GUI.... script is more or less a waste of time...
Thank you again, it's seems interesting to use the radius instead of using the region, I can't test it for the moment but I'll try that soon and give you a feedback.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hello everyone,
I'm trying to get a queen creates tumor when ever its possible, but with a region stuck to it wich check if there's is already a tumor in it. The queen moving to random direction except when it leaves the creep, in wich case she's go back in the direction of the hive.
The first part works fine, the queen, move and create tumor when it got 20 energy, but for a reason that I ignore, it sometimes create tumor near a previous one. My region is big enough I think (8.0), but it doesn't seems to detect the presence of the tumor.
This is my script, hope someone can help me to figure out what's going wrong.
I think you should try doing this in data.
It would work better.
And youd learn a lot about how data works....
and if your gonna paste your script you should use the
Thanks for the reply, i'll try that.
@Asindee: Go
But yeah for data you would use an if then kind of an effect
you have a behavior on the queen that runs an effect
this effect runs a search effect for a tumor in a given range and if there is not tumor in range then you create a new tumor at the position of the queen if there is a tumor in range do nothing
Im not very good with using condition effects. Im more of a trigger kinda guy. but I really think you should give it a try.
And heres how I would do it with a trigger
Logic of Trigger
I use pure GUI.... script is more or less a waste of time...
Thank you again, it's seems interesting to use the radius instead of using the region, I can't test it for the moment but I'll try that soon and give you a feedback.