Stoll

[TUTORIAL] Russian Roulette for other maps

18 posts in this topic

Posted (edited)

For those of you who use another map then Altis, you will need to set up the position for the Russian Roulette area. The tricky part for this is that the worldspace data is in PosWorld format (which is similar to ASL).

So, first go to the editor, open your map and choose a spot where you want to place the table and the 5 chairs. Use Land_WoodenTable_large_F and Land_ChairWood_F for this.
Place a unit in the editor, press preview, face the first chair and open the debug console.
Paste this inside: hint str (getPosWorld cursortarget); copyToClipboard str(getPosWorld cursortarget); and execute it.
A hint will show the worldspace data and will copy it to your clipboard. So, paste the first position in your script with CTRL+V. Do the same for the rest of the chairs and the table.

Now we have to get the direction for the items. We don't need degress here (like 90, 180, 270 etc.), we need radians! To calculate from degrees to radians we need the degree values first.
Rightclick on the items, check the variables and copy the directions from each item.
Or use hint str (getDirVisual cursortarget); copyToClipboard str(getDirVisual cursortarget); for this.

Open the debug console again and copy this inside:
hint str (rad x); copyToClipboard str (rad x);
Replace the x with the relating degree directions you got just before. e.a. 330.886 degrees is 5.77505 radians. Once you got all data your line should look like this: [3980.57,8477.3, 158.589],5.77505]
Ensure you merge the radians with the correct PosWorld data.

The file you have to replace the data is the initServer.sqf .
Of course you have to define a spot for the Roulette "Trader" in the initPlayerLocal.sqf with the common worldspace data.
Just place a unit in the editor for this and choose copy position from the menu and replace it. (get direction as described above with a rightclick)
Finally you may place the Exile_Sign_RussianRoulette sign next to the trader.

Happy shooting! :)


EDIT:
This is the code you have to adjust:

Spoiler

_objects =
[
    ["Land_WoodenTable_large_F", [14628.171,16826.014,18.467293], 0, false],
    ["Exile_Sign_RussianRoulette", [14623.898,16820.336, 18.950966], 0.77240193, false],
    ["Land_HumanSkull_F", [14621.056, 16821.572, 18.476805], 2.0025947, false],
    ["Land_WheelCart_F", [14621.334,16821.477, 18.355867], 4.9935374, false],
    ["Land_Camping_Light_F", [14628.075,16825.77, 19.00408], 0, true]
    //["Land_SportGround_fence_F", [14625.692, 16818.945, 18.791378], 0.79693103, false],
    //["Land_SportGround_fence_F", [14633.911, 16816.904, 17.9177], 5.4953084, false],
    //["Land_CargoBox_V1_F", [14619.726, 16823.613, 18.75972], 5.4931207, false],
];

{
    private ["_object"];

    _object = (_x select 0) createVehicle [0,0,0];
    _object setDir (deg (_x select 2));
    _object setPosWorld (_x select 1);
    _object allowDamage false;
    _object enableSimulation (_x select 3);
    _object enableSimulationGlobal (_x select 3);; // :)
}
forEach _objects;

ExileRouletteChairs = [];

ExileRouletteChairPositions =
[
    [[14627.052, 16826.611, 18.004343], 4.9010592],
    [[14629.161, 16826.707, 18.004343], 1.3332222],
    [[14628.180, 16824.557, 18.004343], 3.1448042],
    [[14628.123, 16827.488, 18.004343], 0],
    [[14629.184, 16825.537, 18.034342], 1.7944603],
    [[14627.175, 16825.453, 18.004343], 4.4050193]
];

{
    private ["_chair"];

    _chair = "Land_ChairWood_F" createVehicle [0, 0, 0];
    _chair setDir (deg (_x select 1));
    _chair setPosWorld (_x select 0);
    _chair allowDamage false;
    _chair enableSimulationGlobal true;

    ExileRouletteChairs pushBack _chair;
}
forEach ExileRouletteChairPositions;

To get the needed ASL position for the concrete mixers use:
hint str (getPosASL cursortarget); copyToClipboard str(getPosASL cursortarget);
Code snippet:

Spoiler

_concreteMixers =
[
    [[14354.0, 18960.1, 36.9597],  35], // athira
    [[18309.4, 15575.0, 48.8194],  90], // charkia
    [[11391.2, 14259.5, 21.2141], -40] // alikampos
];

{
    _concreteMixer = "Exile_ConcreteMixer" createVehicle (_x select 0);
    _concreteMixer setDir (_x select 1);
    _concreteMixer setPosASL (_x select 0);
    _concreteMixer allowDamage false;
    _concreteMixer enableSimulationGlobal true;
}
forEach _concreteMixers;

 

Edited by Stoll
10 people like this

Share this post


Link to post
Share on other sites

^^^^^

Legend...Thank you sooo much..Worked out great.

Share this post


Link to post
Share on other sites
Advertisement

Using m3editor works well too. A little less complicated in my opinion.

Share this post


Link to post
Share on other sites
11 hours ago, BetterDeadThanZed said:

Using m3editor works well too. A little less complicated in my opinion.

Hay zed, is there another way to extract the direction as  radian from m3editor, i have tried pasting the code snippets provided into the console but when i hit execute i see no "hint".

 

ive got it working fine i just cant get the  convert to  radian.

 

 

Share this post


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

Hay zed, is there another way to extract the direction as  radian from m3editor, i have tried pasting the code snippets provided into the console but when i hit execute i see no "hint".

ive got it working fine i just cant get the  convert to  radian.

I use m3editor 0.18. I just select the option to copy the code and then I paste it into Notepad++ to get the coordinates.

Share this post


Link to post
Share on other sites

Posted (edited)

6 hours ago, xzerokoolx said:

Hay zed, is there another way to extract the direction as  radian from m3editor, i have tried pasting the code snippets provided into the console but when i hit execute i see no "hint".

 

ive got it working fine i just cant get the  convert to  radian.

 

 

I don't see any reason for using the M3Editor, but that's up to you.
In the end it's the same. Open the debug console and paste this snippet inside:
hint str (rad 329); copyToClipboard str(rad 329);
Where 329 is an example of a degree direction you grabbed before from the item.
Once you executed this you will see the radian on the screen and it's copied as well to your clipboard.
Like Zed said, paste it into your notepad and that's it.

Updated my main post with some additional information.

Edited by Stoll
1 person likes this

Share this post


Link to post
Share on other sites

Posted (edited)

Thanks for that, works like a charm.9_9

Edited by pomp4h

Share this post


Link to post
Share on other sites

Posted (edited)

1 hour ago, pomp4h said:

Thanks for that, works like a charm.9_9

Thanks, it was quite easy to set this up for another map.
But even when it's working, I have some major issues. I opened a threat in the "Ask a developer" section about it, but it's pending since last tuesday. I don't expect to get an answer on this anymore.
So I would like to know, how it works for you:

The issues I encountered are:

1.) The chair does not fall over when a player shots himself. He just falls from the chair.
2.) After the game the chair the player died on, will hurt and kill you when you walk into it!
    The chairs who were not used don't do any damage.
3.) I wondered about the line ExileRouletteChairs = [];
So I thought about to define two chair positions? One position for the start and one position for the fallen over chair? Overall, I don't think it's needed, because I got the main part from the default Altis script and it's not defined there.
However I tried it anyway, but I'm getting errors and the script doesn't start.

It's a bit annoying, I don't want to fence the area or place the stuff in a locked house. Others should be able to watch the scene imo and I really hate it when I don't get problems solved...so check it out please...maybe we can solve this miracle :)

Edited by Stoll

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.