Jump to content
Sign in to follow this  
mf1st0

Spearhead 1944 Scripts - Gun Towing

Recommended Posts

On vehicle initialization I am able to automatically hitch a closely placed gun with the following code example:

waitUntil { alive towable_gun_name };
this call SPE_System_Artillery_Towing_Statement_Attach_Wheeled_APCs;

 

After the game starts and the vehicle moves to a particular waypoint, I would like the gun to unhitch automatically using only scripts.  A live player can unhitch without problems, but using this script call  generates errors. Replacing the vehicle name with the gun name does not work either.

[vehicle_name] call SPE_System_Artillery_Towing_Drop_Wheeled_APCs;

 

Any insights on the actual parameters required for this function or another mechanism to unhitch the gun would be appreciated.

 

Share this post


Link to post
Share on other sites

I don't own Spearhead so I can't check, but you can read through the function in the function viewer (in Eden editor) to find the params passed.

Share this post


Link to post
Share on other sites

I have already checked function viewer, but could not find this particular function listed.  It was listed in the the config viewer for various vehicles. Not sure why it shows up in one place, but details are not available how to call correctly.

Share this post


Link to post
Share on other sites

The ones with wheels will tow automatically with some vehicles, maybe all, I haven't tried it with all. They unhook when you want them to.

 

I loaded an 88 into the back of a German truck with a script, sticks out the side and looks bad but it does work. You could attach it or the others to the back of whatever with a script. The gun and vehicle need to be named to do that. I'm working on doing it unnamed. They didn't give the US the deuce and a half yet, which is weird. The US trucks they did put in the dlc are not as good as the German trucks.

Share this post


Link to post
Share on other sites

Hes trying to get the gun to un-hitch from an AI controlled vehicle when it gets to a selected waypoint.  as he said hes got the gun to hitch with out player interaction, just cant find the secret sauce to get it to unhitch. 

Share this post


Link to post
Share on other sites

@Hammer 1_2 Have you tried asking for help on Arma 3's official Discord server? Spearhead 1944 Creator DLC has a dedicated channel there.

Share this post


Link to post
Share on other sites
6 minutes ago, kaject said:

@Hammer 1_2 Have you tried asking for help on Arma 3's official Discord server? Spearhead 1944 Creator DLC has a dedicated channel there.

No we hadn't thought of that! thanks for the suggestion 👍

 

Share this post


Link to post
Share on other sites
36 minutes ago, Hammer 1_2 said:

Hes trying to get the gun to un-hitch from an AI controlled vehicle when it gets to a selected waypoint.  as he said hes got the gun to hitch with out player interaction, just cant find the secret sauce to get it to unhitch. 

Oh, AI controlled. Man, I can't imagine how hard thats going to be. Getting the AI to hitch up and unhitch.

Share this post


Link to post
Share on other sites
10 hours ago, Alleged Accomplice said:

Oh, AI controlled. Man, I can't imagine how hard thats going to be. Getting the AI to hitch up and unhitch.

Mf1st0 figured out the AI Hitch up, just the logical Un-hitch dont work , and we cant find any reference to it in the Config viewer.

Share this post


Link to post
Share on other sites

 

8 hours ago, Hammer 1_2 said:

Mf1st0 figured out the AI Hitch up, just the logical Un-hitch dont work , and we cant find any reference to it in the Config viewer.

Yeah, even if you attached a trigger to it you'd need to know what action to call

Share this post


Link to post
Share on other sites

Better way to hitch guns is via:

 

[vehicle,gun] call SPE_System_Artillery_Towing_Statement_Attach_Trucks;

 

this lets you specify the static you want towed rather than the nearest one

 

[vehicle,gun] call SPE_System_Artillery_Towing_Statement_Drop_General;

will stop towing.

 

what script errors were you getting

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Kerc Kasha said:

what script errors

 

Looks like they just didn't know what params to pass.

Share this post


Link to post
Share on other sites

Happy to report that passing the correct parameters as shown by Kerc Kasha does work to unhitch guns with both these function calls:

[vehicle,gun] call SPE_System_Artillery_Towing_Statement_Drop_General;    and

[vehicle,gun] call SPE_System_Artillery_Towing_Statement_Drop_Wheeled_APCs;

 

Thanks to all for your prompt assistance.

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×