OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Kammak on 27 Apr 2004, 09:16:06

Title: Handy Action
Post by: Kammak on 27 Apr 2004, 09:16:06
I've started adding the following action in my missions and I've grown to love it.  All it does is force your AI squad to re-align the formation onto whatever direction YOU are currently facing.  Instead of having to move 10 yards to get them to reorient, all I do now is click the mouse!  Quite a time saver.  Anway, just passing along a tidbit!  :)

In player's init field:

this addaction["Set Direction","SetGroupHeading.sqs"]

SetGroupHeading.sqs:

group player setFormDir getDir player

Title: Re:Handy Action
Post by: dmakatra on 27 Apr 2004, 18:58:20
Ooooo lovley. But how about making it automaticly? So the player won't notice and neither get irritated by spammed action menu nor stupid AI? Like in a loop:

#tartishloop
group player setFormDir getDir player
~5
goto "tartishloop"

:beat: *Gets Shot* :beat:

EDIT: And you should add this in the FAQ m8. I'd love to see this in all missions. This AI misstake is as most annoying at ambush missions and such.
Title: Re:Handy Action
Post by: Kammak on 28 Apr 2004, 01:15:13
Actually I would hate to have it automated - I turn around a lot as I patrol in/out, and it would be really bad to have them reorient just because I'm scanning.

The point about a filled-up action menu is valid...but I prefer to manually control it despite that.

And yes it is VERY handy when setting up an ambush!  Nothing like wiping out a twelve-man enemy patrol in under a second with your AI troops all on line (formation not internet) and firing!
Title: Re:Handy Action
Post by: ScrubMuncher on 28 Apr 2004, 04:37:12
Sweet, tks kammack!
Title: Re:Handy Action
Post by: toadlife on 28 Apr 2004, 10:42:49
OK here is an idea. The script will only activate if the player is *stopped* for a certain amount of time - in this case, the group would only sinc up with the leader after the leader is stopped for 15 seconds. Just change thge value of _delay to change the time.



Code: [Select]
_delay = 15
#tartishloop
@speed player == 0
_time = 0
@_time > _delay || speed player > 0
?speed player > 0:goto "tartishloop"
group player setFormDir getDir player
goto "tartishloop"

This mightprovide a happy medium between automation and annoyance. I like the concept. I can't believe I never thought of it before!!
Title: Re:Handy Action
Post by: The-Architect on 28 Apr 2004, 17:21:13
Cool.
It's the little things that make this game so great.
Nice work  ;D
Title: Re:Handy Action
Post by: Sui on 29 Apr 2004, 10:53:03
I had a similar thing down in one of my mission betas...

The player was a platoon leader, and I needed to orientate the platoon's formation to the orientation of the player.

I used a pair of invisible H's that got alternatively placed at the player's position. Once the player was 20m away from one of them, I'd get the bearing between them and set the platoon's (read: squad's) formation at that.

This was good because the platoon would only change formation if the player actually positively moved in a direction. So the player could move around a bit (ie. find cover under fire) without the platoon (squad) re-forming back up...

I dunno... anyone interested in something like that? The player need never know it's happening, as all the components to it happen back end and are invisible...
Title: Re:Handy Action
Post by: dmakatra on 29 Apr 2004, 15:09:27
Yea, I betaed that mission... Never got to take command though since my old crappy comp couldn't take the amount of units. Might make a go for it. Is this mission dead? Or are you still working on it?

BTW, toady, add that to the FAQ mate!

:beat: *Gets Shot* :beat: