I want to be able to drag-build, similar to games like Supreme Commander.
You select a structure to build.
You click on a location.
You drag to another location.
It fits as many of that structure (based on placement map) in a straight line between the two points as it can, in a build queue.
If possible, while dragging, it also displays standard ghost images.
Until released, it will not queue any of the structures.
If this is not feasible, other methods of rapidly queuing clean squares of multiple structures would be helpful.
This might be possible via data but I doubt it. Most likely triggers would be mostly required.
That requires a massive number of precision clicks. I want to be able to rapidly click drag to place 20+ buildings, in a line, within around 2 seconds. Shift click is something I already know about, and was the best method Warcraft 3 could Handle. Starcraft however lets you trigger-add to a queue, meaning it is at least theoretically possible for you to enable drag-building.
As you can see, this placement is a perfect line of four factories, which takes two clicks, and no effort at all on the player's side. While I couldn't find an example, walls in that game are often erected, as in 30-40 wall seconds to block off a passage, and that takes no longer than that.
Maybe you could do something with the mouse movement event and the shift key being hit/released could effect a boolean variable. I always hear people saying the mouse event can be laggy though.
When "Key Pressed by user" happens, switch a boolean to either True or False that holds whether shift is being held.
Then, when the mouse moves, do this in this order:
First, you'll need a global variable - call it 'MouseOldPosition' or whatever makes sense for your map.
You'll also need a global variable - 'ShiftWasDown'
That is the general idea of the algorithm. It will do exactly what you want, and will not have any problems with mouse laginess, regardless of how fast you move your cursor around. The idea is that the algorithm doesn't care if you move your mouse super fast - it will fill in the path between the OLD positiona nd the NEW position in a line with the building.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I want to be able to drag-build, similar to games like Supreme Commander. You select a structure to build. You click on a location. You drag to another location. It fits as many of that structure (based on placement map) in a straight line between the two points as it can, in a build queue. If possible, while dragging, it also displays standard ghost images. Until released, it will not queue any of the structures.
If this is not feasible, other methods of rapidly queuing clean squares of multiple structures would be helpful.
This might be possible via data but I doubt it. Most likely triggers would be mostly required.
@Ranakastrasz: Go
Hold shift?
That requires a massive number of precision clicks. I want to be able to rapidly click drag to place 20+ buildings, in a line, within around 2 seconds. Shift click is something I already know about, and was the best method Warcraft 3 could Handle. Starcraft however lets you trigger-add to a queue, meaning it is at least theoretically possible for you to enable drag-building.
As you can see, this placement is a perfect line of four factories, which takes two clicks, and no effort at all on the player's side. While I couldn't find an example, walls in that game are often erected, as in 30-40 wall seconds to block off a passage, and that takes no longer than that.
Maybe you could do something with the mouse movement event and the shift key being hit/released could effect a boolean variable. I always hear people saying the mouse event can be laggy though.
Try this.
When "Key Pressed by user" happens, switch a boolean to either True or False that holds whether shift is being held.
Then, when the mouse moves, do this in this order: First, you'll need a global variable - call it 'MouseOldPosition' or whatever makes sense for your map. You'll also need a global variable - 'ShiftWasDown'
( next part is psuedocode ):
----------------------------------------------------That is the general idea of the algorithm. It will do exactly what you want, and will not have any problems with mouse laginess, regardless of how fast you move your cursor around. The idea is that the algorithm doesn't care if you move your mouse super fast - it will fill in the path between the OLD positiona nd the NEW position in a line with the building.