OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Landdon on 16 Jun 2007, 03:40:04

Title: Heli Hitching Script
Post by: Landdon on 16 Jun 2007, 03:40:04
Has anyone seen a hitching script simular to one in Karrillions RTS mission?  That is say at 20 meters in the action menus you can Hitch a vehicle and transport it under a UH-60 to a New location.  Then at 20 meters you can un hitch again.
Title: Re: Heli Hitching Script
Post by: Mandoble on 16 Jun 2007, 17:29:40
To be used by players.
AutoHover, aproach the cargo, keep closer than 10m horizontally and not higher than 7m.

EDIT: Changed so only pilots may pick up and drop vehicles or ships.
Title: Re: Heli Hitching Script
Post by: Landdon on 16 Jun 2007, 17:34:23
Another Outstanding product from Mandoble Inc!!!  :clap: :good:
Title: Re: Heli Hitching Script
Post by: JasonO on 19 Jun 2007, 14:25:08
Nice script Mandoble.

I guess you haven't tested MP, but would you assume it works?
Title: Re: Heli Hitching Script
Post by: Mandoble on 19 Jun 2007, 15:08:51
Yep, the script was tested in MP too and works well.
Title: Re: Heli Hitching Script
Post by: Bravo17 on 11 Sep 2007, 02:14:15
The link for the script seems to be broken, and the file seems to be MIA in the file listings. Does anyone know where I can find it?

Thanks

OK, tried again later, and this time it worked!!
Title: Re: Heli Hitching Script
Post by: ricnunes on 08 Jun 2008, 21:26:28
Hi,

I'm using this script for a Multiplayer Co-Op mission that I'm developing and during the development everything seemed ok with this script.
But once I run the mission in a dedicated server I do have one big problem with this script. Everything starts ok, I can pick up a vehicle while flying a helo but the problems starts when I drop the vehicle. At first the vehicle drops OK, but if I get near that vehicle while flying the helo (and without doing anything) the vehicle which was previously picked up sudently appears a few meters above the ground and stays there!

So I'm asking here for help. How can I solve this problem? Thanks in advance for replies...
Title: Re: Heli Hitching Script
Post by: Mandoble on 08 Jun 2008, 23:34:41
The way the scripts are executed need to be re-done to make sure the mando_hitch.sqf is executed only there where _cargo is local.
Title: Re: Heli Hitching Script
Post by: ricnunes on 09 Jun 2008, 00:19:47
Hi Mandoble,

Don't get me wrong, but my knowlege of ArmA scripting is very limited, could you tell me how can I execute the mando_hitch.sqf only when _cargo is local?

Thanks in advance for replies...
Title: Re: Heli Hitching Script
Post by: Mandoble on 09 Jun 2008, 00:58:30
Give me few days to modify current version.
Title: Re: Heli Hitching Script
Post by: ricnunes on 09 Jun 2008, 14:02:22
Thanks very much Mandoble  :)
Title: Re: Heli Hitching Script
Post by: h- on 10 Jun 2008, 17:31:24
Welcome to OFPEC, rinunes :welcome:

Just informing you that please in the future don't quote the entire previous post you're replying to. :)
(I edited the quotes away..)
Title: Re: Heli Hitching Script
Post by: Mandoble on 10 Jun 2008, 21:21:07
Try this one.
Title: Re: Heli Hitching Script
Post by: ricnunes on 10 Jun 2008, 23:12:16
Again thanks very much Mandoble, I really apreciate what you done!
Downloaded it now and will report back to inform if it worked.
Title: Re: Heli Hitching Script
Post by: ricnunes on 10 Jun 2008, 23:14:16
Hi h_

Thanks for the welcome!  :)

Sorry for quoting the posts, won't happen again.
Title: Re: Heli Hitching Script
Post by: ricnunes on 11 Jun 2008, 00:02:49
Hi Mandoble,

Unfortunally I don't have good news. The new script works ok when testing it while running the mission in the mission editor but once I run the mission in a dedicated server the script doesn't work! When hovering above a vehicle meant to be picked up and press the "pick up" option, I get the normal the "Drop cargo" but NO cargo (vehicle) is attached to the helo.
When I press the "Drop cargo" option, the "pick up cargo" option returns and if I try to pick up a vehicle (the same or another one) the same thing happens (no cargo is ever attached).
Title: Re: Heli Hitching Script
Post by: Mandoble on 11 Jun 2008, 00:23:29
How does look like your init.sqf?

EDIT:
I did check in a dedi server and the script works well, the only weird effect is that the cargo bounces a lot when it is not local to the chopper, I will try to find out why.
Title: Re: Heli Hitching Script
Post by: ricnunes on 11 Jun 2008, 00:41:29
My init.sqf looks like this:

/*
  INITIALISATION SCRIPT

******************************************************************************************************************************
Start init.sqf
*/

waitUntil{player == player};

//run script that creates all triggers required for the revive script   
[] execVM "POW_sqf\trigger_mkr.sqf";

sleep 0.5;

//Variables required for onConnect script and triggers
onConnect = true;
PublicVariable "onConnect";

//Initialise revive script
server execVM "revive_init.sqf";

CH1 addAction ["Pick Up", "mando_pickup.sqf"];
CH2 addAction ["Pick Up", "mando_pickup.sqf"];



--------------------------------------------------------------------------------------------------------------------------------------------------

The last 2 lines are the ones that call your script, where CH1 and CH2 are the names of the 2 helicopters in my mission which will be able to lift cargo.
Title: Re: Heli Hitching Script
Post by: Mandoble on 11 Jun 2008, 00:49:57
You are missing the mando_hitch.sqf

Code: [Select]
/*
  INITIALISATION SCRIPT

******************************************************************************************************************************
Start init.sqf
*/
// Executed for everyone, including the server with or without player
[7]execVM"mando_hitch.sqf";

waitUntil{player == player};

//run script that creates all triggers required for the revive script   
[] execVM "POW_sqf\trigger_mkr.sqf";

sleep 0.5;

//Variables required for onConnect script and triggers
onConnect = true;
PublicVariable "onConnect";

//Initialise revive script
server execVM "revive_init.sqf";

CH1 addAction ["Pick Up", "mando_pickup.sqf"];
CH2 addAction ["Pick Up", "mando_pickup.sqf"];
Title: Re: Heli Hitching Script
Post by: ricnunes on 11 Jun 2008, 01:15:32
DAMM, I'm such an idiot! That was exactly the problem! How could I make such a naive mistake, sorry for this false alarm  :-[

But yes, I've notice the bouncing cargo problem.
Title: Re: Heli Hitching Script
Post by: Mandoble on 11 Jun 2008, 22:57:05
Try this (this is getting interesting ;) )
Title: Re: Heli Hitching Script
Post by: ricnunes on 12 Jun 2008, 00:44:22
Hi mandoble,

Tested your most recent script and it worked very well and now the cargo bounces much less than before.

But I'm getting one problem, which is when I enter as pilot for the first time in the lifter helicopter I get the following error message:

"Resource title mando_hitch_hud not found"


Probably I did something wrong, but I can't find what...
Title: Re: Heli Hitching Script
Post by: Mandoble on 12 Jun 2008, 00:49:52
Now you need to modify also a bit of description.ext file, just check the example. You have a now HUD info about potential cargo nearest to you so you can aim, aproach and pick up cargo without using any external view.
Title: Re: Heli Hitching Script
Post by: ricnunes on 12 Jun 2008, 01:00:18
Well I added the lines in your description.ext file into mine. Don't have a clue of what should I add more or what I should modify. Actually my description.ext is the following:

class Header
{
  gameType = Coop;
  minPlayers = 1;
  maxPlayers = 28;
};

class RscTitles
{
#include "mando_hitch\mando_hitch_titles.h"
};


#include "EMSI_Data\EMSI_UAV_display.hpp"
#include "EMSI_Data\EMSI_UAV_console.hpp"
#include "EMSI_Data\EMSI_UAV_map.hpp"

onLoadMission = "Operation Sakah Freedom - Part1 - Insurgence";
OnLoadMissionTime = FALSE;

//description.ext settings for revive
respawn = "INSTANT";
respawndelay = 4;

#include "revive_sqf\dialogs\respawn_button_1.hpp"
#include "revive_sqf\dialogs\respawn_button_2.hpp"
#include "revive_sqf\dialogs\respawn_button_3.hpp"
#include "revive_sqf\dialogs\respawn_button_4.hpp"
#include "revive_sqf\dialogs\respawn_button_1b.hpp"
#include "revive_sqf\dialogs\respawn_button_2b.hpp"
#include "revive_sqf\dialogs\respawn_button_3b.hpp"
#include "revive_sqf\dialogs\respawn_button_4b.hpp"
#include "revive_sqf\dialogs\config.cpp"
#include "revive_sqf\dialogs\rev_cam_dialog.hpp"

// Include spectating script resource
#include "spect\spectating.hpp"

///////////////////////////////////////////////////////////////////////////////////////////
titleParam2 = "Number of Revives:";
valuesParam2[] = {1000,20,10,7,5};
defValueParam2 = 7;
textsParam2[] = {"Infinite - Cadet","20 - Easy ","10 - Normal","7 - Hard","5 - Extreme"};
///////////////////////////////////////////////////////////////////////////////////////////
Title: Re: Heli Hitching Script
Post by: Mandoble on 12 Jun 2008, 01:22:12
This
Code: [Select]
#include "mando_hitch\mando_hitch_titles.h"included inside your RscTitles section is all you need for the hitching hud.
Title: Re: Heli Hitching Script
Post by: ricnunes on 12 Jun 2008, 02:43:10
Actually I did something simplier, I commented the lines regarding the "HUD code" and left only the essencial lift code. It's working very well now!

Again, thanks very much for your help! I certainly wouldn't have done it without your help.
Title: Re: Heli Hitching Script
Post by: Shadow.D. ^BOB^ on 13 Jun 2008, 15:11:54
Yet more fantastic scripts  :D  Just replaced my current hitch system with this, works great.  Mandoble is there anyway to have the "Too high for cargo" and "Correct height" text on the hud, only appear once your on approach (have the cargo sighted in the hud), and not when your flying around normally?  ATM I've just taken the text out of the script, but fo people who have trouble judging height etc it'll be easier to have it in.

Also would it be possible to define what helicopters could lift?  i.e  not be able to lift an M1A1.  I see the script is called to the helicopter by enterin the vehicle name in the init file, could the script be added by vehicle class instead? to solve any respawn issues that might arise.

We ask so much of you i know, but rest assured we appreciate it all. Arma in general is lucky to have people like you in the community.
Cheers...

P.S. Appologies if there are any words with letters missing, too many coffee's spilt on the keyboard are taking their toll :)
Title: Re: Heli Hitching Script
Post by: Mandoble on 13 Jun 2008, 15:20:32
Yes, the texts can be shown only when a potential cargo is detected.
Yes, I may add an array of potential cargo types, so you can only hitch these types.
About having the hitching option by type and not by unit name, yes, it is possible, but risky. I mean, lets say you have 20 UH60MG in your mission, are all of them going to be able to hitch vehicles?
Title: Re: Heli Hitching Script
Post by: Shadow.D. ^BOB^ on 13 Jun 2008, 16:39:17
True, i guess it would be up to the mission maker to make only a couple available.  I suppose it all depends on the setup and type of mission, for those who only want select vehicles the name initialisation could be used, then the vehicle type for other situations.  If it is possible to have the two different methods i mean.
Title: Re: Heli Hitching Script
Post by: Mandoble on 13 Jun 2008, 22:24:36
well Shadow, everything is now here (http://www.ofpec.com/ed_depot/index.php?action=details&id=552&page=0) ;)

Hitching choppers by type or name, array of hitchable vehicles, etc.
Title: Re: Heli Hitching Script
Post by: Shadow.D. ^BOB^ on 14 Jun 2008, 03:27:47
Well Mandoble, what can i say  :clap: :clap: :clap:

Well done old chap..
Title: Re: Heli Hitching Script
Post by: ricnunes on 15 Jun 2008, 17:04:15
Hi Mando,

I've been testing the version previous to the last one of your Heli Hitching Script (previous to the one that you posted at Armaholic) and I found a little bug in which sometimes while running the mission in a dedicated server and when droping the cargo/vehicle at higher altitudes the cargo/vehicle instead of falling to the ground it simply stays "floating" in the air. Sometimes after shooting that same vehicle it will fall to the ground, sometimes don't.
But again, this wasn't with your very last version.
So want to ask if you were aware of this bug and if the last version corrects this?
Title: Re: Heli Hitching Script
Post by: Mandoble on 15 Jun 2008, 21:10:31
That problem was mentioned previously and also mentioned here the problem is gone with the current version.
Title: Re: Heli Hitching Script
Post by: ricnunes on 15 Jun 2008, 22:28:57
Great news!

I have one more question:
I would like to increass the list of vehicles that can be picked up and transported to include the followings:
"Truck", "M113", "HMMWV50", "SkodaBase", "hilux1_civil_1_open", "DATSUN_PK1", "HILUX_PK1"

I know how to do this in the previous versions of your script, but I wasn't able to do this in this latest version of the script (I can only define 2 "types" of vehicles in the script).
So my question is, how can include those vehicle types in this latest version of the script?

Thanks in advance for replies.
Title: Re: Heli Hitching Script
Post by: Mandoble on 15 Jun 2008, 22:56:53
BTW, what about taking 5 mins to read the readme and script headers of the current version. All that is supported and explained there  ;)
Title: Re: Heli Hitching Script
Post by: ricnunes on 16 Jun 2008, 03:22:13
Yes, you're right but I did read the readme and played with the mando_hitch_types array but for some reason I was getting script errors.
After reading your reply, I decided to start again an play with the same values and now everything went OK. Certainly I did something wrong in my previous atempt!

Thanks for the reply  :D