Hi, I'm a new member of this site, and I've got a challenge with the editor that I can't figure out.
At the moment I'm creating a game which is essentially a more awesome version of minesweeper. At the moment I'm trying to add a scan ability so that a player can reveal a 3*3 area of the map. What I want to do is to somehow snap it to the map grid, so that it can only be used at map locations which are proper integers, i.e. it can be used at (4.0, 12.0) but not (4.5453, 11.896), and to have the ScannerSweepCursorSplat be displayed and the ability itself activated at the nearest such point to the mouse.
The reason I would like to do this is because at the moment the number of minesweeper "tiles" revealed changes with where the scan is placed. If the scan is placed in the middle of a tile, then it will reveal the correct 3*3 area, but if it is instead placed at the side of a tile, then it will reveal either one tile to many on that side, or one tile to few on the other side (depending on the exact value of the scan radius).
Does anyone know of a way to do this? I was able to come up with a method using triggers that would simply suppress the scan ability entirely and instead just round the mouse coordinates and create a ScannerSweepCursorSplat actor at the correct position and then use a hidden ScannerSweep2 ability to reveal the area, but unfortunately it suffers from the infamous b.net latency and a couple of other less than ideal nuisances. So I'm hoping that someone here knows of a better way to do it with data.
For clarification, the ScannerSweepCursorSplat is the red circle you see when you're placing the scan, not the scan itself.
Well, there's always a way, but it's up to you to figure out if thats worth it.
Alright you "could" place dummy units of a certain type all over the map. These units will represent your grid. Now whenever someone uses the scan ability you can do a search for the unit type and cast scan from the closest unit.
About the CursorSplat. Hmm. I guess you could attach an invisible dummy unit to the mouse (with triggers, just once) so that you always know in data where the mouse is. Now, when then player ativates the scan ability you add a behaviour to the dummy unit that periodically searches for close units of the grid type. You can then tint these tiles or do something else that graphically shows the player that he will reveal these tiles.
What about using a build type ability to construct a building with a matching footprint and replace the placement model by the cursor splat and give the constructed building the desired sight range and duration of your sweep? You could try to snap it to the building grid with this.
Cursor splat as placement model wouldnt work since you'd need to scale it, but you can add the cursor splat the normal way (it works with train abilities as well, look at the creep tumor)
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi, I'm a new member of this site, and I've got a challenge with the editor that I can't figure out.
At the moment I'm creating a game which is essentially a more awesome version of minesweeper. At the moment I'm trying to add a scan ability so that a player can reveal a 3*3 area of the map. What I want to do is to somehow snap it to the map grid, so that it can only be used at map locations which are proper integers, i.e. it can be used at (4.0, 12.0) but not (4.5453, 11.896), and to have the ScannerSweepCursorSplat be displayed and the ability itself activated at the nearest such point to the mouse.
The reason I would like to do this is because at the moment the number of minesweeper "tiles" revealed changes with where the scan is placed. If the scan is placed in the middle of a tile, then it will reveal the correct 3*3 area, but if it is instead placed at the side of a tile, then it will reveal either one tile to many on that side, or one tile to few on the other side (depending on the exact value of the scan radius).
Does anyone know of a way to do this? I was able to come up with a method using triggers that would simply suppress the scan ability entirely and instead just round the mouse coordinates and create a ScannerSweepCursorSplat actor at the correct position and then use a hidden ScannerSweep2 ability to reveal the area, but unfortunately it suffers from the infamous b.net latency and a couple of other less than ideal nuisances. So I'm hoping that someone here knows of a better way to do it with data.
For clarification, the ScannerSweepCursorSplat is the red circle you see when you're placing the scan, not the scan itself.
Thanks in advance to anyone that can help.
Well, there's always a way, but it's up to you to figure out if thats worth it.
Alright you "could" place dummy units of a certain type all over the map. These units will represent your grid. Now whenever someone uses the scan ability you can do a search for the unit type and cast scan from the closest unit.
About the CursorSplat. Hmm. I guess you could attach an invisible dummy unit to the mouse (with triggers, just once) so that you always know in data where the mouse is. Now, when then player ativates the scan ability you add a behaviour to the dummy unit that periodically searches for close units of the grid type. You can then tint these tiles or do something else that graphically shows the player that he will reveal these tiles.
Just a few ideas, maybe it helps. :-)
What about using a build type ability to construct a building with a matching footprint and replace the placement model by the cursor splat and give the constructed building the desired sight range and duration of your sweep? You could try to snap it to the building grid with this.
Cursor splat as placement model wouldnt work since you'd need to scale it, but you can add the cursor splat the normal way (it works with train abilities as well, look at the creep tumor)