OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Wadmann on 11 Jul 2003, 21:38:04
-
I need some help completing a MP mission that I am making. I have a squad board a helicopter for a LALO jump some distance away from their base camp. How would I make the flight shorter? Can I use a cutscene in MP and move the chopper via setpos commands while the cutscene is playing? Is the setacctime able to be used in MP and if so does it look too unreal? I would try some of these myself if I were at my own computer but that is not the case. Hopefully some of the gifted editors out there can give me an idea on how to cut down on the flight time so I can get into the action quicker! Thanks in advance for your replies!
Wadmann
-
I'd use the setPos method. Put a game logic where you want the chopper to teleport to (somewhere between the base and the destination, naturally) and name it something like telelogic. When you want the teleport to occur (you could have a trigger detecting the chopper has left base, or whatever), execute a script that looks like this:
;; teleport.sqs
;; fades out, teleports the chopper, fades in
?(vehicle player != heliname AND !local heliname): exit
titleText ["","BLACK OUT",2]
~2
?(local heliname): heliname setPos [(getPos telelogic select 0),(getPos telelogic select 1),(getPos heliname select 2)]
titleText ["","BLACK IN",2]
exit
- Only players in the chopper see the fade out.
- Setpos is only run by the person the chopper is local to.
- Relative altitude does not change, only 2d position.
- Make sure your chopper has enough time to gain speed before executing this for a smooth transition.
- Can easily be rewritten to work for multiple choppers by passing heliname or name of logic to the script.
-
Thanks for the quick reply Tactician! I would like to clarify a couple of things though.
Only players in the chopper see the fade out
The chopper is AI controlled and all of the remaining West troops board the chopper. This should not be an issue.
Setpos is only run by the person the chopper is local to
As above, the chopper is AI controlled. Is this an issue?
Make sure your chopper has enough time to gain speed before executing this for a smooth transition
I was going to use a trigger grouped to the chopper placed after takeoff in it's flight path so it should not be a problem with speed but...
Relative altitude does not change, only 2d position
I had increased the flyin heigt a little (20 - 50 meters or so) from the default flyin height as I was having problems with units impacting the ground too fast. I think that I have fixed this with the eject script settings but if not, can the height be increased via the script or should I get the chopper to the correct heigt prior to activating the trigger?
Thanks again for the script and tips!
Wadmann
-
An AI-flown chopper will not be a problem, the chopper will be local to the host (server). And the condition for exiting the script takes a dedicated server into account.
To change the height of the chopper after teleport, just add a few meters to the setPos line..
?(local heliname): heliname setPos [(getPos telelogic select 0),(getPos telelogic select 1),(getPos heliname select 2) + 20]
And I owe a big "oops" for trying to use italics in a code clipping ::)
-
Thanks again for a prompt reply!
I am happy to see that you included the line to increase the height during the cutscene as it looks funny when the chopper stops at a waypoint the procedes vertically until it reaches the desired height.
As for your "oops", I almost asked in my second post if that is what you were attempting but on the "reply" page, it was italicized!
I will check this out tonight and close this thread if I have no further questions.
Wadmann
-
Unfortunately this did not work. The screen faded out and then faded back in like it was supposed to but I was no futher along than before.
I have double checked my spelling just in case it was something minor like that but I am pretty sure everything is named properly.
Any ideas why it is not working correctly?
Thanks!
Wadmann
-
What's the condition of the trigger calling the script?
A quick fix should be to remove "?(local heliname): " from the setPos line.
-
Sorry for the delay in responding to your "fix" for my problem but due to a "traumatic life experience" (married on June 29), my OFP time has been very limited. The original code worked just fine as it was my error. I had modified your script to change "heliname" to "chopper1" but I screwed up and did not put the modified script into my mission folder. :-[
Thanks for the help!
Topic solved and locked!
Wadmann