Mezo

Additional Buildings Not Spawning

9 posts in this topic

Hey Guys,

I know I'm doing this right, Just not 100% sure there isn't a syntax error or something.

setTimeMultiplier 5;
_objects =
[
    //Your custom objects go here
    ["Land_Dome_Small_F",[1112.69,2511.57,0],0,[0,0,1],false],
	["Land_CncBarrierMedium4_F",[1112.75,2485.62,0.122678],0,[0,0,1],false],
	["Land_CncBarrierMedium4_F",[1115.43,2491.61,0.13114],270.636,[0,0,1],false],
	["Land_CncBarrierMedium4_F",[1109.9,2491.65,0.130173],270.653,[0,0,1],false],
	["Land_CncBarrierMedium4_F",[1115.49,2531.44,0.123204],90.9574,[0,0,1],false],
	["Land_CncBarrierMedium4_F",[1109.88,2531.49,0.127494],88.7831,[0,0,1],false],
	["Land_CncBarrierMedium4_F",[1112.54,2536.66,0],0,[[0,1,0],[0,0,1]],false],
	["Land_ScrapHeap_2_F",[1107.37,2495.19,0],144.149,[0,0,1],false],
	["Land_ScrapHeap_1_F",[1102.17,2498.77,0],282.872,[[-0.974869,0.222779,0],[0,0,1]],false]
];

{
    private ["_object"];

    _object = (_x select 0) createVehicleLocal [0,0,0];
    _object setDir (_x select 2);
    _object setPosATL (_x select 1);
    _object enableSimulation false; // :)
}
forEach _objects;

As I said before, I know it's in the right place. But can't figure out why it's not spawning. Keep in mind this is Chernarus.

Cheers,

Mezo :)

Edited by Taylor Swift

Share this post


Link to post
Share on other sites

Try replacing your last section with this and see if it works:

{
	private ["_object"];
	_object = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
	if (_x select 4) then {
		_object setDir (_x select 2);
		_object setPos (_x select 1);
	} else {
		_object setPosATL (_x select 1);
		_object setVectorDirAndUp (_x select 3);
	};
} foreach _objects;

 

Share this post


Link to post
Share on other sites
Advertisement

Try replacing your last section with this and see if it works:

{
	private ["_object"];
	_object = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
	if (_x select 4) then {
		_object setDir (_x select 2);
		_object setPos (_x select 1);
	} else {
		_object setPosATL (_x select 1);
		_object setVectorDirAndUp (_x select 3);
	};
} foreach _objects;

 

Changed to this block, worked for about ten minutes. Added a few more objects and it stopped working again :S

Share this post


Link to post
Share on other sites
Error in expression <lect 0, [0,0,0], [], 0, "CAN_COLLIDE"];
if (_x select 4) then {
_object setDir (>
  Error position: <if (_x select 4) then {
_object setDir (>
  Error if: Type Number, expected Bool
setTimeMultiplier 5;
_objects =
[
    //Trader City Kamenka
    ["Land_Dome_Small_F",[1285.92,2480.89,0],358.936,0,0,true],
    ["Land_fort_bagfence_corner",[1284.13,2463.79,0],0,0,0,true],
    ["Land_fort_bagfence_corner",[1288.45,2463.95,0],265.957,0,0,true],
    ["Land_PowLines_ConcL",[1289.12,2465.11,0],339.255,0,0,true],
    ["Land_HelipadCivil_F",[1268.63,2459.4,0],0,0,0,true],
    ["Exile_Sign_Vehicles",[1299.93,2461.35,0],35.6383,0,0,true],
    ["Exile_Sign_Food_Small",[1280.41,2470.22,0],210.532,0,0,true],
    ["Exile_Sign_Armory_Small",[1275.66,2476.64,0],246.702,0,0,true],
    ["Exile_Sign_Equipment_Small",[1275.39,2484.21,0],280.745,0,0,true],
    ["Exile_Sign_Hardware_Small",[1280.27,2490.12,0],322.234,0,0,true],
    ["Land_fort_bagfence_corner",[1287.86,2498.09,0],182.553,0,0,true],
    ["Land_fort_bagfence_corner",[1283.29,2497.98,0],86.2767,0,0,true]
];

{
	private ["_object"];
	_object = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
	if (_x select 4) then {
		_object setDir (_x select 2);
		_object setPos (_x select 1);
	} else {
		_object setPosATL (_x select 1);
		_object setVectorDirAndUp (_x select 3);
	};
} foreach _objects;

 

Edited by Taylor Swift

Share this post


Link to post
Share on other sites

The block I posted wont work with your second set of objects because they dont have as detailed placement info as the first set.

["Land_ScrapHeap_1_F",[1102.17,2498.77,0],282.872,[[-0.974869,0.222779,0],[0,0,1]],false]

needs

{
	private ["_object"];
	_object = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
	if (_x select 4) then {
		_object setDir (_x select 2);
		_object setPos (_x select 1);
	} else {
		_object setPosATL (_x select 1);
		_object setVectorDirAndUp (_x select 3);
	};
} foreach _objects;

because it has tilt info. (From M3Editor?)

On the other hand

["Land_fort_bagfence_corner",[1283.29,2497.98,0],86.2767,0,0,true]

needs

{
    private ["_object"];

    _object = (_x select 0) createVehicleLocal [0,0,0];
    _object setDir (_x select 2);
    _object setPosATL (_x select 1);
    _object enableSimulation false; // :)
}
forEach _objects;

because it only has XYZ placement info.

1 person likes this

Share this post


Link to post
Share on other sites

Yeah, figured that out. I just made different sections for different additions now I can just copy/paste the entire file.

Is there not a way I can just execute the file from the mission? Couldn't seem to get it working last time I tried. @r0fus

Edited by Taylor Swift

Share this post


Link to post
Share on other sites

If you have one file for each way of spawning you can try #include "file.sqf" in initPlayerLocal.sqf for each. About to start messing with this stuff myself so I'll know more later...

Share this post


Link to post
Share on other sites

Taylor, you'd be better off loading the initServer.sqf into the m3editor, then "export to sqf". Save that file and create a server side pbo instead. You can then leave the initServer.sqf empty except for your setTimeMultiplier line. This way your custom traders/add ons will be server side and won't need to be downloaded and other people couldn't take them either. There's a real easy way to do it: http://www.exilemod.com/topic/5604-putting-your-custom-map-contents-in-its-own-serverside-mod/

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.