Home   Help Search Login Register  

Author Topic: Chopper Dynamic Control SP/MP supported complete !  (Read 5170 times)

0 Members and 1 Guest are viewing this topic.

ROBINO

  • Guest
Chopper Dynamic Control SP/MP supported complete !
« on: 10 Apr 2005, 13:35:45 »
it does exactly what it says on the tin

Recommended for OFP version 1.90 (OFP: Resistance).

 

Chopper Dynamic Control SP/MP supported.

Requires: OFP 1.9

by Robino for the Royal Marines clan

This script allows the user to order up to 2 choppers to perform a number actions anywhere on the map at any time.  Orders are sent the using "mapclick" command and the radio.  The scripts are waypointless - making them truly dynamic.

The actions that can be performed are:

1) land
2) hover
3) hover with weapons hot
4) perform a paradrop (for quick insertion)

In addition to this, radio can be used to query the status of chopper.  The chopper will report its weapons, ammo, position, condition and if its weapons are "HOT" or "COLD".

The scripts support MP usage and an fair amount of MP testing has yielded successful results.  They can also be used in SP without any problems.

I didnt want to distribute just the .sqs files because the scripts rely on a handful of editor placed objects.  The dl, therefore, contains 2 un pbo'd demo missions on Malden island so you can easily understand the requirements.

To access the demo missions extract the directories [singlechop] and [doublechop] and copy them to your:

operation flashpoint\users\(yourname)\missions    directory

The missions can then be loaded on Malden island and previewed to test them.

Implementation of the script is EASY PEASY for anyone with modest editing skills.  Full instructions are included in the readme file in the dl.
« Last Edit: 10 Apr 2005, 18:44:39 by ROBINO »

Offline Baddo

  • Former Staff
  • ****
  • Reservist Jaeger
Re:Chopper Dynamic Control SP/MP supported complete !
« Reply #1 on: 10 Apr 2005, 15:33:24 »
Hmm. I tested the demo missions... seems like an interesting script pack.  :P

First, singlechop.

What I did:

1. Set new coordinates.

2. Give the chopper a 'land @ coords', no luck, nothing happens. I think it should have started moving now. It does not take off at all.

3. Then I gave the chopper a 'hover @ coords' order. Chopper moves to coords. Good!

4. Next, I try to give the chopper a 'land @ coords' order. The chopper comes down a bit but then just stays there, up in the air. If I give it a new 'hover' order, it goes up to the height it was before the 'land' order.

5. Then I give the chopper new coords and order it to land there. No luck. It's still up in the air.

OK. Let's try the doublechop demo mission...

Hmm. Now I get the choppers to land, approximately to the same spot where the singlechop version failed.

Maybe you should always use an invisible helipad instead of the visible one, now it's a bit... ~unrealistic~ that a helipad suddenly appears on the ground. For testing purposes it is OK of course.

Three things comes to my mind from this:

1. Did you just mess up with the singlechop demo mission?

2. Always use an invisible helipad to mark the coordinates and do not tell anyone to even have a choice of using a visible one. It will not look good in a mission if helipads come from nowhere. Players can see it and they will not like it.

3. I think this is not true because the other demo mission seemed to work better, but anyway: If the landing problems I experienced in the singlechop demo mission are caused by the probable reasons you tell in the readme, I think the scripts should fix it so that the chopper really lands, no matter what the circumstances are. Maybe you could script it so that it checks if the chopper really is going to land (and actually lands) and doesn't just hover and force it down somehow, if it fails to land at first.

ROBINO

  • Guest
Re:Chopper Dynamic Control SP/MP supported complete !
« Reply #2 on: 10 Apr 2005, 18:46:46 »
well spotted baddo

my mistake it seems i forgot to name the helipad on singlechop properly - it should be called derh

changing its name will make it work

i have updated the dl above so it all works now

apologies to anyone who tried the script already - they new one DOES work

Offline 456820

  • Contributing Member
  • **
Re:Chopper Dynamic Control SP/MP supported complete !
« Reply #3 on: 10 Apr 2005, 18:48:28 »
sounds very good another good idea would be rappeling using snYpir's support pack as that rappeling is very realistic. i will also test very soon

Offline 456820

  • Contributing Member
  • **
Re:Chopper Dynamic Control SP/MP supported complete !
« Reply #4 on: 10 Apr 2005, 19:00:03 »
eermmmm right im not to sure about it does seem very good and it is but also a few things
1. the h thing mentioned before make the haver lower than what it is say 30m or maybe make it like a fster get in and faster get out and make the chopper hove around 2m so people can quickly get in and out.
2. add a rappeling script
3. make it do circle things like patrol areas say mark out an are and the chopper ptrols that area.
4. there has been a script wic makes the uh60 browning use the machine gun in cirles like you make an area and the chopper fly in circles using that script firing in a circle

all in all its a very good script keep up the good work

ROBINO

  • Guest
Re:Chopper Dynamic Control SP/MP supported complete !
« Reply #5 on: 10 Apr 2005, 19:04:10 »
thnx m8 - glad u like it - best for armoured targets really

Offline 456820

  • Contributing Member
  • **
Re:Chopper Dynamic Control SP/MP supported complete !
« Reply #6 on: 10 Apr 2005, 19:05:13 »
if you have used snYpirs support pack another good idea would to copy that console it has cause i dont like a big radio console for some reason

ROBINO

  • Guest
Re:Chopper Dynamic Control SP/MP supported complete !
« Reply #7 on: 23 Apr 2005, 12:14:07 »
bump !  :)

ROBINO

  • Guest
Re:Chopper Dynamic Control SP/MP supported complete !
« Reply #8 on: 06 Jun 2005, 22:41:12 »
Man - this script has been up for ages and I'd like to know how pple have been getting on with it.

It did take me ages to make and even though it could arguably do with a little polish (but dont they always say that ? :) )  "chopperdynamic2.zip" remembles pretty much what the final version will look like.

I personally have been integrating it into missions on the RM XGN server and havent found any major problems.

Here are the more minor probs I've found:

* temp sync loss delays the sidechat messages and chopper commands - this can cause the scripts to get a little muddled (not a lot I can do about that)

* chopper does not respond to land commands over water or those too close to the edge of the map (not a lot I can do about that either)


Anyone got any scripting suggestions ? Or want some justifiable features added ?

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:Chopper Dynamic Control SP/MP supported complete !
« Reply #9 on: 09 Jun 2005, 03:58:03 »
I havent tried it but i got a few sugjestions,

#1. a point target attack for cobras and apaches,
the player uses the action menu, selects "point target attack" then he uses the binos, and right clicks to designate a target, and a invisible target is placed on the enemy designated, and the chopper is ordered to fire the hellfires at that invisible target.

#2. the player uses the area cover comand and selects a position and then a trigger with a radius of about 100 meters( or whatever the editor wants) is put where he designates with the map click, and the trigger detects all enemy units in the radius of it and if they are enemy it uses the knowsabout comand to make the chopper know about them, if they are infantry then maby a invisible target can be placed on the infantry one at a time for the AI chopper to just easily attack.

for invisible targets use lesters invisible targets.

it comes with

IR(infa-red target the choppers can find at night or day)
Laser(Same as IR except A-10s will drop LGBs on it)
Man(a man class target,higher priority than normal man)
Armor(armor class target)
all come for east west and resistance/
« Last Edit: 09 Jun 2005, 03:58:34 by penguinman »

Offline Blanco

  • Former Staff
  • ****
Re:Chopper Dynamic Control SP/MP supported complete !
« Reply #10 on: 09 Jun 2005, 04:27:32 »
Quote
for invisible targets use lesters invisible targets.

I recommend FOX's invisible targets, they are almost the same as Lester's, with that difference that Fox his targets have priority levels.(LOW, MEDIUM, HIGH)

Search or search or search before you ask.

ROBINO

  • Guest
Re:Chopper Dynamic Control SP/MP supported complete !
« Reply #11 on: 14 Jun 2005, 22:10:03 »
Here is the full readme lifted from the dl:


Readme for Chopper Dynamic Control MP/SP supported

Date: 8th April 2005
Version: final
Requirements: OFP version 1.85 or above
Author: [RM] Robino
   
Support: MP & SP supported !!

Credits: made by Robino on behalf of the [RM] Royal Marine clan
   thnx to [RM] Akita and [RM] Kong for testing and suggestions.
   thnx to [RM] Dog for a little scripting inspiration
   thnx to [RM] 3lions and [RM] GSTQ for running the best OFP    clan around
   Everyone at OFPEC

1) Intro
2) Installing
3) Use of the script
4) Instructions for singlechop
5) Instructions for doublechop
6) Chopper observations and design notes
7) Disclaimer

**********************
1)   Introduction
**********************

These scrpits provide the user with up to 2 choppers which can be commanded to perform a variety of functions at any location on the map, at any time.  It took months for me to develop - not because the coding  was hard - but because careful examination of chopper behaviour had to be made.  I have included some of the reasons for my design in ***.

The directory [singlechop] contains all the code required to command a single chopper dynamically.  It was designed to take into account that the same chopper can be used for transport and combat; the Mi24, UH60(rockets) and Mi17 for example, can both engage armoured targets and carry troops.  [doublechop] contains scripts required to control 2 choppers.  It was designed so the functions of transport and combat could be separated - where transport is chop1 and combat is chop2.


***********************
2)   Installing
***********************


Extract files.

Once extracted copy [singlechop] and [doublechop] to your:

[operation flashpoint\users\(yourname)\missions] directory

now you will be able to view and try the missions on malden island, via the mission editor.  I didnt want to distribute only the .sqs files because the scripts rely on objects which must be placed using the mission editor.

************************
3)   Using the script
************************

Use of the script coulndt be simpler !
Activate the "Set coords" radio command and then do a single click on the map.  The "Chopper Coord" marker will move to this new position. Now activate any of the radio commands and the chopper will move to the coords to complete the action - EASY PEASY !


*****************************
4)   instructions for [singlechop]
*****************************
Here are instructions telling you what you will find in the mission editor and how to insert the same into your own missions - trust me it is EASY for anyone with a little editing experience. The MP environment IS supported aswell as SP.


dir [singlechop]  contains:

mission.sqm
description.???
briefing.htm
chopper22.sqs
weaps.sqs
convo.sqs
radio2.sqs
detectclick.sqs
groupeject.sqs
init.sqs
stop.sqf

All files ending in .sqs are required. Briefing, mission and description are specific to each mission.

In addition to this a number of items must be placed in your mission via the editor.

a manned chopper      Name: chop1
gamelogic         Name: server
invisible(or visible) Helipad   Name: derh
a marker         Name: pos   Text: Chopper Coords

The chopper functions are activated by radio - therefore radio triggers are required.  The triggers should be set to:

activation: radio alpha to juliet       and      repeatedly   condition: this
on activation: [?] exec "chopper22.sqs"

Where ? is a number sent to chopper22.sqs which indicates the function to be performed. The numbers are:

2  - this activates the "hover" command
3  - this activates the "land" command
4  - this activates the "paradrop" command
5  - this activates the "hover while weapons are hot" (free to engage)      command

You can assign your radio triggers to any slot you wish and you can create custom radio texts by using the setradiomsg command. Obviously you want your custom radio commands to match up - u dont want to name radio slot 2 "land here" and have a radio trigger send a number 4 to chopper22.sqs because this will activate the "paradrop" command !

The radio trigger to setup positioning of the Chop Coords Marker should be set:

activation: radio alpha to juliet       and      repeatedly   condition: this
on activation: [chop1] exec "radio2.sqs"

The radio trigger to allow querying the status of the chopper is:

activation: radio alpha to juliet       and      repeatedly   condition: this
on activation: status = true


With these items added via the editor and your radio triggers sorted you should be good to go.  You need only use the radio commands/triggers that you want for your mission.  The chopper will change its firing mode according to the type of action you ask it to perform.  So for example if you activate the "hover weapons hot" command it will say on radio "WEAPONS HOT" and will move to the coords to engage any targets.  Then if you activate the "land" command it will say "SWITCHING BACK TO WEAPONS COLD".  This is useful because you dont want the chopper to be distracted attacking targets when you want it to land.


Also there are 2 lines in chopper22.sqs which read:

;_playergrp = group player
;[_playergrp,_chopname] exec "groupeject.sqs"

Uncomment these lines (delete the ;) and the chopper will automatically eject the player's group once the paradrop coords are reached.  This is  not recommended for MP and is not supported.  But it works splendidly in SP where telling AI group members to eject one at a time can be problematic.

*****************************
5)   instruction for [doublechop]
*****************************
There are a few changes made to the scripts and additions to enable 2 choppers to be commanded. Copy all .sqs files contained in [doublechop] to your mission.

dir [doublechop] should contain:

mission.sqm
briefing.htm
description.???
stop.sqs
chopper22.sqs
chopper33.sqs
init.sqs
detectclick.sqs
radio2.sqs
convo2.sqs
convo12.sqs
weaps.sqs
weaps2.sqs
groupeject.sqs



Here is  list of all editor objects required:

a manned chopper      name: chop1
a manned chopper      name: chop2
gamelogic         name: server
invisible(or visible) Helipad   name: derh
invisible(or visible) Helipad   name: derh2
a marker         name: pos   Text: Chopper Coords

Any chopper can perform any function you wish so here is an example of how you can organise your radio triggers for chop1 = transport and chop2 = combat. Assume we want chop1 to be able to "land", "paradrop" and "hover" and chop2 to "hover weapons hot" and "land".  Here we call chopper22.sqs to activate chop1 and chopper33.sqs to activate chop2.

/* the coordinate marker trigger:

activation: alpha       and      repeatedly
condition: this
on activation: [chop1] exec "radio2.sqs"

/* chop1 land trigger

activation: bravo       and      repeatedly
condition: this
on activation: [3] exec "chopper22.sqs"

/* chop1 paradrop trigger

activation: charlie       and      repeatedly
condition: this
on activation: [4] exec "chopper22.sqs"

/* chop1 hover trigger

activation: delta      and      repeatedly
condition: this
on activation: [2] exec "chopper22.sqs"

/* chop2 land trigger

activation: echo       and      repeatedly
condition: this
on activation: [3] exec "chopper33.sqs"

/* chop2 hover weapons hot trigger

activation: foxtrot       and      repeatedly
condition: this
on activation: [5] exec "chopper33.sqs"

/* the query status trigger takes into account both choppers

activation: golf       and      repeatedly
condition: this
on activation: status = true

Dont forget to name your custom radio commands using setradiomsg - do this inside a trigger also - and it will be processed on all computers in a MP setup.

Thats it. With all the .sqs files and editor objects your choppers should work perfectly.

***********************************
6)   Chopper Observations & Design Notes
***********************************
I am nice. This is a fact. So I have included some of the observations of chopper behaviour here and some explanations of the choices I made to get the scripts working.

* A chopper will not usually overshoot its move marker but if it is coming up/down a hillside it momentum can carry it off course.

* The land command is only useful if the chopper has a visible or invisible Helipad nearby.  It will seek out the H and land on it.  However if the chopper is approx > 150m away at the time the land command is sent, the chopper will take ages to land, or not land at all.  The same problem occurs when land commands are given to the chopper > 100m altitude.

* The chopper22 and chopper33 scripts therefore ECSPLICITLY move the chopper to a point 30m directly above the H and then give the land command to the chopper.

* A chopper cannot land or hit its movemarker correctly if armoured targets are nearby.  Only using setbehaviour "CARELESS" was I able to fix this.

* The land command does not land the chopper on top of units, trees, buildings; the chopper will find an alternate landing position on its own so its recommended to make sure the LZ is clear and kept clear.  Activating land over sea will cause the chopper to freeze... permernantly.

* Contained in chopper22 and chopper33 inside the #endnow loop is code
which lands the chopper without using any land command. derh or a gamelogic called derh is still required.

* chop1 land "land"

change "land" to "get in" for the chopper to keep its engines running

* There are 2 ways to share variables via MP. Publicvariable and using triggers(which are automatically synchronised) from the editor.  Knowing that dialogs are a bitch to create and get synchronised on all machines I opted for radio triggers.

* Lag can affect the performance of the script.  Temporary sync loss while activating the radio commands could lead to some confusion in the scripts.

**************************
7)   Disclaimer
**************************


Its not my fault if this stuff causes your comp to meltdown and lose 4 years of medical research. It's completely unofficial. So just dont sue me, OK ?


Document by Robino

if you find bugs - let me know
« Last Edit: 14 Jun 2005, 22:10:34 by ROBINO »

ROBINO

  • Guest
Re:Chopper Dynamic Control SP/MP supported complete !
« Reply #12 on: 14 Jun 2005, 22:40:33 »
OK all thnx for the feedback.  Though I did feel that only a few of you bothered to try the script -  ONLY the best chopper script out there....

Most of the suggestions for possible added features -  I'm wont be following up on - I'll go through them 1 by 1 here:

1)   "there has been a script wic makes the uh60 browning use the machine gun in cirles like you make an area and the chopper fly in circles using that script firing in a circle"

Getting choppers to engage armoured targets is not hard - however getting them engage infantry targets is much harder - scripting another escplicit movement script so the stupid AI MGer has the 60 seconds it takes to spot men is not a good idea.

2)  "the h thing mentioned before make the haver lower than what it is say 30m or maybe make it like a fster get in and faster get out and make the chopper hove around 2m so people can quickly get in and out."

Nice idea - but I want only to use 1 landing procedure.  This way the same command can be used for infil, extraction and returning to base.

3) " make it do circle things like patrol areas say mark out an are and the chopper ptrols that area"

The chopper automatically detects armoured targets encroaching on its area that it has been to commanded to "hover weapons hot" at.  Adding a circling scrpit could mean that it changes its movements when it is preparing to engage its targets - its best to let the chopper AI line itself up for the attack.

4) "a point target attack for cobras and apaches,
the player uses the action menu, selects "point target attack" then he uses the binos, and right clicks to designate a target, and a invisible target is placed on the enemy designated, and the chopper is ordered to fire the hellfires at that invisible target"

Invisible targets do not exist except in addons. I do not want to use addons on this script.  Unkown to many pple AI cannot target gamelogics so the basic editor offers virtually no way of getting
a chopper to "blast that piece of land over there !!".  A possilbe workaround could be to get the chopper to flyover the selected point and then:

cam = "bomb" camcreate (just underneath the chopper)

to make it appear that the chopper has just dropped a bomb on the enemy.  But when do choppers ever drop bombs ?

5) "make a rappeling script"

This is the one suggestion I do like.  However during the initial making of the script it was something I tried to avoid tackling.  Sequencing "eject" actions between players' computers and creating high speed setpos loops - it was all something I thought was too laden with problems for MP scripting. Though this hasnt deterrde others - and when I can be bothered to look at some of the MP rappeling scripts out there I may (or may not) decide to add that as a function.



As I have said "chopperdynamic2.zip" is functioning beautifally on MP and SP games alike and has probably been in testing for about 3 months.
Has anyone out there modded it ? Added bits ? Dont some work for me and improved it ?  If so let me know - here.

Has anyone out there actually been using it yet on their servers ?  How do they like their new-found freedom - given to them by their eternal AI servant in the sky ?

Is anyone interested how I got choppers to land so perfectly ? Its a mixture of setvelocity and complex vector mathematics  :o
Just to keep you all interested I might post a step-by-step into the maths of "pulling" the chopper to a position 30m above the helipad - or maybe I will get a life.

Offline SniperAndy

  • Members
  • *
    • VBS Community
Re: Chopper Dynamic Control SP/MP supported complete !
« Reply #13 on: 01 Aug 2006, 22:51:34 »
Anyone still got this babe?

ROBINO

  • Guest
Re: Chopper Dynamic Control SP/MP supported complete !
« Reply #14 on: 04 Sep 2006, 19:41:31 »
Sure.

I have attached the doublechop version.

This script has been used for over a year and a half on the RM server.  It works well but there are a few things I think I could do better and hence, I have been planning to make an update.  Stay tuned to this forum.

Enjoy !

 :thumbsup:

GavinP

  • Guest
Re: Chopper Dynamic Control SP/MP supported complete !
« Reply #15 on: 21 Sep 2006, 20:39:38 »
I can vouch for its usefulness. If there were one thing i'd change, would be to speed up the landing procedure, but its a really small bug