is it possible to add an ability in the game that players can use, without having to select a unit or structure?
For example, any player can click F1 to select an idle worker or F2 to select the entire army... Would it be possible to click F3 or § to use Psi Storm?
Psi Storm would always be available to the player, wherever the player has his or her camera, no matter what units are selected.. Kinda like a "god" power from Age of Mythology..
If this (or something similar) is possible, how can it be approached in the editor? Via Data Editor? Triggers? Hidden dummy unit?
The whole thing can be completed with triggers but I am not sure if it can be done using data only.
The first method is pure trigger only while the second method requires triggers + data.
The first method requires you to create a button dialog on the top left corner of the screen and detect when it is clicked. When the user clicks it, activate another trigger which detects when the user clicks the left mouse button. Once the user clicks the left mouse button, you can then have an effect take place at the location using the create effect at point trigger. You can also create a splat by creating an splat actor and have it follow the mouse. Once the user hits the left mouse button destroy the splat actor. This will work independent of any structure or unit but If you are planning on uploading it on battlenet scrap this idea immediately as te lag will make this useless.
The second method is to essentially detect when the user clicks te button and then instantly have the user select a replace structure with the required ability and then immediately activate the ability. This should allow for users to select the ability using the button, however you will need to select the unit/structure though. This is battlement compatible though.
Currently it is not possible as far as I know. The natives required to do this (force an order target interface for a unit with an arbitrary player) is only available in Legacy of the Void. That said I am only theorizing that it could be used to do that, I have no idea if it will actually work.
As RobustProgram has described, you can simulate the effect to some degree. However in multiplayer it will suffer from input latency so will not follow your cursor as smoothly as normal order targeting does.
There is a "key pressed" trigger event. I would probably have that select a building that does the effect though (give the ability 500 range). Cuz if you do it all through triggers you could wind up with the problem Imperial mentioned.
Perhaps could a solution be to use a "dummy hero".
It has no visible model. Its icon is for example Psi storm. If so, it will appear as a hero icon in the top left corner of the screen. Whenever a player clicks the dummy hero button, he or she needs to press an additional button to select Psi storm from the command cards.. (where move, attack, stop is) ... and then cast it anywhere with unlimited range..
Two questions:
1. Can a player always click on the hero button in the top left corner, or click on F1-F4 to select the hero? (Just as in Warcraft 3..? I have never used heroes in my maps)
2. Is it possible to prevent players from focusing the camera on the dummy hero? Normally, when a player double clicks on the hero icon or the hero portrait, the camera is focused on the hero. I don't want players to be able to focus on the dummy hero since it does not "exist" on the battlefield
1. Depending on what race players choose to play as, they start with one invisible, invulnerable and unselectable by clicking/dragging dummy structure. Each structure has a different ability, depending on the race. (I use Psi storm in this example) There is a dialog button in the top left corner.
2. There is a trigger that detects whenever a player clicks a key, for example: § OR if a player clicks directly on the dialog button. When a player clicks either button, the invisible dummy structure is selected. Psi storm appears down in the command cards at the dummy structure. So a player must first click § and then E to cast Psi storm.. (Now players can not double click the dialog button to focus the camera on the dummy.. but maybe they can still click on the portrait?.. hmm)
Maybe is it possible to make the dummy structure immediately choose to cast Psi storm? So players do not need to first select the invisible dummy structure and THEN choose Psi storm? You just click § and the cursor actor for Psi storm appears on the battlefield, at your cursor. Now the player can either cancel it OR click where to cast Psi storm.
I will try to build it in the editor during the coming week, just need to find a good overall approach to follow
Maybe is it possible to make the dummy structure immediately choose to cast Psi storm? So players do not need to first select the invisible dummy structure and THEN choose Psi storm? You just click § and the cursor actor for Psi storm appears on the battlefield, at your cursor. Now the player can either cancel it OR click where to cast Psi storm.
no it's not
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hello,
is it possible to add an ability in the game that players can use, without having to select a unit or structure?
For example, any player can click F1 to select an idle worker or F2 to select the entire army... Would it be possible to click F3 or § to use Psi Storm?
Psi Storm would always be available to the player, wherever the player has his or her camera, no matter what units are selected.. Kinda like a "god" power from Age of Mythology..
If this (or something similar) is possible, how can it be approached in the editor? Via Data Editor? Triggers? Hidden dummy unit?
The whole thing can be completed with triggers but I am not sure if it can be done using data only.
The first method is pure trigger only while the second method requires triggers + data.
The first method requires you to create a button dialog on the top left corner of the screen and detect when it is clicked. When the user clicks it, activate another trigger which detects when the user clicks the left mouse button. Once the user clicks the left mouse button, you can then have an effect take place at the location using the create effect at point trigger. You can also create a splat by creating an splat actor and have it follow the mouse. Once the user hits the left mouse button destroy the splat actor. This will work independent of any structure or unit but If you are planning on uploading it on battlenet scrap this idea immediately as te lag will make this useless.
The second method is to essentially detect when the user clicks te button and then instantly have the user select a replace structure with the required ability and then immediately activate the ability. This should allow for users to select the ability using the button, however you will need to select the unit/structure though. This is battlement compatible though.
Currently it is not possible as far as I know. The natives required to do this (force an order target interface for a unit with an arbitrary player) is only available in Legacy of the Void. That said I am only theorizing that it could be used to do that, I have no idea if it will actually work.
As RobustProgram has described, you can simulate the effect to some degree. However in multiplayer it will suffer from input latency so will not follow your cursor as smoothly as normal order targeting does.
There is a "key pressed" trigger event. I would probably have that select a building that does the effect though (give the ability 500 range). Cuz if you do it all through triggers you could wind up with the problem Imperial mentioned.
Thanks for your replies.
Perhaps could a solution be to use a "dummy hero".
It has no visible model. Its icon is for example Psi storm. If so, it will appear as a hero icon in the top left corner of the screen. Whenever a player clicks the dummy hero button, he or she needs to press an additional button to select Psi storm from the command cards.. (where move, attack, stop is) ... and then cast it anywhere with unlimited range..
Two questions:
1. Can a player always click on the hero button in the top left corner, or click on F1-F4 to select the hero? (Just as in Warcraft 3..? I have never used heroes in my maps)
2. Is it possible to prevent players from focusing the camera on the dummy hero? Normally, when a player double clicks on the hero icon or the hero portrait, the camera is focused on the hero. I don't want players to be able to focus on the dummy hero since it does not "exist" on the battlefield
add your own button and select the unit with triggers instead of directly with the button
How do you mean?
@Kabelkorven: Go
Like dialogs, or the key pressed event. That'll prevent the double clicking problem.
Ah! What about this approach then?
1. Depending on what race players choose to play as, they start with one invisible, invulnerable and unselectable by clicking/dragging dummy structure. Each structure has a different ability, depending on the race. (I use Psi storm in this example) There is a dialog button in the top left corner.
2. There is a trigger that detects whenever a player clicks a key, for example: § OR if a player clicks directly on the dialog button. When a player clicks either button, the invisible dummy structure is selected. Psi storm appears down in the command cards at the dummy structure. So a player must first click § and then E to cast Psi storm.. (Now players can not double click the dialog button to focus the camera on the dummy.. but maybe they can still click on the portrait?.. hmm)
Maybe is it possible to make the dummy structure immediately choose to cast Psi storm? So players do not need to first select the invisible dummy structure and THEN choose Psi storm? You just click § and the cursor actor for Psi storm appears on the battlefield, at your cursor. Now the player can either cancel it OR click where to cast Psi storm.
I will try to build it in the editor during the coming week, just need to find a good overall approach to follow
How would you actually go about attaching an actor to the mouse?
no it's not