Home   Help Search Login Register  

Author Topic: Selecting Players friendly Target  (Read 1650 times)

0 Members and 1 Guest are viewing this topic.

Offline sardaukar17

  • Members
  • *
Selecting Players friendly Target
« on: 10 Jun 2009, 06:56:39 »
Alright, I am guessing a command to do this doesn't exist but I'll ask anyway

Is there a way to select a squad leaders friendly target in a script?

For example,

If in game if the squad leader selects f2 so he can give commands to his second squad member is there a way to detect what unit he has selected?

If I can detect who is selected I can use that to activate scripts that target just that single unit with just a couple command lines. Then no matter who is selected or how many the squad leader can choose who to activate the script on. Would make my life so much easier and I would have a much much more simplified script.

Offline schuler

  • Contributing Member
  • **
Re: Selecting Players friendly Target
« Reply #1 on: 10 Jun 2009, 07:24:42 »
When you make your men ,,, name them ap1 (you) ap2, ap3, ap4 ect, but to make ap2 be f2 he has to have higher rank then the others. If your cpt make him sgt and the rest pvt's. after this you can use ap2 watch is f2 now, do anything in a addaction script or what ever you want to do in a script. Note: there might be better info by one of the guru's  ;)
Semper Fi

Offline sardaukar17

  • Members
  • *
Re: Selecting Players friendly Target
« Reply #2 on: 10 Jun 2009, 20:00:27 »
I appricate the help but that doesn't sound like what I am looking for. What I need is a way of detecting who the squad leader has selected in his squad.

This will give you a rough idea of what I am trying to do. It is not correct but you get the gist. The "selectplayer target" line is what I don't know how to do, and can't seem to find a command for.

_target = selectplayertarget;

?! (Isformationleader player) : goto "notauthorized";
isplayer _target : goto "nokill";
_target setdamage 0;
goto "exit";

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
Re: Selecting Players friendly Target
« Reply #3 on: 13 Jun 2009, 19:12:45 »
AFAIK there is no command for it.

Maybe it's possible to find out which of his guys a player selected by creating an empty dialog/control and grab the keystrokes... (ingredients: dialogs, UI event handlers, DIK constants)
try { return true; } finally { return false; }

Offline sardaukar17

  • Members
  • *
Re: Selecting Players friendly Target
« Reply #4 on: 14 Jun 2009, 03:55:34 »
Thats a bummer :(

Thanks for the help though. I'm going to have to get more educated on how to use the event handlers. If anyone has a good link to a tutorial about them that would be great!