Home   Help Search Login Register  

Author Topic: Move individual squad members to positions after insertion  (Read 1706 times)

0 Members and 1 Guest are viewing this topic.

Offline fortran

  • Members
  • *
Hi guys,
Well I just started on my first attempt at singleplayer map editing and is going ok so far. Have managed to get Mando's amazing heliroute script working and now have a 4 man team (the player as squad lead + 3 team mates) inserting into the market area of Avgani. What I would like to do next is once they have disembarked from the heli is for the other 3 members of the team to fan out to some preset positions and go prone or kneel and scan the area while the heli takes off again. I have searched around and I understand I probably need to use a combination of waypoints for each team mate (aside from me) then use the setUnitPos command with DOWN or Middle to make them prone or crouch. However im having a bit of trouble getting it to work. Also how can I make them do this just until the heli has gone, the begin following me afterwards. I guess some kind of triggered timer?

Also is there any way to access all of the squad leaders commands via script ? I see obviously the setUnitPos and setFormation commands are avaliable, so I take it everything in that list is. When the player is squad lead, is it possible to still issue commands via script to the rest of your squad ? I want to make it appear that the squad is more "intelligent" than it really is so in parts of the level I need my squad mates to break off from the player and perform various operations then re-group either when the player has moved a certain distance from them or they have completed their "task".  Is this beyond mission editing and into scripting ?

Thanks for any pointers or assistance.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Move individual squad members to positions after insertion
« Reply #1 on: 12 Jan 2009, 17:44:52 »
lendrom made a script called Dismount drill back in the day which basically does what you want: upon leaving the vehicle each member fans out and goes prone (I think) ; it's was left a bit in the beta stage, I think, but it's a good proof-of-concept. I've tried it's demo missions and it works fine, you might have to edit it a bit to make it work with your chopper insertion. But good luck!

It's also possible by other means, of course, but let's try the ones that exist first ;)

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline fortran

  • Members
  • *
Re: Move individual squad members to positions after insertion
« Reply #2 on: 12 Jan 2009, 17:46:42 »
Wow perfect! Thanks very much Wolfrug, will give that a try right now  :). Just to ask but is the 2nd half of my question possible also ?

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re: Move individual squad members to positions after insertion
« Reply #3 on: 12 Jan 2009, 18:03:24 »
It should be possible to script something performed in the command menu. There are not necessarily commands per se for each item in the command menu, but you can combine commands to perform a certain item in the command menu.

If you want help with certain commands, just ask.
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline fortran

  • Members
  • *
Re: Move individual squad members to positions after insertion
« Reply #4 on: 12 Jan 2009, 18:15:32 »
Magic ok thanks Tyger, will give it a go. Have managed to get the script suggested by Wolfrug running by executing it at the end of the landing part of Mando's heliroute. Is looking great, just need to tweak the drill script so they form up closer to the heli, also they seem to all disembark from the same side of the heli, but I will try fix that. Anyway thanks for the assistance guys, will post back if I get stuck again.

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: Move individual squad members to positions after insertion
« Reply #5 on: 12 Jan 2009, 18:44:43 »
Once you have it working nicely, you should post a small demo version so the rest of can benefit from your (and Lendrom's) work.  I'd love to see it.
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Move individual squad members to positions after insertion
« Reply #6 on: 12 Jan 2009, 19:10:00 »
If you want individuals to run off on their own, it might be easier to get them to temporarily leave the player's group, so then they can be directly controlled by scripts. Otherwise, the player can always give them countermanding orders which might screw up your plans.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: Move individual squad members to positions after insertion
« Reply #7 on: 12 Jan 2009, 19:16:44 »
You could maybe use FSM to create a new formation, i think. This would be much more of a advanced type thing to try out. However there is very little knowledge out there about FSM.
Xbox Rocks

Offline fortran

  • Members
  • *
Re: Move individual squad members to positions after insertion
« Reply #8 on: 12 Jan 2009, 20:08:01 »
Many thanks for the tips guys, just took a look at FSM and I think its a bit beyond me at this point. Am now currently trying to edit Ledrom's script to force the team to take up a 4 point diamond shape around the heli once it lands. Is going ok so far but sometimes they end up ontop of the rotor blades of the heli once they dismount :p Thanks again to everybody.

EDIT: Just a quick question, as im trying to make this mission more linear than free-roaming I am teleporting AI into the correct places via triggers (presume this is the best method) at various points in the mission. I have sucessfuly teleported one enemy into position but im having trouble working out how to move the entire group. I have 3 AI in a squad, the leader is named ter1 and he teleports correctly but nobody else. Do I need to manually add each AI I want to move to the teleport point ? Or is it possible to move the whole group.
« Last Edit: 12 Jan 2009, 20:42:20 by fortran »

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Move individual squad members to positions after insertion
« Reply #9 on: 12 Jan 2009, 22:13:55 »
You might want to start a new thread when things go off on tangents - makes it easier to search and find answers, you know? :D

Anyway - you can move all the units by using something like:

Code: [Select]
{_x setpos getpos teleportpos} foreach (units group ter1);
That moves all the units to the teleportpos, meaning they'll start on top of each other - however as long as they're not meant to stay on that exact spot (i.e., it's not on a rooftop or something) then they'll immediately return to formation and such.

Wolfrug out.

"When 900 years YOU reach, look as good you will not!"

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Move individual squad members to positions after insertion
« Reply #10 on: 12 Jan 2009, 22:20:38 »
And for a less vaudville-style of materialisation, try

Code: [Select]
{_x setpos [(getpos teleportpos select 0) + ((random 20)*sin(random 360)), (getpos teleportpos select 1) + ((random 20)*cos(random 360))]} foreach (units group ter1);
« Last Edit: 12 Jan 2009, 22:27:14 by bedges »

Offline fortran

  • Members
  • *
Re: Move individual squad members to positions after insertion
« Reply #11 on: 12 Jan 2009, 22:31:23 »
Perfect :) Thanks very much guys! Would have started a new thread but just didnt wanna clog the place up seeing as im new here :p