Results 1 to 3 of 3

Thread: Help with script

  1. #1

    Help with script

    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:

    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";
    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.


    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 :

    Code:
    // recompute the list of missions when admin asks
    	WC_fnc_netcode_wcrecomputemission = {
    		wcgarbage = [] spawn WC_fnc_createlistofmissions;
    	};
    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..

    In that WC_fnc_createlistofmissions in line 88 its:
    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;
    		};
    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.

    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
    Last edited by Fruity_Rudy; Apr 25 2012 at 13:07.

  2. #2
    Master Gunnery Sergeant twirly's Avatar
    Join Date
    Sep 13 2010
    Location
    Gods Own (NZ)
    Posts
    1,302
    How about asking the author of the script.... that's a lot to take in mate.

    "Learn by doing!" - Quoted from a post by Imutep

    OUTERRA - OUTERRA - OUTERRA - OUTERRA - BLOWMIND!

  3. #3
    Gunnery Sergeant Fruity_Rudy's Avatar
    Join Date
    Nov 16 2010
    Location
    Wupper-Valley
    Posts
    577
    Author of the Thread
    yeah i know, he's back..I ask him and i'll try by myself..

Similar Threads

  1. Return from Script (loop problem) disable script
    By M.Evans in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 6
    Last Post: May 31 2011, 01:01
  2. BAF ied trigger / help with arrest script / lift script anyone?
    By Pte Frank [3para] in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 6
    Last Post: Aug 31 2010, 18:35
  3. UPS script or USPS patrol script not working
    By blackpulpit in forum ARMA 2 & OA : ADDONS - Configs & Scripting
    Replies: 5
    Last Post: Aug 15 2010, 19:22
  4. In Perimeter Script/Death Script. Errors & 2 Quest
    By Victor in forum OFP : MISSION EDITING & SCRIPTING
    Replies: 3
    Last Post: Nov 13 2006, 17:59
  5. Public hints in local script: popup target script
    By [STO]Badblood in forum OFP : MISSION EDITING & SCRIPTING
    Replies: 6
    Last Post: Mar 30 2003, 16:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •