Home   Help Search Login Register  

Author Topic: Starting in helicopters  (Read 752 times)

0 Members and 1 Guest are viewing this topic.

Torak

  • Guest
Starting in helicopters
« on: 08 Oct 2003, 15:54:04 »
I tried searching for this,but got no results; sorry if it's already been mentioned.

In a cutscene, how do I get a unit to start in cargo in a helicopter that isn't attached to that unit? What I'm trying to do is have a helicopter land, disgorge its cargo, who then get in a Humvee to be taken to somewhere else. How do I do that?

For the same cutscene, how do I get the escort choppers to fly close enough to stay in the cutscene but far enough away to not collide with anything? Can I make them peel off and go into a holding pattern while the transport lands?

mikeb

  • Guest
Re:Starting in helicopters
« Reply #1 on: 08 Oct 2003, 16:12:15 »
UNITNAME moveincargo HELINAME

instantly transports a unit to cargo, so put that in the init field or init.sqs or whatever.

you can do the rest using waypoints if you want.  syncronise a getout WP for the group with a transport unload WP for the heli.

Then put a getin waypoint on the humvee, etc.

you can also do this by scripting which i find does more precise movements (and is better for helicopters) but this may be all you need.

Oh and use an invisible H for the chopper landing point to help it be a bit more precise (making sure the land is as level and obstacle free as possible)

EDIT:

For your last problem you could set them as a seperate group and keep them close.  if it's only a cutscene however you could cheat by using a setpos loop to keep them a certain distance and move in formation relative to the leading chopper and noone would really be able to tell the difference.
« Last Edit: 08 Oct 2003, 16:14:47 by mikeb »

Torak

  • Guest
Re:Starting in helicopters
« Reply #2 on: 08 Oct 2003, 16:45:11 »
That's great, thanks!

How do I do the setpos loop thing? And how can I switch that to a circling close protection pattern when the Hawk lands?

Torak

  • Guest
Re:Starting in helicopters
« Reply #3 on: 08 Oct 2003, 17:16:55 »
Oh, and what does that "solve" button do?

mikeb

  • Guest
Re:Starting in helicopters
« Reply #4 on: 08 Oct 2003, 20:56:09 »
the solve button will lock the topic and put a little smiley face by the thread to inform people that you've found the answer you were looking for.  don't do that till you've tried out the answers!!

looping script:

make a file called heliloop.sqs (or whatever you want .sqs)

then put this in the file:

#loop

HELINAME2 setpos [(getpos HELINAME1 select 0), (getpos HELINAME1 select 1) - 30, (getpos HELINAME1 select 2)]

?endloop==true: goto "end"

~0.01

goto "loop"

#end

exit


HELINAME 1 and 2 are the name of the helis.  1 being th one you have actually flying and leading.  the array in the command above is the distance from heliname1 in metres.  select 0 id the x axis, 1 the y axis and 2 the z axis.  In this case the heli will be set 30 metres behind the first heli.  then the ~0.01 will wait 0.01 seconds before looping it back and re-issuing the command.

You get the idea, so play with it.

btw best to make sure heliname2 has it's engin on (set it flying, etc)

also this does NOT alter the direction it is facing so make sure it is facing in the right direction at the start and you're heli's don't change direction (which would call for a lot more scripting)

As mentioned before this techinque is only really good for cutscenes and may produce some weird-looking results.  the benefit being you can capture the parts that look good.

Anyway make a variable called "end" with becomes true whener you want to stop the loop (in this example.  and you can initially call the script by putting the following in a trigger or init field:

[] exec "heliloop.sqs" (or whatever name you give it)


I'm sure I've made many mistakes above.  I'm a little pre-occupied doing other stuff!  hopefull you get the idea.  browse through the forums looking for similar topics and you'll see MUCH better examples or clever scripting and indeed one that may solve your problem better!

have fun

M

Torak

  • Guest
Re:Starting in helicopters
« Reply #5 on: 09 Oct 2003, 13:09:02 »
Great, thanks!

Can I set the script to end when the transport reaches a certain trigger?

Can I tell the escort to then go to a waypoint system?

How can I remove NVGs from a unit? (The "Player" unit seems to have NVGs, so the whole cutscene gets a green tint; rather irritating...)

mikeb

  • Guest
Re:Starting in helicopters
« Reply #6 on: 09 Oct 2003, 13:13:47 »
1.  in a trigger put end=true (or whatever you decided to call the variable that ended the script)

2.  to go to a WP system would be a bit difficult .  instead set gam logics at the locations you want to move it to and then put HELINAME domove (getpos GAMELOGICNAME)

3.  put the following in the player's init field.  this removeweapon "nvgoggles"