Jump to content

McArcher

Member
  • Content Count

    421
  • Joined

  • Last visited

  • Medals

Posts posted by McArcher


  1. How can I use my custom coin.sqf and coin_interface.sqf instead of original ones? I guess, I need somehow to create my own class for custom CoIn module? Or something else... How can I do it?

    I need them not like a new addon in arma2/addons/ but I want them to be inside my mission's folder. Is that possible?

    Thank you for help.

    ---------- Post added at 18:45 ---------- Previous post was at 18:40 ----------

    I have unpacked Modules.pbo and unRapped config.bin. In CfgVehicles.hpp i see following:

    // Generated by unRap v1.06 by Kegetys
    
    class CfgVehicles {
    class Logic;	// External class reference
    
    class ConstructionManager : Logic {
    	displayName = $STR_COIN_NAME;
    	icon = "\ca\ui\data\icon_COIN_ca.paa";
    	picture = "\ca\ui\data\icon_COIN_ca.paa";
    	vehicleClass = "Modules";
    
    	class Eventhandlers {
    		init = "if (isServer) then {private [""_ok""];_ok = _this execVM ""ca\modules\coin\data\scripts\coin.sqf""};";
    	};
    };
    };
    

    so, I need somehow to change the default path to ca\modules\coin\data\scripts\coin.sqf to my custom coin.sqf. If I change this file, what should I do next?

    ---------- Post added at 18:46 ---------- Previous post was at 18:45 ----------

    how do I pack it and use in my mission's folder?

    i have never created addons and don't know how to include them into mission.

    ---------- Post added at 20:07 ---------- Previous post was at 18:46 ----------

    ok... nobody helps... i decided to try it myself...

    modified CfgPatches.hpp as in the example...

    class CfgPatches 
    {
    class mca_ConstructionManager 
    {
    	units[] = {};
    	weapons[] = {};
    	requiredVersion = 0.1;
    	requiredAddons[] = {"CA_Modules_Coin"};
    };
    };

    CfgVehicles.hpp

    class CfgVehicles 
    {
    class ConstructionManager; // Ext
    
    class mca_ConstructionManager : ConstructionManager 
    {
    	class Eventhandlers {
    		init = "if (isServer) then {private [""_ok""];_ok = _this execVM ""data\scripts\coin.sqf""};";
    	};
    };
    };
    

    config.cpp was the same

    #include "CfgPatches.hpp"
    #include "CfgVehicles.hpp"
    #include "CfgDefaultKeysMapping.hpp"
    

    all these files and original CfgDefaultKeysMapping.hpp are located at my mission's root folder. from game I'm trying to createUnit

    "mca_ConstructionManager" createUnit [ getPos player, _group, "COIN_RU_MHQ = this;"];

    but it says:

    Bad vehicle type mca_ConstructionManager

    What am I doing wrong?


  2. omg, I've found _BIS_COIN_idAction in the coin.sqf, ripped from Modules.pbo....... if I could understand it quickly....... :D

    _id = _logic getvariable "BIS_COIN_id";

    _BIS_COIN_idAction = format ["BIS_COIN_action_%1",_id];

    ---------- Post added at 00:57 ---------- Previous post was at 00:17 ----------

    I have acheived some progress... This code deletes original action. However, I must wait about 5-6 sec after my new action appears! Otherwise, coin will show empty interface and hang...

    waituntil {!isnil "bis_fnc_init"};
    //[] call BIS_fnc_help;
    ///////////////////////////////////////////////////////////////
    enableSaving [false, false];
    waitUntil {time>0.1};
    
    private ["_action", "_group", "_id", "_BIS_COIN_idAction"];
    mcti_money_east = 99000;
    _group = createGroup east;
    
    "ConstructionManager" createUnit [ getPos player, _group, "COIN_RU_MHQ = this;"];
    COIN_RU_MHQ synchronizeObjectsAdd [RU_player_1];
    COIN_RU_MHQ setvariable ["BIS_COIN_name", "RU MHQ"];
    COIN_RU_MHQ setvariable ["BIS_COIN_rules", [east]];
    COIN_RU_MHQ setvariable ["BIS_COIN_categories", ["Base", "Active Defence", "Passive Defence", "Storage", "Barriers", "Respawn Points"]];
    COIN_RU_MHQ setvariable ["BIS_COIN_funds", "mcti_money_east"];
    COIN_RU_MHQ setvariable ["BIS_COIN_fundsDescription", ["R"]];
    COIN_RU_MHQ setvariable ["BIS_COIN_areasize", [150, 15]];
    COIN_RU_MHQ setvariable ["BIS_COIN_actionCondition", "TRUE"];
    
    COIN_RU_MHQ setvariable ["BIS_COIN_items",
    			[
    				//--- Class, Category, Cost or [fundsID,Cost], (display name)
    				// Buildings for Base construction
    				["RU_WarfareBBarracks", "Base", 3000, "Barracks (Field Variant)"],
    				["Land_Mil_Barracks_i", "Base", 3500, "Barracks (City Variant)"],
    				["RU_WarfareBLightFactory", "Base", 9000, "Light Factory"],
    				["RU_WarfareBHeavyFactory", "Base", 25000, "Heavy Factory"],
    				["RU_WarfareBAircraftFactory", "Base", 31000, "Aircraft Factory"],
    				["RU_WarfareBVehicleServicePoint", "Base", 4000, "Vehicle Service Point"],
    				["RU_WarfareBUAVterminal", "Base", 4000, "Radio Terminal"],
    				["PowGen_Big", "Base", 1000, "Diesel Power Generator"],
    
    				["RU_WarfareBFieldhHospital", "Respawn Points", 1000, "Field Hospital"],
    
    				["Land_tent_east", "Storage", 100, "Small Tent"],
    				["Land_Ind_Garage01", "Storage", 500, "Small Garage"],
    				["Land_Ind_Workshop01_02", "Storage", 600, "Small Workshop"],
    				["Land_Barn_W_02", "Storage", 600, "Short Barn"],
    				["Land_Ind_Workshop01_04", "Storage", 700, "Old Workshop"],
    				["Land_Barn_W_01", "Storage", 800, "Long Barn"],
    				["Land_Hangar_2", "Storage", 1000, "Large Hangar w/ Doors"],
    				["WarfareBAirport", "Storage", 2500, "Large Hangar"],
    
    				["KORD", "Active Defence", 250, "KORD Minitripod"],
    				["KORD_high", "Active Defence", 275, "KORD"],
    				["RU_WarfareBMGNest_PK", "Active Defence", 300, "MG Nest (PK)"],	
    				["AGS_RU", "Active Defence", 700, "AGS-30"],
    				["Igla_AA_pod_East", "Active Defence", 800, "AA IGLA Pod"],
    				["Metis", "Active Defence", 800, "Metis AT-13"],
    				["ZU23_Ins", "Active Defence", 900, "ZU-23"],
    				["2b14_82mm", "Active Defence", 1000, "Podnos 2B14"],
    				["D30_RU", "Active Defence", 1900, "D-30"],		
    				["SearchLight_RUS", "Active Defence", 100, "Searchlight"],	
    
    				["Land_CamoNet_EAST", "Passive Defence", 50, "Camo Net 1"],
    				["Land_CamoNetB_EAST", "Passive Defence", 75, "Camo Net Big"],
    				["Land_CamoNetVar_EAST", "Passive Defence", 50, "Camo Net 2"],
    				["Land_fort_rampart", "Passive Defence", 50, "Rampart Element"],
    				["Land_Hlidac_budka", "Passive Defence", 50, "Sentry Box"],
    				["Land_fort_artillery_nest", "Passive Defence", 100, "Rampart (Nest)"],
    				["Land_fortified_nest_small", "Passive Defence", 200, "Nest (Small)"],
    				["Land_fortified_nest_big", "Passive Defence", 500, "Nest (Big)"],
    				["Land_Fort_Watchtower", "Passive Defence", 525, "Fort"],
    				["Land_Vysilac_FM", "Passive Defence", 600, "Tower"],
    				["Land_Mil_Guardhouse", "Passive Defence", 1000, "Checkpoint"],
    				["Land_Mil_ControlTower", "Passive Defence", 2000, "Control Tower"],
    
    				["Fence_corrugated_plate", "Barriers", 20, "Fence 1"],
    				["Fence_Ind_long", "Barriers", 20, "Fence 2"],		
    				["Fort_RazorWire", "Barriers", 25, "Razor Wire"],
    				["Hedgehog", "Barriers", 50, "Hedgehog"],
    				["Hhedgehog_concrete", "Barriers", 75, "Small Concrete Hedgehog"],
    				["Hhedgehog_concreteBig", "Barriers", 100, "Big Concrete Hedgehog"],
    				["Fort_Barricade", "Barriers", 100, "Barricade from Garbage"],
    				["Land_fort_bagfence_long", "Barriers", 25, "Sandbag - Long"],
    				["Land_fort_bagfence_corner", "Barriers", 50, "Sandbag - Corner"],
    				["Land_fort_bagfence_round", "Barriers", 50, "Sandbag - Round"],
    				["Land_HBarrier1", "Barriers", 20, "Hesco x1"],
    				["Land_HBarrier3", "Barriers", 60, "Hesco x3"],
    				["Land_HBarrier5", "Barriers", 100, "Hesco x5"],
    				["Land_HBarrier_large", "Barriers", 150, "Big Hesco x4"]
    
    			]
    		];
    
    sleep 5.5;
    _id = COIN_RU_MHQ getVariable "BIS_COIN_id";
    _BIS_COIN_idAction = format ["BIS_COIN_action_%1",_id];
    _action = player addAction ["Build", "data\scripts\coin_interface.sqf", COIN_RU_MHQ, 1, false];
    player setVariable [_BIS_COIN_idAction, _action];
    player removeAction 0; // number depends on current actions alreay added
    

    ---------- Post added at 01:43 ---------- Previous post was at 01:05 ----------

    if i put sleep's into script, it doesnt init new CoIn while script is paused, so I must wait again 6-10 sec after script has ended... will be thinking how to override this...


  3. How can I use modified (and ripped from game) "coin_interface.sqf" instead of original COIN ?

    RU_MHQ addAction ["Build", "scripts\coin\coin_interface.sqf", COIN_RU_MHQ, 1, false];

    doesn't help - game hangs on COIN loading screen! (coin_interface.sqf is placed in scripts\coin\ folder of my mission's folder, RU_MHQ exists, COIN_RU_MHQ created by a script and syncronized to player).

  4. waituntil {!isnil "bis_fnc_init"};

    //[] call BIS_fnc_help;

    ///////////////////////////////////////////////////////////////

    enableSaving [false, false];

    waitUntil {time>0.1};

    private ["_action", "_group"];

    mcti_money_east = 99000;

    _group = createGroup east;

    COIN_RU_MHQ = "ConstructionManager" createUnit [ position player, _group, ""];

    //COIN_RU_MHQ synchronizeObjectsAdd [RU_player_1];

    COIN_RU_MHQ setvariable ["BIS_COIN_name", "RU MHQ"];

    COIN_RU_MHQ setvariable ["BIS_COIN_rules", [RU_player_1]];

    COIN_RU_MHQ setvariable ["BIS_COIN_categories", ["Base", "Active Defence", "Passive Defence", "Storage", "Barriers", "Respawn Points"]];

    COIN_RU_MHQ setvariable ["BIS_COIN_funds", "mcti_money_east"];

    COIN_RU_MHQ setvariable ["BIS_COIN_fundsDescription", ["R"]];

    COIN_RU_MHQ setvariable ["BIS_COIN_areasize", [150, 15]];

    COIN_RU_MHQ setvariable ["BIS_COIN_actionCondition", "TRUE"];

    COIN_RU_MHQ setvariable ["BIS_COIN_items",

    [

    //--- Class, Category, Cost or [fundsID,Cost], (display name)

    // Buildings for Base construction

    ["RU_WarfareBBarracks", "Base", 3000, "Barracks (Field Variant)"],

    ["Land_Mil_Barracks_i", "Base", 3500, "Barracks (City Variant)"],

    ["RU_WarfareBLightFactory", "Base", 9000, "Light Factory"],

    ["RU_WarfareBHeavyFactory", "Base", 25000, "Heavy Factory"],

    ["RU_WarfareBAircraftFactory", "Base", 31000, "Aircraft Factory"],

    ["RU_WarfareBVehicleServicePoint", "Base", 4000, "Vehicle Service Point"],

    ["RU_WarfareBUAVterminal", "Base", 4000, "Radio Terminal"],

    ["PowGen_Big", "Base", 1000, "Diesel Power Generator"],

    ["RU_WarfareBFieldhHospital", "Respawn Points", 1000, "Field Hospital"],

    ["Land_tent_east", "Storage", 100, "Small Tent"],

    ["Land_Ind_Garage01", "Storage", 500, "Small Garage"],

    ["Land_Ind_Workshop01_02", "Storage", 600, "Small Workshop"],

    ["Land_Barn_W_02", "Storage", 600, "Short Barn"],

    ["Land_Ind_Workshop01_04", "Storage", 700, "Old Workshop"],

    ["Land_Barn_W_01", "Storage", 800, "Long Barn"],

    ["Land_Hangar_2", "Storage", 1000, "Large Hangar w/ Doors"],

    ["WarfareBAirport", "Storage", 2500, "Large Hangar"],

    ["KORD", "Active Defence", 250, "KORD Minitripod"],

    ["KORD_high", "Active Defence", 275, "KORD"],

    ["RU_WarfareBMGNest_PK", "Active Defence", 300, "MG Nest (PK)"],

    ["AGS_RU", "Active Defence", 700, "AGS-30"],

    ["Igla_AA_pod_East", "Active Defence", 800, "AA IGLA Pod"],

    ["Metis", "Active Defence", 800, "Metis AT-13"],

    ["ZU23_Ins", "Active Defence", 900, "ZU-23"],

    ["2b14_82mm", "Active Defence", 1000, "Podnos 2B14"],

    ["D30_RU", "Active Defence", 1900, "D-30"],

    ["SearchLight_RUS", "Active Defence", 100, "Searchlight"],

    ["Land_CamoNet_EAST", "Passive Defence", 50, "Camo Net 1"],

    ["Land_CamoNetB_EAST", "Passive Defence", 75, "Camo Net Big"],

    ["Land_CamoNetVar_EAST", "Passive Defence", 50, "Camo Net 2"],

    ["Land_fort_rampart", "Passive Defence", 50, "Rampart Element"],

    ["Land_Hlidac_budka", "Passive Defence", 50, "Sentry Box"],

    ["Land_fort_artillery_nest", "Passive Defence", 100, "Rampart (Nest)"],

    ["Land_fortified_nest_small", "Passive Defence", 200, "Nest (Small)"],

    ["Land_fortified_nest_big", "Passive Defence", 500, "Nest (Big)"],

    ["Land_Fort_Watchtower", "Passive Defence", 525, "Fort"],

    ["Land_Vysilac_FM", "Passive Defence", 600, "Tower"],

    ["Land_Mil_Guardhouse", "Passive Defence", 1000, "Checkpoint"],

    ["Land_Mil_ControlTower", "Passive Defence", 2000, "Control Tower"],

    ["Fence_corrugated_plate", "Barriers", 20, "Fence 1"],

    ["Fence_Ind_long", "Barriers", 20, "Fence 2"],

    ["Fort_RazorWire", "Barriers", 25, "Razor Wire"],

    ["Hedgehog", "Barriers", 50, "Hedgehog"],

    ["Hhedgehog_concrete", "Barriers", 75, "Small Concrete Hedgehog"],

    ["Hhedgehog_concreteBig", "Barriers", 100, "Big Concrete Hedgehog"],

    ["Fort_Barricade", "Barriers", 100, "Barricade from Garbage"],

    ["Land_fort_bagfence_long", "Barriers", 25, "Sandbag - Long"],

    ["Land_fort_bagfence_corner", "Barriers", 50, "Sandbag - Corner"],

    ["Land_fort_bagfence_round", "Barriers", 50, "Sandbag - Round"],

    ["Land_HBarrier1", "Barriers", 20, "Hesco x1"],

    ["Land_HBarrier3", "Barriers", 60, "Hesco x3"],

    ["Land_HBarrier5", "Barriers", 100, "Hesco x5"],

    ["Land_HBarrier_large", "Barriers", 150, "Big Hesco x4"]

    ]

    ];

    _action = UAZ_1 addAction ["Build", "scripts\coin\coin_interface.sqf", COIN_RU_MHQ, 1, false];

    player setvariable [_BIS_COIN_idAction, _action];

    hangs on loading screen :(

    ---------- Post added at 19:23 ---------- Previous post was at 19:06 ----------

    undefined _BIS_COIN_idAction.

    ---------- Post added at 19:40 ---------- Previous post was at 19:23 ----------

    _action = player addAction ["Build", "scripts\coin\coin_interface.sqf", COIN_RU_MHQ, 1, false];

    player setvariable [_BIS_COIN_idAction, _action];

    gives the same error. is _BIS_COIN_idAction right word?

  5. By COOP I meant both: ordinary COOP vs AI comm. and COOP that is cooperative play = team play. Maybe I used this word not very correctly here... (AI comm. will be in future releases, because it is very complicated to script it).

    ---------- Post added at 16:23 ---------- Previous post was at 16:21 ----------

    Yo very nice to see someone else is working on CTI !!!

    MCArcher we should work together and bring back the old times....

    but first i will play your mission ;)

    Greetz

    Muecke

    Thank you :) We will have a new modified Construction Interface soon, with the help of MH6 from this forum. It will bring more freedom to build. Plus some bugfixes (startup parameters, sandbags names in CoIn and so on... working on R2)

    ---------- Post added at 16:25 ---------- Previous post was at 16:23 ----------

    added armaholic mirror


  6. RU_MHQ addEventHandler ["GetOut", 
    {
    private ["_action", "_unit"];
    _unit = _this select 2;
    if (_unit == RU_player_1) then
    {
    	"ConstructionManager" createUnit [ getPos RU_MHQ, group_RU_MHQ, "COIN_RU_MHQ = this;"];
    	COIN_RU_MHQ synchronizeObjectsAdd [RU_player_1];
    
    	COIN_RU_MHQ setvariable ["BIS_COIN_name", "RU MHQ"];
    	COIN_RU_MHQ setvariable ["BIS_COIN_rules", [RU_player_1]];
    	COIN_RU_MHQ setvariable ["BIS_COIN_categories", ["Base", "Active Defence", "Passive Defence", "Storage", "Barriers", "Respawn Points"]];
    	// ...
    	COIN_RU_MHQ setvariable ["BIS_COIN_funds", "mcti_money_east"];
    	COIN_RU_MHQ setvariable ["BIS_COIN_fundsDescription", ["R"]];
    	COIN_RU_MHQ setvariable ["BIS_COIN_areasize", [150, 15]];
    	COIN_RU_MHQ setvariable ["BIS_COIN_actionCondition", "TRUE"];
    
    	_action = RU_MHQ addAction ["Build", "scripts\coin\coin_interface.sqf", COIN_RU_MHQ, 1, false];
    	RU_MHQ setvariable [_BIS_COIN_idAction, _action];
    };
    }];

    I placed coin_interface.sqf into folder scripts\coin\ in my mission folder, and when I use the menu "Build", I see a loading screen (with green NV picture of a man :) ), the title of loading screen is "Contruction Interface". and nothing more.... ESC button doesn't help.... What is that? What did I do wrong?

    ---------- Post added at 04:17 ---------- Previous post was at 03:59 ----------

    .rpt has

    Error in expression <ce.sqf", COIN_RU_MHQ, 1, false];

    RU_MHQ setvariable [_BIS_COIN_idAction, _action>

    Error position: <setvariable [_BIS_COIN_idAction, _action>

    Error Тип Любой, ожидаетÑÑ ÐŸÐ¾ÑледовательноÑть

    error type any, expected ... string? i forgot ""s ?

    ---------- Post added at 04:19 ---------- Previous post was at 04:17 ----------

    maybe instead of

    RU_MHQ setvariable [_BIS_COIN_idAction, _action];

    I need
    COIN_RU_MHQ setvariable ["BIS_COIN_idAction", _action];

    ?

    ---------- Post added at 04:46 ---------- Previous post was at 04:19 ----------

    I thought that _BIS_COIN_idAction was a constant by BIS, created empty mission with CoIn module, tried to output _BIS_COIN_idAction, it said ANY, so it is not a constant. Mistyped?

    COIN_RU_MHQ setvariable ["BIS_COIN_idAction", _action]; hasn't helped...


  7. w1_preview1.jpg

    MCTI is a variation of an oldschool CTI gamemode from good old Operation Flashpoint (OFP).

    Actual version of the mission is MCTI R10 40vs40.

    Official MCTI website

    http://mcarcher.narod.ru/mcti.html

    It can be downloaded here ->

    Mirror 1: MCTI R10 40vs40

    Mirror 2: MCTI R10 40vs40

    Mirror 3:

    MD5 is 0F8B5D016F3FF3A25AA46F4148B208C2

    Previous version

    Installation

    Just unzip (unarchive) the *.rar file and put a *.pbo file into your ArmA2\MPMissions folder (for example, into "C:\Games\ArmA2\MPMissions").

    Note: mission requires the latest version of Arma 2 (OA is not needed).

    MCTI Game Rules and Features

    1. Two sides (east and west) are fighting for zones on the island. Each area (most of them are towns) can be captured and will bring some income to the side, which captured it. Income depends on the area size and strategical importance (airports are equal to middle-sized towns). To capture a zone, get close to its flag, and capture it (use action menu to raise your flag). Capturing is allowed only if there are no enemies nearby. To see a game score (number of towns captured, money available and income) use action menu.

    2. As opposed to original MFCTI, money in MCTI is shared between all players of the team. (This was made due to very often money borrowings for commander in MFCTI)

    3. MHQ is the most important vehicle in your game. It is used for building base structures, defences and so on. It mustn't be used as an assault vehicle, because once it has been demolished, you won't be able to build your base anymore. However, as a vehicle, MHQ can be repaired, if it is not totally destroyed yet (use repair trucks for that purpose). MHQ must be driven mostly by commander (but other players are also able to drive it), but ability to build your base is only of your Commander. Commander of the team is the first playable slot in the game. To begin constructing base you must get out of MHQ. When you get in MHQ, you are not able to build (Note: There is a delay between disembarking the MHQ and action appearing in your action list).

    4. There are several types of buildings in game. Three visual styles of barracks, which can provide loadouts for your team (you can deploy up to 3 crates with weapons and ammo from them. Time between deployments cannot be less than some period). Light and Heavy Factories will produce vehicles for you. (you can use buy menu to buy and queue menu to watch current tasks of the factory). Aircraft Factory can produce aircrafts.

    5. In order to produce vehicles, factories need electricity. You can place Diesel Power Generators near them. Depending on the base production time of your vehicle and number of generators near factory, time of production can vary. (Factories are smart enough to stop production if money is depleted or all generators nearby have been destroyed. They will also change their speed of producing when additional generators are built.). Distance between factrory and generator to be used by it is limited.

    6. Radio Communication can be enabled by Radio terminal (UAV terminal building from warfare) and it provides respawning not only to MHQ, but also to Field Hospitals and Mobile Field Hospitals, deployed from your medical support vehicles (ambulance). Without radio communication enabled you can respawn only near your MHQ.

    7. In MCTI you cannot buy AI soldiers in barracks. This is the biggest difference from original MFCTI. Also, like the shared money, this was made to stimulate healthy teamplay and strong team spirit, like in COOP missions. And that's why number of playable units has been increased to 40 per side.

    8. You can not only repair with Repair Trucks, but also build some fortifications and other structures. Number of structures available for Commander and for the trucks are more than enough.

    9. Cost balancing tries to make game more difficult and realistic.

    10. As opposed to warfare, vehicles are not lockable here, this was made first to avoid warfares numerous bugs and, second, to give an ability to steal enemy's vehicles. (stealing is especially funny in veteran mode).

    11. Areas are commonly defended by resistance forces (you can disable them at game start) and Civilian cars can be selected to spawn in towns too.

    12. Markers of the buildings and field hospitals are seen only to members of the same side, but town/area markers are seen to both sides, you and your enemy. This feature was taken from CTF and C&H styled games. It makes game more dynamic and building base - more dangerous. Markers of buildings and field hospitals are visible only with radio communication enabled (build radio terminal for that purpose).

    13. Vehicles don't explode if left empty, as opposed to warfare! Field hospitals and mobile ones disappear in a few seconds after their destruction.

    14. Artillery and Logistics is implemented by [R3F]'s script. More information here -> http://forums.bistudio.com/showthread.php?t=94280 (Note: you don't need to download or install anything from that page, it is already included into the mission).

    15. Since version R7, Mission supports AI Commander and AI Units. In present version of mission, AI Commander builds maximum one base. AI Units are able to get weapons from crates (virtually, because BIS hasn't included vehicles cargo function in Arma 2, opposed to VBS2) and are able to search corpses for weapons and ammo. If unit doesn't have enough magazines for his primary weapon, he will also search in corpses. Also, injured units, who cannot stand or walk, stay at town flags and call for a medic. Moreover, AI units are smart enough to select a nearest respawn point to the town being captured, when Radio Terminal has been built and allows respawning to Field Hospitals and Mobile Field Hospitals (Mashes).

    Note: Enabling AI Units and Resistance Forces is highly recommended ONLY ON DEDICATED SERVER - otherwise you will face the problem of huge fps drop on a player-hosted PC.

    Some technical moments

    - As opposed to MFCTI's MODs, MCTI mission was written from scratch. Great thanks to those people who gave me advice about game scripting.

    - This mission tries to use least scripting possible to reduce lags and increase fps. This was also made due to BIS's bugs with lots of AIs at map.

    - According to previous fact, game can be run even on poor servers if without resistance AIs and AI units (shows 47 fps on old Athlon 64 X2 @2.0 GHz with civilian cars, no resistance and no AI units, like a common CTF/C&H map).

    - Advanced Construction Interface allows building everywhere and not only horizontally. Selling a building feature has been removed. You can hold SHIFT button to place additional structure of selected type (easy copy). Area of building was reduced in order not to allow spying with this tool. Height locked to 5 meters and radius to 50 meters.

    - To restart game that is running or has finished after win, you must use #reassign command. Don't use #restart with this mission, it won't work properly.

    - To start game properly, you should wait a few seconds after all the town markers became yellow and then black, and few seconds after that.

    - Repair Truck Build menu appears after you get out of the truck, and disappears when you get into it. There is a known issue about building menu with repair trucks for JIP players. If you don't see "(Advanced)" action in the list, you should get in, and then get out of repair truck. This bug cannot be fixed now, because advanced CoIn was made to re-initialize BIS's original CoIn without modifying original one (in order not to make addon folders and make mission installaton easier).

    Artillery is working, but GRAD/MLRS are not yet supported in [R3F] Artillery and Logistic, which brings artillery into mission.

    If you have seen a bug or would like to suggest a feature, your feedback is welcome here, in this theread ( http://forums.bistudio.com/showthread.php?t=93726 ).

    Changelog

    R10

    - Changed: Artillery and Logistics script from [R3F] updated to v1.3.

    - Changed: Default mission parameters now include disabled AI Units, AI Commander, no resistance in town and no grass on ground.

    - Added: Grouping into squads with squad leaders.

    - Added: Special forces, snipers, and other types of squads.

    - Changed: Players' units roles are changed according to their place in squad.

    R9

    - Added: Apache AH-64D and AH-64D Sidewinder aircrafts, brought by 1.05 patch to Arma2;

    - Added: Game ending camera scripts;

    - Changed: Aircraft prices;

    - Changed: [R3F] scripts modified to use hint instead of globalChat command to display system messages to player.

    R8

    - Fixed: Income bug;

    - Fixed: AI Commander building when MHQ was destroyed or Commander was dead;

    - Fixed: Bug with crates after JIP;

    - Fixed: End of game bug when no players playing for a side;

    - Fixed: Positions of structures and vehicles at game start and built by AI Commander;

    - Fixed: Heavy and Aircraft Factories used wrong production times for vehicles;

    - Fixed: US side AI units respawned with weapons;

    - Fixed: Mobile Field Hospital could be deployed when helicopter was in the air;

    - Fixed: Factories can be used only by owner's side.

    R7

    - Added: Basic AI Commander and AI Units;

    - Fixed: Area capture script bug;

    - Fixed: Ammo crates bug for US;

    - Fixed: Structures' markers not visible bug;

    - Fixed: JIP respawn bug for US;

    - Fixed: Towers are now placed vertically with advanced CoIn (they change vector after placement);

    - Fixed: Airplanes are now finally removed;

    - Fixed: Wrong classname for NATO camo net;

    - Added: 3D clouds;

    - Added: New starting money option;

    - Changed: Costs for static weapons;

    - Changed: Artillery and Logistics script from [R3F] updated to v1.2.

    R6

    - Fixed: JIP positions bug;

    - Removed: Grouping playable units (it caused a lot of bugs);

    - Changed: Now small artillery gun can be built with MHQ and repair trucks;

    - Changed: Now artillery cannon can be produced only by Heavy Factory;

    - Changed: Starting positions and 3 vehicles at start.

    R5

    - Added: [R3F] Artillery and Logistic v1.1 (GRAD/MLRS support will be in future);

    - Added: Artillery command quarter in MHQ's build menu;

    - Fixed: Respawn at the same MASH bug;

    - Changed: Names and costs of some structures and vehicles;

    - Changed: Numbers of weapons and magazines in crates;

    - Changed: All players of one side are grouped in one group with a Commander as a leader;

    - Added: AI units are now able to capture areas (tell them to use apropriate action when they are near the flag);

    - Added: AI units now automatically equip weapons and magazines "from crates". They begin looking for a crate if they are empty and see a crate within 500 meters from them;

    - Changed: Downloadable mission is now archived with WinRAR and takes much less space. You can get the archiever at http://rarlab.com/ or use a compatible one.

    R4

    - Added: Building with Repair Trucks feature;

    - Added: New Barracks building and many other constructions;

    - Fixed: Some minor bugs.

    R3

    - Fixed: Resistance forces now don't shoot their vehicles (resistance CDF changed to resistance Guerillas; it seemed to be BIS's bug);

    - Fixed: Tents' names and costs;

    - Fixed: Respawn script;

    - Changed: MHQ construction interface area limits;

    - Changed: All airplanes are cut from mission, only helicopters are left from aircrafts (They will be returned in future, when "Wings of Russia" addon comes out, to balance them);

    - Changed: Helicopters costs and production time;

    - Added: Ability to host game on non-dedicated server.

    R2

    - Fixed: Startup parameters, sandbags' names;

    - Added: 2 new tents, Advanced Construction Interface, movable dialogs.

    R1

    - Initial release.

    Credits

    Mission scripting: McArcher;

    Modified Construction Interface: MH6 and McArcher;

    Artillery and Logistics: [R3F] Artillery and Logistic;

    MCTI © McArcher, 2009-2010.


  8. I have a question about game's code and how it resizes multidimentional arrays.

    First, I wanted to delete a member of an array.

    Command like

    a = a - (a select 1)
    will work only for 1-dimentional array, for multidimentional it won't work.

    I wrote such code:

    // удалÑемÑÑ Ð¸Ð· маÑÑива
    private ["_t"];
    _ud = _i;
    for [{_t=_ud},{_t< (count mcti_airFactories_ru)},{_t=_t+1}] do
    {
    mcti_airFactories_ru set [_t, mcti_airFactories_ru select (_t + 1)];
    };
    mcti_airFactories_ru resize ((count mcti_airFactories_ru) - 1); 
    publicVariable "mcti_airFactories_ru";

    it works fine with multidimentional arrays - first it moves all memebers that are "to the right" (next) from deleting memeber to previous position (1 step to the left) and then I need to delete last member. if I set last memebr to nil this won't work, as there will be ANY instead of last memeber, so I used resize command.

    And the question itself:

    Is it correct to delete last member by resizing? Won't it create unallocated memory garbage?


  9. well, you must move your CoIn also with MHQ, for example, you can add action (EH "GetOut") for you MHQ, so that when you get out of MHQ , CoIn moves to you and you are able to build.

    http://community.bistudio.com/wiki/addEventHandler

    ---------- Post added at 01:15 ---------- Previous post was at 01:13 ----------

    for example,

    MyMHQ addEventHandler ["GetOut", {MyCOIN setPos (position _this)}];

    ---------- Post added at 01:17 ---------- Previous post was at 01:15 ----------

    there's another moment... if your character dies, you must recreate COIN and add player to it (syncronize COIN with player, if I am not mistaking).

    ---------- Post added at 01:18 ---------- Previous post was at 01:17 ----------

    how to limit number of buildings I dont know

    ---------- Post added at 01:19 ---------- Previous post was at 01:18 ----------

    maybe add some code which is run when you purchase a building , it will hint that limit reached and destroy building? dunno..


  10. yes.... maybe this was a mistake that didn't let it work, but I have already done server's script for creating crates...i found this mistake only when wrote server's script.... i found it too late, but big thanks :) now it works :)

    ---------- Post added at 23:25 ---------- Previous post was at 23:24 ----------

    maybe it could even work without server's script, dunno )) but it's done:)

    ---------- Post added at 23:37 ---------- Previous post was at 23:25 ----------

    nevertheless, thanx very much for your efforts!


  11. Hi, Bon.

    Actually I was doing this and everything seemed to be ok, but I have done something with my code and now it doesn't work, though I didn't modify crates' scripts:

    that's the script that creates and fiils a crate: (but it is on client's side and this is maybe wrong)

    // mca_deploy_ammunitionRU.sqf

    // version 1.1c

    if (not isServer) then

    {

    private ["_target", "_left", "_caller", "_crate", "_cratePos", "_initStr", "_angle"];

    _target = _this select 0;

    _caller = _this select 1;

    if ( ( (side _caller) == east) and ( player == _caller) ) then

    {

    _left = _target getVariable "deploymentsLeft";

    player groupChat format ["Examining Barracks building...", _left];//dbg////////////

    if (_left > 0) then

    {

    // проверим, можно ли выгрузить Ñщик.

    private ["_lastDeploy"];

    _lastDeploy = _target getVariable "LastDeploy";

    if ((time - _lastDeploy) < mcti_barracks_deployPause) exitWith { hint format["You must wait %1 seconds before next deployment.", (mcti_barracks_deployPause - (time - _lastDeploy))]; };

    if (not(alive _obj)) exitWith { hint "The building is destroyed. It cannot be used anymore."; };

    // запиÑÑŒ о текущей доÑтаваемой палатке

    _target setVariable ["LastDeploy", time, TRUE];

    // placing the crate

    _angle = random (2 * pi);

    _cratePos = [(position _target select 0) + 15 * cos (deg _angle), (position _target select 1) + 15 * sin (deg _angle)];

    _crate = "RUVehicleBox" createVehicle _cratePos;

    // adding crate to array

    mcti_crates_RU = mcti_crates_RU + [_crate];

    publicVariable "mcti_crates_RU";

    // init

    _initStr = " private [""_i""];clearMagazineCargo this; clearWeaponCargo this; _i = 0; { if (_x > 0) then { _crate addWeaponCargo [ mcti_weapons_pattern select _i, _x] }; _i = _i + 1; } forEach mcti_RUweapons_defaultNumbers; _i = 0; { if (_x > 0) then { _crate addMagazineCargo [ mcti_magazines_pattern select _i, _x] }; _i = _i + 1; } forEach mcti_RUmagazines_defaultNumbers; ";

    _crate SetVehicleInit _initStr;

    ProcessInitCommands;

    // EH

    _crate addEventHandler ["killed", { [_this, east] execVM "mca_onCrateDestroyed.sqf";}] ;

    // reporting

    _target setVariable ["deploymentsLeft", (_left - 1), TRUE]; // -1 crate left inside

    _left = _target getVariable "deploymentsLeft";

    hint format ["You have taken 1 crate of ammuniton out of barracks.\n%1 crates left in the building.", _left];

    }

    else // _left <= 0

    {

    hint format ["Sorry, no ammuniton left in this building.\nSearch in previosly taken crates nearby or build new barracks."];

    };

    }; //side

    };

    it didn't work for JIP and I added script that is run for JIP'ed players:

    // mca_crate_init_JIP.sqf

    // version 1.1c

    if (not isServer) then

    {

    waitUntil {time > 1};

    player groupChat "Initializing crates...";

    private ["_i", "_crate"];

    _n = 0;

    {

    clearMagazineCargo _x;

    clearWeaponCargo _x;

    _crate = _x;

    _i = 0;

    {

    if (_x > 0) then { _crate addWeaponCargo [ mcti_weapons_pattern select _i, _x]; };

    _i = _i + 1;

    } forEach mcti_RUweapons_defaultNumbers;

    _i = 0;

    {

    if (_x > 0) then { _crate addMagazineCargo [ mcti_magazines_pattern select _i, _x] };

    _i = _i + 1;

    } forEach mcti_RUmagazines_defaultNumbers;

    } forEach mcti_crates_RU;

    {

    clearMagazineCargo _x;

    clearWeaponCargo _x;

    _crate = _x;

    _i = 0;

    {

    if (_x > 0) then { _crate addWeaponCargo [ mcti_weapons_pattern select _i, _x]; };

    _i = _i + 1;

    } forEach mcti_USweapons_defaultNumbers;

    _i = 0;

    {

    if (_x > 0) then { _crate addMagazineCargo [ mcti_magazines_pattern select _i, _x] };

    _i = _i + 1;

    } forEach mcti_USmagazines_defaultNumbers;

    } forEach mcti_crates_US;

    };

    I wanted to make this script store crates' inventory in array and init JIP'ed (and other players) with up-to-date info about contents (it should be changed, but that time i understood that we didn't have functions to get the contents of vehicles and made this script only initialize crates with default numbers of weapons for JIPped players.. JIP players see contents, but cannot take it now :)

    I hope Andy455 is right, and this is server/client issue..

    ---------- Post added at 21:34 ---------- Previous post was at 21:32 ----------

    omg, I see "kiled" not "killed" EH for a crate... maybe it is a reason? :)

    ---------- Post added at 21:48 ---------- Previous post was at 21:34 ----------

    well, "killed" EH didn't help :)

    ---------- Post added at 21:57 ---------- Previous post was at 21:49 ----------

    Try getting the server to run the script? Im not that great with all this locality stuff...
    It will be very complicated task... to run server's script from client's script (it will create a crate) and then from that server's run a client's again , to set "killed" EH (it is for client only , i guess?)...
×