Works like in the movies. Grappling hook for modders to add to their maps. Includes ODF, effects, model , and LUA code
Here it is in action: Youtube.com
Here it is following the trajectory of the hook: Youtube.com (it looks smoother in this release)
Grappling Hook by MileHighGuy
This asset is for modders to add a grappling hook weapon to their map. You cannot use it if you do not have the mod tools
To use:
Give on of your units the grappling hook weapon "rep_weap_inf_grapplinghook_weapon"
Add grapplinghook.lua to data_***/Common/scripts
Add "grapplinghook" to mission.req under the "script" section so the script gets added to the .lvl file
the mission.req is in data_***/Common/mission.req
Add ScriptCB_DoFile("grapplinghook") to the top of your map's mission LUA, so the script gets loaded
Add enableGrapplingHook("rep_bldg_inf_grapplinghook", 100) inside the ScriptInit() function in your map's LUA. Next to where the script loads the sides.
The first argument is the name of the deployed grappling hook ODF (not the weapon that dispenses it),
the second argument is grapple speed in meters/second.
Alternatively, you can use the function enableGrapplingHookFollowTrajectory("rep_bldg_inf_grapplinghook", 100)
Use this function if you decide to give the grappling hook gravity. It will make the unit follow the arc of the hook instead of straight to it.
If you can code, make an effort to look at the lua code, otherwise its plug and play.
If you have any question or find any bugs, reach me on Gametoast.com
This is version 2 where I added the trajectory following
March 1 2021: added some fixes for stability and hopefully work in multiplayer (untested)
make sure you make the grappling hook a secondary weapon. Otherwise you will have to change the ODF to make it a primary weapon. It's a small change. I think if you want it to be a primary weapon you just add an AnimationName paramter and remove the OffHandWeapon and FireAnim parameters.