Cheiffa

Problems with Eden custom buildings

14 posts in this topic

Posted (edited)

For some reason my code doesn't work. I've tried different given Object lines for my SQF

 

NOTE: I am using Dealman's eden tools to copy the object info.

 

Quote

_objects =
[

 
   
    ["Land_Hangar_F",[4688.1,2554.56,8.99194],[[-0.892762,0.450528,0],[0,0,1]],false]
];

{
    private ["_object"];

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

 

Quote

_objects =

[

 

 

private ["_objs"];
_objs = [
["Land_Hangar_F",[4688.1,2554.56,8.99194],[[-0.892762,0.450528,0],[0,0,1]],false]
        
];

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

Anyone have any ideas? They don't show up at all. 

Edited by Cheiffa

Share this post


Link to post
Share on other sites

Posted (edited)

Just tried it this way with no avail

 

    _objects =
        [
            ["Land_Hangar_F",[4688.1,2554.56,8.99194],[[-0.892762,0.450528,0],[0,0,1]],false] 
        ];
    {
        private _object = (_x select 0) createVehicle [0,0,0];
        _object setPosASL (_x select 1);
        _object setVectorDirAndUp (_x select 2);
        _object enableSimulationGlobal ((_x select 3) select 0);
        _object allowDamage ((_x select 3) select 1);
    }
    forEach _objects;

 

 

 

Edited by Cheiffa

Share this post


Link to post
Share on other sites
Advertisement

Posted (edited)

Now I'm trying this


 

Quote

    _objectNew =
        [
            ["Land_Hangar_F",[4688.1,2554.56,8.99194],[[-0.892762,0.450528,0],[0,0,1]],false] 
        ];
    
    {
    private ["_objectNew"];

    _object = (_x select 0) createVehicle [0,0,0];
    _object setPosASL (_x select 1);
    _object setVectorDirAndUp (_x select 2);
    _object allowDamage (_x select 3);
    _object enableSimulationGlobal (_x select 4);
}
forEach _objectNew;

It would be really cool to know why there's so many different ways to do these and what the difference is.

 

can anyone explain the object format and what each number/part means and then which "bottom" to use for the array based on it?

 

Thanks

Edited by Cheiffa

Share this post


Link to post
Share on other sites

Okay!  So the last one I tried worked. Could anyone explain why?

woooo

Share this post


Link to post
Share on other sites

Hey, sorry for the trouble - I've meant to update it since I use a different format to what Exile does normally. Basically I just made it so setVectorDirAndUp can be used in order to prevent ArmA from pushing objects apart and not maintaining the proper rotation.

This is the proper code;
 

{
    private ["_object"];

    _object = (_x select 0) createVehicle [0,0,0];
    _object setPosASL (_x select 1);
	_object setVectorDirAndUp (_x select 2);
    _object allowDamage (_x select 3);
    _object enableSimulationGlobal (_x select 3);
}
forEach _objects;

The reason for this is because it's a multi-dimensional array, basically - it's an array that contains other arrays. See this image as a reference;
ViR5w1B.png

As you can see allowDamage and enableSimulationGlobal use the same value - you can easily change this by adding another false boolean to the array and change _x select 3 to _x select 4 since there would be a new item in the array.

Share this post


Link to post
Share on other sites

Posted (edited)

This is what has been working for me

Quote

private ["_objectNew"];

    _object = (_x select 0) createVehicle [0,0,0];
    _object setPosASL (_x select 1);
    _object setVectorDirAndUp (_x select 2);
    _object allowDamage (_x select 3);
    _object enableSimulationGlobal (_x select 4);
}
forEach _objectNew;
 

 

Should I change to yours? Or will this one continue to work. EDIT: I guess that's what the last part meant.

Edited by Cheiffa

Share this post


Link to post
Share on other sites

I would assume _object enableSimulationGlobal (_x select 4); would result in null and as such, objects would still have simulation enabled. You can try this by adding this to the bottom of the for loop(below _object enableSimulationGlobal);

["Simulation: %1", (_object enableSimulationGlobal (_x select 4))] call BIS_fnc_logFormat;

Then check the RPT and see if it returned false or null. If it returns null; change 4 to 3. Otherwise keep as-is.

Share this post


Link to post
Share on other sites

Last question. I got duplicates of buildings. Is that because it's initiating my initserver multiple times? Trying to figure that out now. Having to go through 3 doors lol

Share this post


Link to post
Share on other sites

That's rather odd, have you made sure you don't have duplicates in the array? I don't think initServer.sqf is run more than once - but it shouldn't...? D:

Share this post


Link to post
Share on other sites

Initserver was run twice. Not sure why but it was enabled in Initplayerlocal

Some buildings don't spawn loot even with the classnames and loot tables set up properly. Any reason for that (For example Cup baracks i ep1.

Just using Arma 3 items for now as they seem to work well.

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.