Add gun store

Add gun store

« posted: Aug 05, 2015, 05:50 AM »
I found this topic http://forums.a3wasteland.com/index.php?topic=176.0 and thought I followed everything correctly. After placing units in editor and copying them to mission.sqm my map doesn't load on server at all. Might be doing a step incorrectly, I don't know.
Map is Stratis and is version 1.2

Trying to add a 5th gun store.

storeOwner
Code: [Select]
// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
// @file Name: storeOwners.sqf
// @file Author: AgentRev, JoSchaap, His_Shadow

// Notes: Gun and general stores have position of spawned crate, vehicle stores have an extra air spawn direction
//
// Array contents are as follows:
// Name, Building Position, Desk Direction (or [Desk Direction, Front Offset]), Excluded Buttons
storeOwnerConfig = compileFinal str
[
["GenStore1", 1, 270, []],
["GenStore2", 4, 310, []],
["GenStore3", 4, 340, []],

["GunStore1", 0, 5, []],
["GunStore2", 1, 130, []],
["GunStore3", 5, 85, []],
["GunStore4", 1, [30, 1.5], []],
["GunStore5", 0, 5, []], //Maxwell

// Buttons you can disable: "Land", "Armored", "Tanks", "Helicopters", "Boats", "Planes"
["VehStore1", 0, 195, ["Planes"]],
["VehStore2", 2, 285, ["Boats"]],
["VehStore3", 1, 245, ["Planes"]]
];

// Outfits for store owners
storeOwnerConfigAppearance = compileFinal str
[
["GenStore1", [["weapon", ""], ["uniform", "U_IG_Guerilla2_2"]]],
["GenStore2", [["weapon", ""], ["uniform", "U_IG_Guerilla2_3"]]],
["GenStore3", [["weapon", ""], ["uniform", "U_IG_Guerilla3_1"]]],

["GunStore1", [["weapon", ""], ["uniform", "U_B_SpecopsUniform_sgg"]]],
["GunStore2", [["weapon", ""], ["uniform", "U_O_SpecopsUniform_blk"]]],
["GunStore3", [["weapon", ""], ["uniform", "U_I_CombatUniform_tshirt"]]],
["GunStore4", [["weapon", ""], ["uniform", "U_IG_Guerilla1_1"]]],
["GunStore5", [["weapon", ""], ["uniform", "U_IG_Guerilla1_1"]]],

["VehStore1", [["weapon", ""], ["uniform", "U_Competitor"]]],
["VehStore2", [["weapon", ""], ["uniform", "U_Competitor"]]],
["VehStore3", [["weapon", ""], ["uniform", "U_Competitor"]]]
];


Mission.sqm
Code: [Select]
class Item47
{
side="LOGIC";
class Vehicles
{
items=1;
class Item0
{
position[]={3275.8643,229.17195,2943.2207};
azimut=246.98297;
id=156;
side="LOGIC";
vehicle="C_man_1_1_F";
leader=1;
skill=0.60000002;
text="GunStore5";
init="[this, 'GunStore', 5] spawn A3W_fnc_setupStoreNPC";
};
};
};

Code: [Select]
class Item151
{
position[]={3275.8643,229.17195,2943.2207};
name="GunStore5_objSpawn";
type="Empty";
colorName="ColorBlack";
};

Are you supposed to add the units in their own class or add them like I did above? Then increase the total number of items.

Re: Add gun store

« Reply #1 posted: Aug 05, 2015, 12:28 PM »
The "numbers" in mission.sqm is important so you need to add to that count, if it doesnt "add up" you will get you result.

I did something else with Revs help.

In the mapConfig folder i added a file called setupStoreOwners.sqf with this in it
Code: [Select]
//@file Version: 1.0
//@file Name: setupStoreOwners.sqf
//@file Author: Cael817, Many thanks to AgentRev for the CreateUnit part.
//@file Desc: For placing stores and markers

// If you need the unit object afterwards:
//_unit = missionNamespace getVariable _name;
_debug = false;
_grp = createGroup sideLogic;

//Gunstore 5
_name = "GunStore5";
_pos = [9079.9619, 7730.4028,0]; // Always remember, SQM is [X,Z,Y] and SQF needs [X,Y,Z]
"C_man_1_1_F" createUnit [_pos, _grp, format ["%1 = this; this setVehicleVarName '%1'; [this] spawn A3W_fnc_setupStoreNPC", _name]];

_pos = [9091.502,7717.8047,32.535469];
_object = createMarker ["GunStore5_objSpawn", _pos];
_object setMarkerShape "ICON";
_object setMarkerText "GunStore5_objSpawn";
If (_debug) then {
_object setMarkertype "mil_warning";
}else{
_object setMarkertype "Empty";
};
_object setMarkerColor "ColorBlack";
_object setMarkerDir 0;

You still need to edit the storeOwners.sqf as you did.

then in server/init.sqf add
Code: [Select]
call compile preprocessFileLineNumbers "mapconfig\setupStoreOwners.sqf";

exactly here
https://github.com/A3Wasteland/ArmA3_Wasteland.Altis/blob/master/server/init.sqf#L410



Sidenote....

I moved all stores, town, territory & mission markers etc from the mission.sqm and loading them this way
https://github.com/Cael817/ArmA3_Wasteland_1.2_beta_SNF02.Altis/blob/master/mission.sqm
https://github.com/Cael817/ArmA3_Wasteland_1.2_beta_SNF02.Altis/blob/master/server/init.sqf#L417-L421
https://github.com/Cael817/ArmA3_Wasteland_1.2_beta_SNF02.Altis/tree/master/mapConfig
(i kept the player spawn stuff in mission.sqm but those should be movable too leaving an almost empty mission.sqm).

This way when i want to add something new to any of these i just grab the pos where my toon is at and copy paste that into one of those files and then add the rest of the stuff depending on what i want to do and then i dont have to mess with mission.sqm which i think is best done in the editor

As you guessed you don't need to move anything out of mission sqm, you can have the "vanilla" stores there and have the new ones in the separate file, same goes for new markers etc.

Re: Add gun store

« Reply #2 posted: Aug 06, 2015, 12:37 AM »
Thank you, your way worked great.

Re: Add gun store

« Reply #3 posted: Aug 06, 2015, 01:14 PM »
Nice =).

Only thing im looking for now is a nice script that shows me all building positions and other info in game, preferably with 3D icons and text. Found a couple of scripts that gave me it on the map but it would be better to see it in game.
  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

Re: Add gun store

« Reply #4 posted: Aug 12, 2015, 08:20 AM »
Nice =).

Only thing im looking for now is a nice script that shows me all building positions and other info in game, preferably with 3D icons and text. Found a couple of scripts that gave me it on the map but it would be better to see it in game.

Ohh I have that somewhere. It shows blue markers :)
But you could also go stand somewhere in a building and use getBuildingPos or something, it's what I did :)