Jump to content

Recommended Posts

I'm the leader of an Arma 3 milsim unit, and I'm attempting to complete a shoot-house with moving targets. How do I script an object (namely a target) to cycle movement directions? I'm specifically asking for the initialization script for cycling movement directions for objects in the 3den Editor. Please state the specific steps required to complete these actions, because I'm new to scripting, and as much as I would like to learn how to do it, I simply don't have that much time to dedicate.

Share this post


Link to post
Share on other sites
6 hours ago, pierremgi said:

movement directions?

I can toggle raise/lay a popup target like here, but what do you mean?

I meant the cycling of movement directions from left/right to right/left; an example of this: 

Also, I would like to know how to script the targets so that when they're shot, they lay on the ground without popping back up.

Share this post


Link to post
Share on other sites
18 hours ago, pierremgi said:

For such target, you need to script something like this code.

Thank you for the instructions, but is there any instructions for this in English? I translated it from German to English, but the grammar can be quite difficult to understand, although possible.

Share this post


Link to post
Share on other sites
4 hours ago, Harzach said:


The scripts are commented in English and there is an example mission you can look at to see how it all works.

Sent from my SM-G930P using Tapatalk
 

I created the .sqf files in the mpmissions folder (4 of them including the init.sqf). What script do I paste into the initialization script for the rail and/or the moving target to enable the target to move upon the rail?

Share this post


Link to post
Share on other sites
11 minutes ago, Harzach said:

Just to be clear, I am not a scripting expert by any means. I am simply in a helpful mood and enjoy solving (or at least exploring) problems like this.

 

It looks like the demo mission is not available anymore. I grabbed the linked code and had a go at it tonight. Right out of the gate, there were problems with consistency in the comments regarding script call examples and a couple of other things, but that was an easy fix. I am currently trying to track down a problem with setVariable not parsing (lines 133-136 of initTargetRailExt.sqf). I can get rails set down perfectly, but the target does not spawn. That said,the real problem lies with MP compatibility. Which is to say, there is no MP compatibility. Even if I could get this working in the editor, it won't work in MP, which is ultimately your goal.

I'll take another crack at it tomorrow, but without the help of a locality guru, it's simply not going to work.

Thank you for the advice, and I hope that your attempt tomorrow will be fruitful.

Share this post


Link to post
Share on other sites
On 6/9/2017 at 1:17 AM, Harzach said:

Couldn't wrap the night without one more look, and so I figured out the problem with the target not spawning - lack of clarity/language barrier in comments, and failure on my end to see through it.

 

I'll attempt to tackle locality tomorrow.

Did you have any results for the locality?

Share this post


Link to post
Share on other sites
On ‎09‎.‎06‎.‎2017 at 6:33 AM, Harzach said:

... but without the help of a locality guru, it's simply not going to work ...

 

You don't need a guru because locality is not a mystery its just thinking about each line of code where it has to be executed and where its arguments have to come from. In most cases a simple remoteExec helps to get a command executed on the needed client. You can look at wiki for each command and u will find there the needed locality informations:

 

Arguments of this scripting command have to be local to the client the command is executed on - Arguments of these scripting commands have to be local to the client the command is executed on.

Arguments of this scripting command don't have to be local to the client the command is executed on - Arguments of these scripting commands don't have to be local to the client the command is executed on.

Effects of this scripting command are not broadcasted over the network and remain local to the client the command is executed on - Effects of these scripting commands are not broadcasted over the network and remain local to the client the command is executed on.

Effects of this scripting command are broadcasted over the network and happen on every computer in the network - Effects of these scripting commands are broadcasted over the network and happen on every computer in the network.

This scripting command must be executed on the server to work properly in multiplayer - Scripting commands that must be executed on the server to function properly

 

Sometimes as in case of setFuel you have additional locality informations in the description of the command. Like this:

 

Quote

Sets fuel percentage from 0 (empty) to 1 (full). The vehicle must be local to the computer where command is executed.

 

This is all you need in most cases and of course u have to think about it. If u just don't care 'bout locality then ur script would probably not work in MP-envitronment.

 

Now for those script u guys r talking 'bout. If you post it here (in a spoiler, plz) then I could take a look at it. Maybe I 'll see something which causes problems in MP.

I can't open the given link above because I'm at work and that URL is forbidden to open for me.

 

 

Share this post


Link to post
Share on other sites
On 6/24/2017 at 2:40 AM, Harzach said:

Note the folder structure of the example mission. All script files are located in a subfolder named "scripts" and are being called accordingly. Since you have not followed the same structure, the files are not being found.

 

Hence "script scripts\initTargetRailExt.sqf not found."

 

Easiest fix is to move the three script files (initTargetRailExt.sqf, moveTargetRailExt.sqf, PopUpTargetExt.sqf) to a new subfolder named "scripts."

why.. tf... did i get redirected to the board in the middle of me typing a message??

Anyways, I did that, therefore not receiving the error, but the rail didn't generate a target, and there were no call signs available in the radio section of the command menu.

Share this post


Link to post
Share on other sites
On 6/29/2017 at 11:14 PM, Harzach said:

Did you place a trigger with a Radio activation?

I did that, and the script successfully spawned the additional rails, but it spawned too many targets. I believe that the script spawned approximately ten (give or take five). Also, I changed the Segment amount to 7 (meters, according to the instructions) and it instead spawned a long line of rails.

Share this post


Link to post
Share on other sites
9 hours ago, Harzach said:

If multiple targets are spawning, I'd guess that's a locality issue. It's mentioned on the source page. You'd see a target for every player on the server. As for the length of the rail, I just tried setting the segment param to "7" and seven rails spawned. Again, maybe a locality thing and seven rails were spawning for each player - though I'd think they would spawn on top of each other in that case. I don't know. If I ever get around to tackling this for MP, I'll be sure to post here.

Please do if possible. It would be much appreciated.

Share this post


Link to post
Share on other sites
On 13/6/2017 at 9:50 PM, Harzach said:

I have not had a chance to test in MP, so I am assuming that the source page is correct in describing this system as not MP-compatible.

 

Is work, but not properly, I mean the target spawn and move but very slowly each 10 seconds more or less.

Do you know how to fix the speed trouble?

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

×