Da0ne / DZMods

DayZ Standalone Vanilla++ project
Other
34 stars 19 forks source link

Request on custom buildings #137

Closed RealShu closed 5 years ago

RealShu commented 5 years ago

So I made a previous post about the buildings spawn format. But currently I only use the old dzmods as the new one is not as developed as i like. Can anyone reformat my buildings from the new "SpawnObject" to the old "obj = GetGame().CreateObject" format? Since i seemed to make map edits a day after the offline tools were updated.

S4MT3K commented 5 years ago

Arkensors new development branch has something to do with formatting the exported code. Take a deeper look on it. Also browse the issues sy8282 had made an issue ticket for this ;)

GravityWolfNotAmused commented 5 years ago

@RealShu Everyone keeps asking to revert back to the original, and I don't understand why, and maybe you can explain more.

https://github.com/Da0ne/DZMods/blob/99401143b820a12cfea69f6748c3ef55f475f169/mpmissions/DayZSurvival.chernarusplus/ScriptedMods/Tunables.c#L81-L88

Above is the way you add buildings currently to your server. This is extremely close to the same solution as the original solution. All this is, is a collection of objects which will be placed, and called the same way as they were before I changed it, the only difference is that you don't have to add 1000 CreateObject calls. Instead all these objects are thrown through a loop and created one by one.

Current Spawner:

https://github.com/Da0ne/DZMods/blob/99401143b820a12cfea69f6748c3ef55f475f169/mpmissions/DayZSurvival.chernarusplus/ScriptedMods/Modules/CustomBuildings/BuildingSpawner.c#L34-L45

Old Spawner:

void Init() {
    Print("BuildingSpawner:: Spawning custom scripted buildings....");
    Object obj;
    obj = GetGame().CreateObject( "Land_Airfield_Hangar_Green", "11990.633789 146.099136 12485.503906", false, true );
    obj.SetOrientation("-157.000046 -1.000000 -0.000000");
    obj.SetDirection(obj.GetDirection());
}

Game#CreateObject Documentation:

proto native Object CreateObject( string type, vector pos, bool create_local = false, bool init_ai = false, bool create_physics = true );
sy8282 commented 5 years ago

i found that the new way just doesnt work properly items out of place first pic is the new spawner, asa and this is the old way asas think it may be an issue with arkensors mod as on the description for the new online tools he says some objects dont align properly and positions change, but ive had zero issues with the old spawner

sy8282 commented 5 years ago

@GravityWolfNotAmused sorry for the crap quality of pics but think they show the issue

GravityWolfNotAmused commented 5 years ago

So, you all have used the old and new with the same values? Could be it DayZ ??

sy8282 commented 5 years ago

We built it on the old com editor with the old spawner works perfectly Tried to convert to new values was awful, rebuilt with new com editor on the editor it looks perfect then added to server with new spawner and it comes out like the photo stuff out of line on all axis, hence why I think it's a problem with the new com editor

GravityWolfNotAmused commented 5 years ago

@sy8282 Send me a snippet of what you used for the old code for one object spawn.

GravityWolfNotAmused commented 5 years ago

Maybe there is something I am not seeing that you have written inside of you spawner which I am not doing with mine.

GravityWolfNotAmused commented 5 years ago

@sy8282 Can I please get that snippet please?

dred1200 commented 5 years ago

i just got this admin tool how do i use the building spawner? is it something we can do in game? i cant seem to find the key for it

sy8282 commented 5 years ago

@GravityWolfNotAmused I used the standard format from the old spawner and I'm still on the server sided moddedscripts as when I switch to the @vanillapp on my test server we converted the old code to new and got bad results, thought it may of been the way we converted it so we rebuilt with the new com editor and again got bad results so we went back to the old moddedscripts and the old com editor

S4MT3K commented 5 years ago

Didnt i mentioned that this is caused by a wrong hive call in?

@robotstar has fixed it with my idea of putting the hivecall directly into the DayZSurvival function in the Missionserver section.