Sign in to follow this  
Followers 0
John

Efficient script or no?

7 posts in this topic

So, I wanted to create another building and this works totally fine, but it occured to me that I can use the existing initserver.sqf file. However I wanted to ensure loot spawned so im not sure if the initserver one will work? I wasnt sure becuase in the initserver.sqf simulation is disabled for the objects created not sure how that affects loot spawning. This way, the loot spawns ok.

Currently I have this  in a "barracks.sqf"

if (!isServer) exitWith {};
_obj1 = createVehicle ["Land_i_Barracks_V1_F",[14254.2,13010.9,-4.76837e-007],[], 0, "CAN_COLLIDE"];
_obj1 setVectorUp [0,0,1];

I then execute the script in the InitServer.sqf via 

if (isServer) then {
[] execVM "barracks.sqf";};

I have two questions -

1. Is this efficient?

2. Can I simply add the object to the initserver.sqf, if so, the format is a little bit different can someone show me how the above createvehicle would go into the existing format?

Thanks a bunch

Edited by John

Share this post


Link to post
Share on other sites

With or without simulation, loot spawns. I recommend not using simulation on building objects.

Share this post


Link to post
Share on other sites
Advertisement

With or without simulation, loot spawns. I recommend not using simulation on building objects.

Ok, so if I were to put that into the intitserver, in the same format, could you help me, where i am stuck is the initserver has more.. numbers.. IE

//mine 
["Land_i_Barracks_V1_F",[14254.2,13010.9,-4.76837e-007]
//initserver
["Land_CarService_F",[14618.7,16877.4,0.900759],131.363,0,0,false],

Not sure what the additional numbers outside of the array in initserver are?

Also what takes care of this from my original code? Is that handled somewhere in
inside the initserver?

_obj1 setVectorUp [0,0,1];

Also, you mentioned building objects? Not suer what you meant, this is a barracks, nothing built?

Edited by John

Share this post


Link to post
Share on other sites
  1. Classname
  2. grid coords
  3. Direction
  4. no idea
  5. no idea
  6. Simulation

 

Share this post


Link to post
Share on other sites

Gr8 what if I jsut did this and used my current setup?

if (!isServer) exitWith {};
_obj1 = createVehicle ["Land_i_Barracks_V1_F",[14254.2,13010.9,-4.76837e-007],[], 0, "CAN_COLLIDE"];
_obj1 setVectorUp [0,0,1];
_obj1 enableSimulation = false;

 

Share this post


Link to post
Share on other sites

Try this :

if (isServer) then {
    _obj1 = createVehicle ["Land_i_Barracks_V1_F",[14254.2,13010.9,-4.76837e-007],[], 0, "CAN_COLLIDE"];
    _obj1 setVectorUp [0,0,1];
    _obj1 enableSimulation false;
};

 

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
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.