Recently I've been attempting to do some fairly simple, in theory, projects or sub-projects and I've either ran into an unbelievable amount of obstacles, or into one or two more or less impossible to work around obstacles. I've decided to list some of them here, and see if anyone can help, or if others have had similar problems.
Feel free to post your own simplistic project that seems insurmountable here as well! (try to list your project(s) sequentially, starting from the last post's ending number.)
1. Creating a turret that faces in one direction down a lane, and can only fire at units that are BOTH in its lane and not behind it. Similar to how Popcaps' Plants vs Zombies game plays.
This might be rather simple with just one lane, but once you stack 2+ lanes on top of each other, it becomes a different store.
2. Having a custom UI button which, when pressed acts just like click on a unit's command card ability to build a structure. So, you click on the button, a placement selection cursor and message pops up, you place the structure, and the structure starts building at that location.
To my understanding, this is currently impossible due to the fact that Unit - Issue Order (With Target) MUST be given a target immediately, and there is no way to get the current mouse X/Y/Z positions without clicking the mouse.
1. Creating a turret that faces in one direction down a lane, and can only fire at units that are BOTH in its lane and not behind it. Similar to how Popcaps' Plants vs Zombies game plays.
This might be rather simple with just one lane, but once you stack 2+ lanes on top of each other, it becomes a different store.
Can you not make the firing angle 0, and the rotation speed 0? Simply point the tower in the right direction, and let it fire!
Here's mine:
3. Make a (siege tank) turret point towards the point where an ability was casted when the siege tank uses a (custom) ability.
Not sure why this isn't working :(
The tank should also play it's firing animation. I think I got this part to work..
1. Use a weapon arc with small degree like 5 or so (not sure 0 would work ). That way your turret can only fire in a cone in front of its facing (or a line if 0 ). Lock it facing in place (prevent turning or limit turning to some degree) and it's good to go.
2. I noticed some people tried to issue order to an invalid target( like on top of itself) and then it will give back control to you ( havnt tested myself). My aproach would be to show a text message after you click button ( please select target) and will build it only after you clicked. Thay way you can get mouse position
1. (Turrets firing down a lane) I can get the turret to stay fixed in one direction, and I can even give my weapon a fixed firing arc. The problem is that the turret will only be able to target units in a triangle with one point starting at the turret, and the two other ending at the weapons range away. This means that there are areas very close to the turret, but still in front of the turret, where the turret will not be able to acquire targets. If I could define a rectangle (which could have it's points defined relative to the turret or the map) then I would have exactly what I need. Unfortunately, I'm either going to need trigonometry to calibrate everything exactly, or I'll have to do it all in triggers, which I'd prefer to avoid.
2. I haven't tried giving the target an invalid position, but that sounds like something that just might work. Again, the problem of displaying a text message, "Select Target" and then letting the use click, is that the point wont be exact and will rarely be a valid point. In earlier tests, I tried having the builder unit build at its current position, but even when it couldn't build no error message or selection cursor came up, so I'm not sure if that method would actually work.
3. Make a (siege tank) turret point towards the point where an ability was casted when the siege tank uses a (custom) ability.
Not sure why this isn't working :(
The tank should also play it's firing animation. I think I got this part to work..
Sounds to me like you need to send messages to the siege tank's actor(s) (be it the siege tank, its attack actor or the turret actor). Whether you're working with triggers or objects, in both cases you're probably going to have to mess with the actors.
-
4. Simply refreshing the timer on all, already applied, buffs, of the same type. Ok, seriously, why are we given an "Effect - refresh" field in our Behavior - Buff objects if there aren't any effects that can modify a currently running Behavior? I mean, are we supposed to make an effect that removes then applies a new buff? What if I want a buff to stack six times, and whenever the same buff is applied, ALL the currently applied buffs their duration reset? Why is that so hard to do?
1.You might not need trigonometry. Set the arc to 0 and the weapon can only fire straight in a line. You have to keep the enemy walking in that line though. I got another work around by giving behaviors to unit in separate lane like 1,2 .. ( when they are spawned). Then give each turret a different weapon with different validator that can only shoot unit that has the lane behavior. Turret 1 can only fire unit in lane 1( that has behavior 1) etc
1.You might not need trigonometry. Set the arc to 0 and the weapon can only fire straight in a line. You have to keep the enemy walking in that line though. I got another work around by giving behaviors to unit in separate lane like 1,2 .. ( when they are spawned). Then give each turret a different weapon with different validator that can only shoot unit that has the lane behavior. Turret 1 can only fire unit in lane 1( that has behavior 1) etc
Yeah, I considered doing that, but at that rate I might as well do it all with triggers. I mean, that's quite a pain and it doesn't seem like it should be necessary. I feel like I'm going to need to write my own special plugins or hack files just to get some very basic functionality... which is probably going to be more effort than it's worth...
A respawn timer for a hero. This took me forever since the inclusion of a "wait" timer seems to make "triggering unit" function not work anymore. Had to set up local variables for everything after the wait timer.
Instead of using the "Wait" Trigger, you might want to consider setting up a global variable as type Timer, and when your hero dies, you start the timer. When the timer expires another trigger catches it and respawns your hero. Make sure you have a global variable to catch the unit that died before you start your timer.
1) It's not good fix, but if you want narrow "laned" behavior, try using blockers to divide up your lanes (in PvZ the zombies never deviated from their lanes)
2) A simple workaround for this would be to use an invisible collisionless scv as your "builder" and teleport him to where ever the building is to be built.
3) For a solution to something like this, if you don't want to use the aid of a trigger, you are most likely going to have to get out of the editor and use a custom script (all abilities are essentially scripts... but then so are all triggers).
@Anthius: Go
Just increase build range of the build ability to 360, and hide the unit so it's only usable from script and ignored otherwise in terms of common targeting etc.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Recently I've been attempting to do some fairly simple, in theory, projects or sub-projects and I've either ran into an unbelievable amount of obstacles, or into one or two more or less impossible to work around obstacles. I've decided to list some of them here, and see if anyone can help, or if others have had similar problems.
Feel free to post your own simplistic project that seems insurmountable here as well! (try to list your project(s) sequentially, starting from the last post's ending number.)
1. Creating a turret that faces in one direction down a lane, and can only fire at units that are BOTH in its lane and not behind it. Similar to how Popcaps' Plants vs Zombies game plays.
2. Having a custom UI button which, when pressed acts just like click on a unit's command card ability to build a structure. So, you click on the button, a placement selection cursor and message pops up, you place the structure, and the structure starts building at that location.
More to come! (unless nobody cares...)
Can you not make the firing angle 0, and the rotation speed 0? Simply point the tower in the right direction, and let it fire!
Here's mine:
3. Make a (siege tank) turret point towards the point where an ability was casted when the siege tank uses a (custom) ability.
@redpand: Go
1. Use a weapon arc with small degree like 5 or so (not sure 0 would work ). That way your turret can only fire in a cone in front of its facing (or a line if 0 ). Lock it facing in place (prevent turning or limit turning to some degree) and it's good to go.
2. I noticed some people tried to issue order to an invalid target( like on top of itself) and then it will give back control to you ( havnt tested myself). My aproach would be to show a text message after you click button ( please select target) and will build it only after you clicked. Thay way you can get mouse position
Pausing / Unpausing Unit Morphs (i.g. Hatchery -> Lair).
1. (Turrets firing down a lane) I can get the turret to stay fixed in one direction, and I can even give my weapon a fixed firing arc. The problem is that the turret will only be able to target units in a triangle with one point starting at the turret, and the two other ending at the weapons range away. This means that there are areas very close to the turret, but still in front of the turret, where the turret will not be able to acquire targets. If I could define a rectangle (which could have it's points defined relative to the turret or the map) then I would have exactly what I need. Unfortunately, I'm either going to need trigonometry to calibrate everything exactly, or I'll have to do it all in triggers, which I'd prefer to avoid.
2. I haven't tried giving the target an invalid position, but that sounds like something that just might work. Again, the problem of displaying a text message, "Select Target" and then letting the use click, is that the point wont be exact and will rarely be a valid point. In earlier tests, I tried having the builder unit build at its current position, but even when it couldn't build no error message or selection cursor came up, so I'm not sure if that method would actually work.
Sounds to me like you need to send messages to the siege tank's actor(s) (be it the siege tank, its attack actor or the turret actor). Whether you're working with triggers or objects, in both cases you're probably going to have to mess with the actors.
-4. Simply refreshing the timer on all, already applied, buffs, of the same type. Ok, seriously, why are we given an "Effect - refresh" field in our Behavior - Buff objects if there aren't any effects that can modify a currently running Behavior? I mean, are we supposed to make an effect that removes then applies a new buff? What if I want a buff to stack six times, and whenever the same buff is applied, ALL the currently applied buffs their duration reset? Why is that so hard to do?
@redpand: Go
1.You might not need trigonometry. Set the arc to 0 and the weapon can only fire straight in a line. You have to keep the enemy walking in that line though. I got another work around by giving behaviors to unit in separate lane like 1,2 .. ( when they are spawned). Then give each turret a different weapon with different validator that can only shoot unit that has the lane behavior. Turret 1 can only fire unit in lane 1( that has behavior 1) etc
Yeah, I considered doing that, but at that rate I might as well do it all with triggers. I mean, that's quite a pain and it doesn't seem like it should be necessary. I feel like I'm going to need to write my own special plugins or hack files just to get some very basic functionality... which is probably going to be more effort than it's worth...
A respawn timer for a hero. This took me forever since the inclusion of a "wait" timer seems to make "triggering unit" function not work anymore. Had to set up local variables for everything after the wait timer.
@Eiviyn: Go
Instead of using the "Wait" Trigger, you might want to consider setting up a global variable as type Timer, and when your hero dies, you start the timer. When the timer expires another trigger catches it and respawns your hero. Make sure you have a global variable to catch the unit that died before you start your timer.
Getting some doors to open and close randomly. Thought it would take 5 minutes and it ended up taken 3 hours.
@redpand: Go
1) It's not good fix, but if you want narrow "laned" behavior, try using blockers to divide up your lanes (in PvZ the zombies never deviated from their lanes)
2) A simple workaround for this would be to use an invisible collisionless scv as your "builder" and teleport him to where ever the building is to be built.
@ShadowLightX: Go
3) For a solution to something like this, if you don't want to use the aid of a trigger, you are most likely going to have to get out of the editor and use a custom script (all abilities are essentially scripts... but then so are all triggers).
@Anthius: Go Just increase build range of the build ability to 360, and hide the unit so it's only usable from script and ignored otherwise in terms of common targeting etc.