Rts script help please

I have a selection and move script below everything works but when I want to make the deselect with alt + left click It does not work >.<. it does if I just use alt but with he left click it doesnt.
LEFT CLICK IS CALLED select

I also would like to see if there is a better way to go about making the destionation so that the person goes to that spot and can still move others at same time since i use one destination marker model i can only move one at a time cause it just moves it when i right click. a script example would be appreciatiated.

oh and with multiple selected units how do I get it so that they move to same spot and stop and not run into eachother getting to that exact center ?

SCRIPT ------------------------------------------------------------

cont = GameLogic.getCurrentController()
own = cont.owner

#Defining -------------------------------------------------------
mouseOver = cont.sensors[“MouseOver”]
select = cont.sensors[‘Select’]
rightclick = cont.sensors[‘RightClick’]
reached = cont.sensors[‘Reached’]
targetpos = cont.actuators[‘TargetPos’]
motion = cont.actuators[‘Motion’]
alt = cont.sensors[‘Alt’]

#Script ---------------------------------------------------------
if select.positive and not alt.positive and mouseOver.hitObject == own:
own[‘selected’] = 1
if rightclick.positive and not mouseOver.hitObject.has_key(“enemy”) and own[‘selected’] == 1:
cont.activate(motion)
cont.activate(targetpos)

if reached.positive:
cont.deactivate(targetpos)
cont.deactivate(motion)
if select.positive and mouseOver.hitObject.has_key(“deselect”) and not mouseOver.hitObject == own:
own[‘selected’] = 0
cont.deactivate(targetpos)
cont.deactivate(motion)
if select.positive and alt.positive and mouseOver.hitObject == own:
own[‘selected’] = 0
cont.deactivate(targetpos)
cont.deactivate(motion)

One of the simplest ways to get a group movement is to designate when group member as the “leader”. That leader moves to the marker, and the other members follow. You can define “slots” for other group members relative to the leader. For example, slot one might be the leaders position + 1 unit to the right or something.

To use the marker for multiple groups, you could have some kind of unique group identification. Then you can use addObject to add a marker object, and then assign that new marker a property that holds that groups unique identification. Then a group only looks for markers that match with their identification.

your a bit general XD I could do that if i could figure out the functions in code and such lol XD. and didnt get first question answered XD ty though

give a demo blend, it’s difficult to see what it’s trying to do without a blend

there you go dudes

I dont think i have it in atm well think i removed the left control button from the python code for that function but when u press left ctrl and left click It wont work. Idk what is making anything else work using left click …

Attachments

RTS.blend (189 KB)