Donn Chocolat Tools

Donnovan

Member
Chocolat Tools is a Self Action Option that you can turn on/off any moment.

Chocolat Tools Off: Game plays as normal.

Chocolat Tools On:

1) Land vehicles *1000 m arround player have a chance of *50% to be show on map:
- Turn on/off Chocolat Tools don't change the land vehicles that are show and not show.
- New land vehicles have also a *50% chance to be show on map.
- If the player enters a land vehicle that is not show on map, the land vehicle will be show on map.
- Diferent players can see diferent land vehicles.

Extras:

2) Player icon on map:
- Player position and direction is show on map.
- If player enters in a land vehicles, the player icon turns in a blue land vehicle icon.

3) Player step marks:
- With chocolat on, player steps are marked on map on a *250 m evolution.
- Steps are marked with a arrow pointing in the direction of travel.
- A message show on screen the total travel distance each *5 km.
- Running on the same place does not generate steps on map, and does not count as travel distance.

* configurable.

INSTALLATION!
Chocolat consists in only two files:

File 1) code that goes on fn_selfActions.sqf

The Self Action code: place this code on the bottom of your custom fn_selfActions.sqf file.
Code:
//CHOCOLAT TOOLS SELF ACTION VARIABLES
if (isNil "s_don_nearveh_a" || isNil "s_don_nearveh_b" || isNil "s_don_nearveh_onoff") then {
    s_don_nearveh_a = -1;
    s_don_nearveh_b = -1;
    s_don_nearveh_onoff = 0;
};
//CHOCOLAT TOOLS ON
if (s_don_nearveh_a < 0 && s_don_nearveh_onoff == 0) then {
    s_don_nearveh_a = player addaction[("<t color=""#0044aa"">" + ("Turn On Chocolat Tools [ON]") +"</t>"),"custom\nearveh.sqf","",5,false,true,"", ""];
};
//CHOCOLAT TOOLS OFF
if (s_don_nearveh_b < 0 && s_don_nearveh_onoff == 1) then {
    s_don_nearveh_b = player addaction[("<t color=""#0044aa"">" + ("Turn Off Chocolat Tools [OFF]") +"</t>"),"custom\nearveh.sqf","",5,false,true,"", ""];
};

File 2) nearveh.sqf

The Chocolat Script code (nearveh.sqf): put the file, on the link bellow, in YourMissionFolder\custom\nearveh.sqf. Create \custom\ if necessary.

Download nearveh.sqf [release 2a]: http://s000.tinyupload.com/index.php?file_id=45508209614622178641

End - Any problem, opnion, idea, fell free to ask or comment on http://opendayz.net/threads/help-donn-chocolat-tool.19722/. The code is comented.


Old Stuff:

nearveh.sqf old files - you don't need this anymore:
[release 1] - http://s000.tinyupload.com/index.php?file_id=77760897432237511020
[release 2] - http://s000.tinyupload.com/index.php?file_id=30863918738811412986
 
Last edited:
Bug found and fixed. The bug was:

On nearveh.sqf [release 1] your [Chance Of Vehicle Show On Map] will be changed from the desired value x (50% default) to: x+(x/100)*(100-x).

So the Default value of 50% will turn into 50+(50/100)*(100-50), that is, 75%.
A value of 30% will be changed to 51%.

The fix is a new nearveh.sqf [release 2]:
http://s000.tinyupload.com/index.php?file_id=30863918738811412986

Main topic updated.

One line changed. The line:

{if ((random 1) <= don_chance_to_show) then {don_random_veh_list = don_random_veh_list + [_x];};} forEach (Entities "LandVehicle");

Was changed to:

{if ((random 1) <= don_chance_to_show) then {don_random_veh_list = don_random_veh_list + [_x];} else {don_random_veh_list_out = don_random_veh_list_out + [_x];};} forEach (Entities "LandVehicle");
 
Last edited:
Minor Bug found is nearveh.sqf and fixed with nearveh.sqf [release 2a]:

Message "Your travel mark is now5 KM."

(5 KM, 10 KM, 15 KM, 20 KM...)

Changed to "Your travel mark is now 5 KM"

A space was missing after "now".
 
Back
Top