I was wondering how you can lock unit selections. Specifically, what I want to try is this:
1. Make units not selectable through clicking, yet still have all units be selectable through triggers or unit groups.
2. Have all units still be clickable for the use in triggers, but not selected when they're clicked.
The game Frontline has a system similar to, or maybe exactly, what I need. It's weird because although the single rpg unit seems selected, a green selection circle does not highlight around it. At first I thought it was a dummy unit relaying orders to the active unit through triggers like a remote control, but I don't think that's the case anymore... though it might be.
You can make a unit Unselectable in the data editor under in the Unit - Flags field of the unit.
You can also go into the model of each unit and change the Selection Radius to 0 or something close to 0; that will give the illusion that the unit is not selected when it really is and can be.
Yeah I've tried that but the problem is I need the units to be unselectable through clicks but not other methods. Checking the unselectable flag makes it so that a unit can't be selected at all.
I need to make it so that the units of any player are unselectable through clicks, but the units can still be selected by their owners through hotkey groups or triggers.
But... does making a unit unselectable through a trigger not deselect the unit if the player already has it selected? That might how be it's done in Frontline... I'll have to test that once I get back to my editor.
Here's a map which uses a work-around to select unselectable units. It only works for one player because this is a sample map and it would require too much work.
You can select the two units in two ways:
1) In-game press enter and type "s 1" or "s 2" to select either unit by trigger.
2) You can use the mouse to highlight one or both units. Use Ctrl+1 or Ctrl+2 to make a unit-group and then press 1 or 2 to select it.
I don't know how to make a in-game unit group by the normal method. I'll take a longer look later to see if I can find a trigger to do that.
Damn... so I tested more stuff. Apparently yes, you can still control an unselectable unit if it was already selected, but making a unit unselectable removes it from any control group.
If you are just looking to have an rpg style movement system with a single hero unit, check out OneTwoSC's youtube video tutorials, specifically the one about diablo controls. His movement system will work exactly how it sounds you want it.
If you want a work around then, make a trigger with an event for unit selected... In the conditions make sure triggering unit is the unit you dont want selected... In the actions, force player to select a different or no unit. 'No unit' should be in the presets section. (player selects his own hero => force player to select 'no unit')
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I was wondering how you can lock unit selections. Specifically, what I want to try is this:
1. Make units not selectable through clicking, yet still have all units be selectable through triggers or unit groups. 2. Have all units still be clickable for the use in triggers, but not selected when they're clicked.
The game Frontline has a system similar to, or maybe exactly, what I need. It's weird because although the single rpg unit seems selected, a green selection circle does not highlight around it. At first I thought it was a dummy unit relaying orders to the active unit through triggers like a remote control, but I don't think that's the case anymore... though it might be.
@Monictor: Go
You can make a unit Unselectable in the data editor under in the Unit - Flags field of the unit.
You can also go into the model of each unit and change the Selection Radius to 0 or something close to 0; that will give the illusion that the unit is not selected when it really is and can be.
@peranzormal: Go
Yeah I've tried that but the problem is I need the units to be unselectable through clicks but not other methods. Checking the unselectable flag makes it so that a unit can't be selected at all.
I need to make it so that the units of any player are unselectable through clicks, but the units can still be selected by their owners through hotkey groups or triggers.
But... does making a unit unselectable through a trigger not deselect the unit if the player already has it selected? That might how be it's done in Frontline... I'll have to test that once I get back to my editor.
Use triggers. I don't know how this will affect trigger-unit-selection or hot-key group selections. Ill check in a little while.
Here's a map which uses a work-around to select unselectable units. It only works for one player because this is a sample map and it would require too much work.
You can select the two units in two ways:
1) In-game press enter and type "s 1" or "s 2" to select either unit by trigger.
2) You can use the mouse to highlight one or both units. Use Ctrl+1 or Ctrl+2 to make a unit-group and then press 1 or 2 to select it.
I don't know how to make a in-game unit group by the normal method. I'll take a longer look later to see if I can find a trigger to do that.
Damn... so I tested more stuff. Apparently yes, you can still control an unselectable unit if it was already selected, but making a unit unselectable removes it from any control group.
I see. Alternatively, you can use dummy selectable units for the Control Group.
If you are just looking to have an rpg style movement system with a single hero unit, check out OneTwoSC's youtube video tutorials, specifically the one about diablo controls. His movement system will work exactly how it sounds you want it.
If you want a work around then, make a trigger with an event for unit selected... In the conditions make sure triggering unit is the unit you dont want selected... In the actions, force player to select a different or no unit. 'No unit' should be in the presets section. (player selects his own hero => force player to select 'no unit')