I'm trying to have a creep tumor auto-build other creep tumors (using triggers). In order to give the 'order' to build creep, I need to provide a 'point'. What I want is to be able to place a creep tumor anywhere,and have it build an infinite amount of tumors on creep (and rebuild them if they die). I edited the ability so infinite builds is possible (in a reasonable time period), but I can't get the tumor to auto-build, without a direct order (with exact point).
Give the unit a dummy ability that requires no target, and set up a trigger so that when the dummy ability is used, the casting unit will use Creep Tumor on a random point in range which is on creep. Once you have this no-target ability to randomly place creep tumors, you can create an "Issue Order" effect that will give the order to activate this ability without a target. Then, create a behavior that uses the "Issue Order" as a periodic effect, add the behavior to your creep tumors, and you are good to go. Whenever the periodic effect goes off, the creep tumor will start the trigger, picking out a random creep spot in range and dropping a tumor there.
I think that if you create creep with a trigger, it instantly fills the region you specify, rather than gradually "creeping" as a tumor would cause it to do. Also, by placing the tumors "randomly" the advancement of the creep is unpredictable and gradual, which is probably more like what the OP wanted.
Plus, by attaching the creep to tumors, you can remove the creep by removing the tumors, which might be an important gameplay mechanic in his map. Making a mechanic to remove "Trigger creep" would be a hassle.
You're right about the game mechanics, but I'm still having trouble. I've done the triggers, and data editing, but it won't auto create. I tried creating a trigger in place of the behavior, but that didn't work either.
EDIT
I also added the dummy ability to the command card so I can use it to test the trigger, and it's not working.
The Trigger:
Event:
Unit - Nydus Worm (Canal) [127.50, 120.50] uses dummyAbility at Generic1 - Any stage (Include shared abilities)
Action:
Unit - Order (Triggering unit) to (Creep Tumor - Creep Tumor targeting (Random point in (Playable map area))) (Before Existing Orders)
I modified the Nydus Worm to see if I could, and I can manually create creep tumors. Any theories on why it's not working?
Give the unit a dummy ability that requires no target, and set up a trigger so that when the dummy ability is used, the casting unit will use Creep Tumor on a random point in range which is on creep. Once you have this no-target ability to randomly place creep tumors, you can create an "Issue Order" effect that will give the order to activate this ability without a target. Then, create a behavior that uses the "Issue Order" as a periodic effect, add the behavior to your creep tumors, and you are good to go. Whenever the periodic effect goes off, the creep tumor will start the trigger, picking out a random creep spot in range and dropping a tumor there.
If you could make a map that I can look at that would be great.
You're right about the game mechanics, but I'm still having trouble. I've done the triggers, and data editing, but it won't auto create. I tried creating a trigger in place of the behavior, but that didn't work either.
EDIT
I also added the dummy ability to the command card so I can use it to test the trigger, and it's not working.
The Trigger:
Event:
Unit - Nydus Worm (Canal) [127.50, 120.50] uses dummyAbility at Generic1 - Any stage (Include shared abilities)
Action:
Unit - Order (Triggering unit) to (Creep Tumor - Creep Tumor targeting (Random point in (Playable map area))) (Before Existing Orders)
I modified the Nydus Worm to see if I could, and I can manually create creep tumors. Any theories on why it's not working?
Calling "Random Point in (Playable map area)" will almost certainly return a point that is out of the ability's range, and since the Nydus Worm cannot move, it will simply fail together.
What you need to do is initialize a local variable of the type Point.
Set this variable equal to a random point within a specific distance of the triggering unit. This will guarantee that the point is in range.
There is still a chance that the target point will be blocked or won't be on creep, in which case the ability will fail, but as long as the behavior is running periodically enough, it should hit a valid creep location often "enough."
If you really wanted to, you could an a conditional statement that would check whether the point was suitable and rerun the trigger if it wasn't, which would guarantee that the creep tumor would be created every time (but could potentially cause an infinite loop if EVERY point in range is invalid, due to the creep tumors being locally "saturated")
I'll try to put together a sample in a little while.
The Dummy ability and the behavior weren't really necessary, once I thought about it.
I just made a trigger that went off periodically. When it did, it picked every idle unit belonging to player 1, and ordered it to pop out a creep tumor to a random point within range 10 of the itself.
For my test, I ran the trigger every 2 seconds, so I took off the cooldown on Creep Tumor and made it build in 1 second. I kept in the Use limit of 1 so they don't multiply exponentially...
But in this example map you can see the results. Every second, the active creep tumor tries to pop out a new one. Since there's only one "active" tumor at a time, it doesn't end up spreading too quickly, but it does spread somewhat unpredictably (except that once it gets very big, it doesn't expand often and when it does it is somewhat predictable since it won't suddenly jump to the other side of the creep).
Regardless, it gives you an idea of what I'm talking about.
You'll also notice that occasionally more than 2 seconds pass between creep tumors popping out. This will happen if the creep tumor selects an invalid target point when the trigger runs. If the point doesn't have creep or already has a tumor blocking it, then it will simply fail and it will try again next time the trigger runs. This is pretty nice though, since it makes the creep even more unpredictable.
I hope this is enough to get you started. If you need any ideas about how to make the creep growth a little bit more chaotic, I might be able to come up with something better.
Before you posted, I was working on custom script that would track all possible points for a tumor. I had two arrays, one for possible points, and one for previously placed tumors. The function would return a random point from the array of possible points. A periodic trigger called the function. It works, with a few times where the placement failed (for an unknown reason). I'll look at what you made, and see if it's easier.
Thanks.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm trying to have a creep tumor auto-build other creep tumors (using triggers). In order to give the 'order' to build creep, I need to provide a 'point'. What I want is to be able to place a creep tumor anywhere,and have it build an infinite amount of tumors on creep (and rebuild them if they die). I edited the ability so infinite builds is possible (in a reasonable time period), but I can't get the tumor to auto-build, without a direct order (with exact point).
Give the unit a dummy ability that requires no target, and set up a trigger so that when the dummy ability is used, the casting unit will use Creep Tumor on a random point in range which is on creep. Once you have this no-target ability to randomly place creep tumors, you can create an "Issue Order" effect that will give the order to activate this ability without a target. Then, create a behavior that uses the "Issue Order" as a periodic effect, add the behavior to your creep tumors, and you are good to go. Whenever the periodic effect goes off, the creep tumor will start the trigger, picking out a random creep spot in range and dropping a tumor there.
How do you give it a random point on creep?
There is a "Random Point in Region" function for points. Use that in your trigger.
@SansRegreT: Go
Or you could just make a trigger to have creep spread over a certain region, that should be easier.
I think that if you create creep with a trigger, it instantly fills the region you specify, rather than gradually "creeping" as a tumor would cause it to do. Also, by placing the tumors "randomly" the advancement of the creep is unpredictable and gradual, which is probably more like what the OP wanted.
Plus, by attaching the creep to tumors, you can remove the creep by removing the tumors, which might be an important gameplay mechanic in his map. Making a mechanic to remove "Trigger creep" would be a hassle.
@MasterDinadan: Go
You're right about the game mechanics, but I'm still having trouble. I've done the triggers, and data editing, but it won't auto create. I tried creating a trigger in place of the behavior, but that didn't work either.
EDIT
I also added the dummy ability to the command card so I can use it to test the trigger, and it's not working.
The Trigger:
Event:
Unit - Nydus Worm (Canal) [127.50, 120.50] uses dummyAbility at Generic1 - Any stage (Include shared abilities)
Action:
Unit - Order (Triggering unit) to (Creep Tumor - Creep Tumor targeting (Random point in (Playable map area))) (Before Existing Orders)
I modified the Nydus Worm to see if I could, and I can manually create creep tumors. Any theories on why it's not working?
If you could make a map that I can look at that would be great.
Calling "Random Point in (Playable map area)" will almost certainly return a point that is out of the ability's range, and since the Nydus Worm cannot move, it will simply fail together.
What you need to do is initialize a local variable of the type Point. Set this variable equal to a random point within a specific distance of the triggering unit. This will guarantee that the point is in range. There is still a chance that the target point will be blocked or won't be on creep, in which case the ability will fail, but as long as the behavior is running periodically enough, it should hit a valid creep location often "enough." If you really wanted to, you could an a conditional statement that would check whether the point was suitable and rerun the trigger if it wasn't, which would guarantee that the creep tumor would be created every time (but could potentially cause an infinite loop if EVERY point in range is invalid, due to the creep tumors being locally "saturated")
I'll try to put together a sample in a little while.
The Dummy ability and the behavior weren't really necessary, once I thought about it. I just made a trigger that went off periodically. When it did, it picked every idle unit belonging to player 1, and ordered it to pop out a creep tumor to a random point within range 10 of the itself. For my test, I ran the trigger every 2 seconds, so I took off the cooldown on Creep Tumor and made it build in 1 second. I kept in the Use limit of 1 so they don't multiply exponentially... But in this example map you can see the results. Every second, the active creep tumor tries to pop out a new one. Since there's only one "active" tumor at a time, it doesn't end up spreading too quickly, but it does spread somewhat unpredictably (except that once it gets very big, it doesn't expand often and when it does it is somewhat predictable since it won't suddenly jump to the other side of the creep). Regardless, it gives you an idea of what I'm talking about.
You'll also notice that occasionally more than 2 seconds pass between creep tumors popping out. This will happen if the creep tumor selects an invalid target point when the trigger runs. If the point doesn't have creep or already has a tumor blocking it, then it will simply fail and it will try again next time the trigger runs. This is pretty nice though, since it makes the creep even more unpredictable.
I hope this is enough to get you started. If you need any ideas about how to make the creep growth a little bit more chaotic, I might be able to come up with something better.
Link Removed: http://www.mediafire.com/?l010jjgntot
@MasterDinadan: Go
Before you posted, I was working on custom script that would track all possible points for a tumor. I had two arrays, one for possible points, and one for previously placed tumors. The function would return a random point from the array of possible points. A periodic trigger called the function. It works, with a few times where the placement failed (for an unknown reason). I'll look at what you made, and see if it's easier.
Thanks.