Hey there,
hopefully someone can help me out here.
I can't think of anything better to get this working without selecting the units i click on. I don't want that cuz it doesn't look nice and I want this system to work with the right mouse button too.
Just a few issues:
1. My biggest problem right now is to turn off that rectangle being drawn when I hold the left mouse button down. (How) can i change that?
2. And someone plz tell me if theres a way to get the mouse position without clicking. (I know the general assumption is that it can't be done, if you know better, plz let me know)
3. Could someone tell me how I stop my ghost from fleeing? I can't find the field for it in the data editor...
As soon as I have this system done I will release the map for people to learn from it. Atm it's working quite smooth... which kind of surprises me^^
hopefully someone can help me out here.
Trigger:
- ClickedLMB
- Events
- UI - Player Any Player clicks Left mouse button Down.
- Local Variables
- RegionClicked = (Region((Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world))), 1.0)) <Region>
- Conditions
- Actions
- Region - Move RegionClicked to (Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world)))
- General - If (Conditions) then do (Actions) else do (Actions)
- If
- (Number of Living units in (Units in RegionClicked having alliance Enemy with player (Triggering player) matching Excluded: Missile, Dead, Hidden, with at most 1)) == 1
- Then
- Variable - Set LMBClicked[(Triggering player)][1] = true
- Variable - Set LMBClicked[(Triggering player)][0] = false
- Else
- Unit - Order CameraUnit[(Triggering player)] to ( Move targeting (Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world)))) (Replace Existing Orders)
- Variable - Set LMBClicked[(Triggering player)][1] = false
- Variable - Set LMBClicked[(Triggering player)][0] = true
- If
- Unit Group - Pick each unit in (Units in RegionClicked having alliance Enemy with player (Triggering player) matching Excluded: Missile, Dead, Hidden, with at most 1) and do (Actions)
- Actions
- General - While (Conditions) are true, do (Actions)
- Conditions
- ((Picked unit) is alive) == true
- LMBClicked[(Triggering player)][1] == true
- Actions
- Unit - Order CameraUnit[(Triggering player)] to (Ghost - Sniper Round (Picked unit)) (Replace Existing Orders)
- General - Wait AttackCD[(Triggering player)] Game Time seconds
- Conditions
- General - While (Conditions) are true, do (Actions)
- Actions
- Events
I can't think of anything better to get this working without selecting the units i click on. I don't want that cuz it doesn't look nice and I want this system to work with the right mouse button too.
Just a few issues:
1. My biggest problem right now is to turn off that rectangle being drawn when I hold the left mouse button down. (How) can i change that?
2. And someone plz tell me if theres a way to get the mouse position without clicking. (I know the general assumption is that it can't be done, if you know better, plz let me know)
3. Could someone tell me how I stop my ghost from fleeing? I can't find the field for it in the data editor...
As soon as I have this system done I will release the map for people to learn from it. Atm it's working quite smooth... which kind of surprises me^^