Jump to content

Recommended Posts

I was looking for a fast-rope script to use in a mission. I found this thread. I used the script made by zealot111 as the base for my script. All credits should go to him for the basic idea. I just rewrote it to include a queue, and other small changes.

 

The main goal, for me, was human player usage only, but the script will also rope down AI members of a group whose leader is human player.

 

SHK_Fastrope.sqf

Example mission

 

 

Usage

 

1. Copy the script file into your mission folder

2. Open (or create) initPlayerLocal.sqf in your mission folder

3. Add this line into the file (no semi-colon at the end of the line):

#include "SHK_Fastrope.sqf"

Example using Ghost Hawk (chopper leaving after all units are on the ground is done by trigger, not by the script)

 

  • Like 6

Share this post


Link to post
Share on other sites

As always, I'm eager to hear about any bugs as I haven't been able to heavily test it in MP. Other suggestions etc are welcome as well.

Share this post


Link to post
Share on other sites

I'm wondering, and sorry I'm new to adding scripts to missions.

Everything works great but could I get some clarification of the function of initPlayerLocal.sqf?

For MP missions is this supposed to replace init.sqf?

I currently have both files in my mission root and wasn't sure if that was acceptable. Init.sqf is currently initiating some other scripts I'm using and wasn't sure if I should either initiate yours there instead or move the others over to the init.sqf? Or is having both ok?

Share this post


Link to post
Share on other sites

Both init.sqf and initplayerlocal.sqf can be run simultaniously in a mission.

initplayerlocal is basically a init.sqf that runs the scripts in it locally on a client. Meaning that script is not performed by the server.

Why this script is run locally I have no idea though.

(Sorry if thats not entirely true. Thats just what I understood of it. I'm using these two .sqf files in my missions as well!)

Share this post


Link to post
Share on other sites

Yeah I don't want to go totally OT here so I'll make this my last question on the subject, but it makes me wonder if I should move some of my others here. Specifically, the automedic script isn't working for me (only in MP. It works in SP) and wasn't sure if for MP/online only missions if initPlayerLocal.sqf was the "right" file to use for initiating all my scripts.

Not only that but since using this initPlayerLocal.sqf to initiate this script (I was previously using the original in init.sqf) my FPS has dropped noticeably when using the MP editor. Not sure if that's a coincidence or not.

Share this post


Link to post
Share on other sites

Two very helpful wiki links concerning init order and the various event files:

 

https://community.bistudio.com/wiki/Event_Scripts

 

https://community.bistudio.com/wiki/Initialization_Order

 

 

init.sqf - runs on ALL machines at mission start

initPlayerLocal.sqf - runs only on clients at mission start (including HC and JIP when player joins)

initServer.sqf - runs only on server at mission start

 

 

edit:  sorry for the offtopic SHK - another great script from you.. thanks!!

  • Like 1

Share this post


Link to post
Share on other sites

Looks very good. Have you any plans to release an addon version?

 

I've never made any addons, and I don't even know how. I don't really see how it would much benefit of being an addon instead of a script.

Share this post


Link to post
Share on other sites

I'm wondering, and sorry I'm new to adding scripts to missions.

Everything works great but could I get some clarification of the function of initPlayerLocal.sqf?

For MP missions is this supposed to replace init.sqf?

I currently have both files in my mission root and wasn't sure if that was acceptable. Init.sqf is currently initiating some other scripts I'm using and wasn't sure if I should either initiate yours there instead or move the others over to the init.sqf? Or is having both ok?

 

As was already mostly cleared by others. You can call this from init.sqf as well, as long as you wait for the client (human player's machine) to get control of the unit object he/she will play. In other words, player object/command can be null for a moment in init.sqf. So, calling this script from initPlayerLocal.sqf just avoids having to add something like: waituntil not isnull player

 

It shouldn't make any difference from which of these files your scripts are called, apart from the obvious fact that the player.sqf is not run on the server. Though, I assume it will be run on a listen/hosted server for the hosting player as well, but not on dedicated server.

Share this post


Link to post
Share on other sites

I've never made any addons, and I don't even know how. I don't really see how it would much benefit of being an addon instead of a script.

Only benefit in the scope of moving a script such as yours to an addon basically means that the mission makers don't have to go back to all their projects and add this script or update it in each mission file in the future.

  • Like 1

Share this post


Link to post
Share on other sites

As was already mostly cleared by others. You can call this from init.sqf as well, as long as you wait for the client (human player's machine) to get control of the unit object he/she will play. In other words, player object/command can be null for a moment in init.sqf. So, calling this script from initPlayerLocal.sqf just avoids having to add something like: waituntil not isnull player

 

It shouldn't make any difference from which of these files your scripts are called, apart from the obvious fact that the player.sqf is not run on the server. Though, I assume it will be run on a listen/hosted server for the hosting player as well, but not on dedicated server.

I'm using a dedicated server (TADST). I host the mission on the same machine as my client. Are the install instructions in the first post still the recommended way for me to use this script?

Share this post


Link to post
Share on other sites

I'm using a dedicated server (TADST). I host the mission on the same machine as my client. Are the install instructions in the first post still the recommended way for me to use this script?

 

Yes.

  • Like 1

Share this post


Link to post
Share on other sites

Only benefit in the scope of moving a script such as yours to an addon basically means that the mission makers don't have to go back to all their projects and add this script or update it in each mission file in the future.

 

Then everyone would need to get the addon to play. ;)

 

Anyway, as I said, I don't know how to make one. People are free to add the script to whatever addons they want.

Share this post


Link to post
Share on other sites

         //Melb
     ["MELB_MH6M",[],[[1.2,0.8,-0.1],[-1.2,0.8,-0.1]]]

 

Thanks, great work :)

Share this post


Link to post
Share on other sites

         //Melb

     ["MELB_MH6M",[],[[1.2,0.8,-0.1],[-1.2,0.8,-0.1]]]

 

Thanks, great work :)

 

Thanks, added.

Share this post


Link to post
Share on other sites

Hi, me and my team tried your script on our server, on your mission it worked very well but when we put it in our missions it doesn't seem to start. We tried to execute it with the debug console and it worked but using execVM instead of #include. We tried to use execVM on the initPlayerLocal.sqf and init.sqf but it doesn't start aswell. We aren't able to figure out how to make it work. If you could help us it will be appreciated man. 

Thank you from the Italian Special Assault Squad Team

 

http://www.specialassaultsquad.it/

  • Like 1

Share this post


Link to post
Share on other sites

We tried to use execVM on the initPlayerLocal.sqf and init.sqf but it doesn't start aswell.

 

I can understand if #include doesn't work, but there has to be something really wrong if execvm from initplayerlocal doesn't work either. I really can't help much without the mission/init files. If I'd have to take a pure guess, I'd say you could be missing a semi-colon ( ;) from end of some line, which would prevent rest/other parts of the (init) script working.

 

This fastrope script is very simple script really. All it does it create few global variables (functions) and then adds 3 actions to the player.

Share this post


Link to post
Share on other sites

Hi,

 

I'm asking this by curiosity about ropes, as you sure researched much more than me.

 

In order to see a more dynamic, visual attractive fastrope system. Is it posible to just attach the ropes to a soldier, and then change gradually the rope lenght until the soldier reaches the floor?

 

Why?, because maybe we will see some balancing movement in this way, and not a straight dawnward, hope you know what I mean...

 

I know this could be done playing a bit with setvelocity, but maybe the engine can do it for you...

Share this post


Link to post
Share on other sites

You can quite easily say you have a chopper at around 90meters named heli and a man named man placed in the editor  just for testing and not using existing script above.

 

now create the rope then unwind it

 

rope=ropeCreate [heli, [0,0,0.5], man, [0,0,0.5], 6];ropeUnwind [rope, 50, 100]

 

it looks a little jerky to me.

 

 

If you do want the ropes to lower in the current version just change this line in this function  SHK_Fastrope_fnc_createRopes = {

_rope = ropeCreate [_heli, _x, (getPosATL player select 2) +3];

to

  _rope = ropeCreate [_heli, _x, 1];
       ropeunwind [_rope,250,(getPosATL player select 2) +3];

and to rewind change in SHK_Fastrope_fnc_cutRopes = {

ropeCut [_x,0];

to

_length = ropeLength _x;
        ropeUnwind  [_x,25,-_length,true];

Although  the toss rope action may need disabling while the rope is winding winding.

Share this post


Link to post
Share on other sites

Respawn compatibility...

SHK_fnc_addaction = {
player addAction["<t color='#ffff00'>"+STR_TOSS_ROPES+"</t>", SHK_Fastrope_fnc_createRopes, [], -1, false, false, '','call SHK_Fastrope_fnc_canCreate'];
player addAction["<t color='#ff0000'>"+STR_CUT_ROPES+"</t>", SHK_Fastrope_fnc_cutRopes, [], -1, false, false, '','count (objectParent player getVariable ["SHK_Fastrope_Ropes",[]]) > 0'];
player addAction["<t color='#00ff00'>"+STR_FAST_ROPE+"</t>", SHK_Fastrope_fnc_queueUp, [], 15, false, false, '','call SHK_Fastrope_fnc_canFastrope'];
};

call SHK_fnc_addaction;

player addEventHandler ["Respawn", {call SHK_fnc_addaction;}];

 

  • Like 1

Share this post


Link to post
Share on other sites

Respawn compatibility...

 

 

Added, thanks again!

Share this post


Link to post
Share on other sites

Hi, me and my team tried your script on our server, on your mission it worked very well but when we put it in our missions it doesn't seem to start. We tried to execute it with the debug console and it worked but using execVM instead of #include. We tried to use execVM on the initPlayerLocal.sqf and init.sqf but it doesn't start aswell. We aren't able to figure out how to make it work. If you could help us it will be appreciated man. 

Thank you from the Italian Special Assault Squad Team

We solved it by using an object with an addAcction that executes the script when needed. Thanks for the awesome job you have done :)

Share this post


Link to post
Share on other sites

Respawn compatibility...

SHK_fnc_addaction = {

player addAction["<t color='#ffff00'>"+STR_TOSS_ROPES+"</t>", SHK_Fastrope_fnc_createRopes, [], -1, false, false, '','call SHK_Fastrope_fnc_canCreate'];

player addAction["<t color='#ff0000'>"+STR_CUT_ROPES+"</t>", SHK_Fastrope_fnc_cutRopes, [], -1, false, false, '','count (objectParent player getVariable ["SHK_Fastrope_Ropes",[]]) > 0'];

player addAction["<t color='#00ff00'>"+STR_FAST_ROPE+"</t>", SHK_Fastrope_fnc_queueUp, [], 15, false, false, '','call SHK_Fastrope_fnc_canFastrope'];

};

call SHK_fnc_addaction;

player addEventHandler ["Respawn", {call SHK_fnc_addaction;}];

 

Where do i put this? do i replace the last three lines in SHK_fastrope.sqf with this?

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

×