To the expert scripting guys. I need some help with modifying a piece of code. Read first:
Code34 arranged his warcontext script in his "war in takistan" mission. My interest is making this sub-script (WC_fnc_computeavillage.sqf) work again. In older versions it worked. This script is setting up some buildings, which are in the array, if the location that was picked dynamically is in the open field. Take a look at this:
I remeber that it worked fine, so you got a lot of positions, where missions could take place. But right now, the whole script is only picking town locations, and no location in the open field and i don't understand why. So this computeavillage script is actually not needed.Code:// ----------------------------------------------- // Author: =[A*C]= code34 nicolas_boiteux@yahoo.fr // Compute a wild village ! // ----------------------------------------------- private [ "_size", "_vehicle", "_vehicles", "_location", "_position", "_isflat", "_dir" ]; _location = _this select 0; _vehicles = []; for "_i" from 0 to ceil(random(100)) do { _position = (position _location) findEmptyPosition [(5 + random 10), 400]; if(count(_position nearRoads 15) == 0) then { _isflat = _position isflatempty [5, 0, 0.3, 20, 0, false]; if (count _isflat != 0) then { _vehicle = (["Land_House_C_5_V3_EP1", "Land_House_C_5_EP1", "Land_House_L_8_EP1", "Land_House_K_3_EP1", "Land_House_C_5_V1_EP1", "Land_A_Mosque_small_2_EP1", "Land_Wall_L_Mosque_1_EP1", "Land_A_Mosque_small_1_EP1", "Land_House_L_7_EP1", "Land_House_K_5_EP1", "Land_House_K_1_EP1", "Land_House_L_6_EP1", "Land_House_L_9_EP1", "Land_House_L_4_EP1", "Land_House_L_3_EP1", "Land_Wall_L3_5m_EP1"] call BIS_fnc_selectRandom) createvehicle _position; _vehicle setdir (random 360); _vehicles = _vehicles + [_vehicle]; }; }; sleep 0.005; }; wcobjecttodelete = wcobjecttodelete + _vehicles; diag_log "WARCONTEXT: COMPUTING A VILLAGE";
In the mission itself you can generate dynamic locations for missions. The point is, the script is only picking towns for possible mission locations. Ingame, as admin, i can enter that operation plan and recompute some new locations. So that should be the starting point, where you should look. It's the script called WC_fnc_serverside.sqf.
In line 228 you find this :
So ingame, when i press that recompute button, i get new possible locations, so i guess thats the start of that whole thing. so WC_fnc_createlistofmissions; is being called..Code:// recompute the list of missions when admin asks WC_fnc_netcode_wcrecomputemission = { wcgarbage = [] spawn WC_fnc_createlistofmissions; };
In that WC_fnc_createlistofmissions in line 88 its:
I think that should be the correct entry, and that links me to WC_fnc_relocateposition...so i looked into that script, in there i found another link to WC_fnc_creategridofposition; ... And now i'm pretty lost.Code:_position = wczonelocations call BIS_fnc_selectRandom; _position = [_position] call WC_fnc_relocateposition; while { _position distance getmarkerpos "respawn_west" < 1000} do { _position = wczonelocations call BIS_fnc_selectRandom; _position = [_position] call WC_fnc_relocateposition; sleep 0.05; };
Scripts i found in that warcontext folder regarding locations or terrain specifications are:
WC_fnc_creategridofposition.sqf
WC_fnc_createlistofmissions.sqf
WC_fnc_createposition.sqf
WC_fnc_getterraformvariance.sqf
WC_fnc_relocatelocation.sqf
WC_fnc_relocateposition.sqf
There is also stuff like BIS_randomlocation or something like that, i'm pretty familiar with editing this whole mission, but this location finding process that's happening while pressing that button is something that i really don't get. All i want is the script to find random locations again, also open field, hilltops or whatever, and not only town locations, like it's doing right now. I already asked the author but he seems to be afk right now.
If there's anybody out there, who can read codes and scripts, like i read books., any help appreciated..
DL this FIle: http://www63.zippyshare.com/v/35495855/file.html
EDIT: maybe also take a look at that WC_fnc_mainloop.sqf
cheers
Rudy
HOME 
Reply With Quote