Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Need help?

    Create a topic in the appropriate section
    Don't write everything in the chat!
  • Take a look at the marketplace

    There you can buy
    everything related to game servers
  • Don't want a ban?

    Please read our rules
    Don't disturb the order!
  • Sell or buy?

    Use services of the guarantor
    We will make your deal safe
TheFirstNoob

Крафт домов на основе прожитого времени - [Craft houses based on survived time]

Recommended Posts

Автор скрипта: Juandayz
Оригинал темы: http://epochmod.com/forum/topic/42367-releasecraft-houses-based-on-survived-time/ 

Описание:
Скрипт позволяет крафтить Дома на основе прожитого времени.

Все работает через "Саперную лопатку"

- Малый дом: Выжить 2 дня + 4 деревянной стены (WoodWalls) + 1 деревянный пол (Floor/Ceiling)
- Средний дом: Выжить 5 дней + 2 каменные стены (CinderWalls) + 1 
деревянный пол (Floor/Ceiling)
- Большой дом: Выжить 8 дней + 4 
каменные стены (CinderWalls) + 1 деревянный пол (Floor/Ceiling)
- Госпиталь для героя: Выжить 2 дня + 5000 положительной репутации (хуманити) + 2 деревянной стены + 1
 деревянный пол (Floor/Ceiling)

Видео:



Вшито в скрипт:
- Лимит 1 дом на 30м плот
- Информация о сборке и Выжившем времени через 30м плот

- Скрипт лечения для Госпиталя героя
- Удалена функция "Только для владельцев" (не проверено автором, но сказал что должно работать)
- Сохранение точной позиции после рестарта





УСТАНОВКА

Потребуется:
- Кастомные файлы fn_selfActions.sqf, variables.sqf, compiles.sqf
- Наличие установленного скрипта: Maca Extra_RC

- Файлы: https://yadi.sk/d/tc-52qi1tYbz4

0. Папку Custom из скачанного архива поместить в папку с вашей миссией (MPMission)


1. Открыть fn_selfAction.sqf:
1.1. Найти:

if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then {

1.2. Добавить НИЖЕ:

if (s_player_plotmenu < 0) then {
	s_player_plotmenu = player addAction ["<t color='#ff5200'>PLOT-INFO</t>", "custom\scripts\house\plotmenu.sqf", [], 5, false];
	};

1.3. Снова найти:

if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then {

1.4. Добавить ВЫШЕ: 

////////////////hospital hero///
if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "GUE_WarfareBFieldhHospital")) then {
if (s_player_hospitalhero < 0) then {
	s_player_hospitalhero = player addAction ["<t color='#ff5200'>Heal-in-Tent</t>", "custom\scripts\house\hospitalhero.sqf", [], 5, false];
	};
	} else {
	    player removeAction s_player_hospitalhero;
            s_player_hospitalhero = -1;
	};
	///////////////////////////////////////////

Должно выглядеть примерно так:


////////////////hospital hero///

if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "GUE_WarfareBFieldhHospital")) then {
if (s_player_hospitalhero < 0) then {
    s_player_hospitalhero = player addAction ["
Heal-in-Tent", "custom\scripts\house\hospitalhero.sqf", [], 5, false];
};
} else {
    player removeAction s_player_hospitalhero;
    s_player_hospitalhero = -1;
};
///////////////////////////////////////////


if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then {

if (s_player_plotmenu < 0) then {
s_player_plotmenu = player addAction ["
PLOT-INFO", "custom\scripts\house\plotmenu.sqf", [], 5, false];
};



1.5. Найти (Без закрывающей скобки!): 

} else {
            player removeAction s_player_maintain_area;
            s_player_maintain_area = -1;
            player removeAction s_player_maintain_area_preview;
            s_player_maintain_area_preview = -1;

1.6. Добавить НИЖЕ:

player removeAction s_player_plotmenu;
s_player_plotmenu = -1;

Должно выглядеть примерно так:


} else {

    player removeAction s_player_maintain_area;
    s_player_maintain_area = -1;
    player removeAction s_player_maintain_area_preview;
    s_player_maintain_area_preview = -1;


    player removeAction s_player_plotmenu;
    s_player_plotmenu = -1;

};



1.7. Найти:

//Engineering
{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];

1.8. Добавить ВЫШЕ:

player removeAction s_player_hospitalhero;
s_player_hospitalhero = -1;
player removeAction s_player_plotmenu;
s_player_plotmenu = -1;

1.9. Найти:

_isModular = _cursorTarget isKindOf "ModularItems";

1.10. ЗАМЕНИТЬ на:

_isModular = (_cursorTarget isKindOf "ModularItems") or ((typeOf _cursorTarget) in DZE_SurvivedHouseRemove);

Все с fn_selfAction.sqf закончили!





2. Открываем Variables.sqf:
2.1. Найти: 

dayz_allowedObjects = ["TentStorage","TentStorageDomed","TentStorageDomed2", "VaultStorageLocked", "Hedgehog_DZ", "Sandbag1_DZ","BagFenceRound_DZ","TrapBear","Fort_RazorWire","WoodGate_DZ","Land_HBarrier1_DZ","Land_HBarrier3_DZ","Land_HBarrier5_DZ","Fence_corrugated_DZ","M240Nest_DZ","CanvasHut_DZ","ParkBench_DZ","MetalGate_DZ","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","Plastic_Pole_EP1_DZ","Generator_DZ","StickFence_DZ","LightPole_DZ","FuelPump_DZ","DesertCamoNet_DZ","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ","SandNest_DZ","DeerStand_DZ","MetalPanel_DZ","WorkBench_DZ","WoodFloor_DZ","WoodLargeWall_DZ","WoodLargeWallDoor_DZ","WoodLargeWallWin_DZ","WoodSmallWall_DZ","WoodSmallWallWin_DZ","WoodSmallWallDoor_DZ","LockboxStorageLocked","WoodFloorHalf_DZ","WoodFloorQuarter_DZ","WoodStairs_DZ","WoodStairsSans_DZ","WoodStairsRails_DZ","WoodSmallWallThird_DZ","WoodLadder_DZ","Land_DZE_GarageWoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_WoodDoor","Land_DZE_GarageWoodDoorLocked","Land_DZE_LargeWoodDoorLocked","Land_DZE_WoodDoorLocked","CinderWallHalf_DZ","CinderWall_DZ","CinderWallDoorway_DZ","CinderWallDoor_DZ","CinderWallDoorLocked_DZ","CinderWallSmallDoorway_DZ","CinderWallDoorSmall_DZ","CinderWallDoorSmallLocked_DZ","MetalFloor_DZ","WoodRamp_DZ","GunRack_DZ","FireBarrel_DZ","WoodCrate_DZ","Scaffolding_DZ"];

2.2. ЗАМЕНИТЬ на:

dayz_allowedObjects = ["GUE_WarfareBFieldhHospital","MAP_bouda2_vnitrek","MAP_deutshe_mini","MAP_Mil_Mil_Guardhouse","TentStorage","TentStorageDomed","TentStorageDomed2", "VaultStorageLocked", "Hedgehog_DZ", "Sandbag1_DZ","BagFenceRound_DZ","TrapBear","Fort_RazorWire","WoodGate_DZ","Land_HBarrier1_DZ","Land_HBarrier3_DZ","Land_HBarrier5_DZ","Fence_corrugated_DZ","M240Nest_DZ","CanvasHut_DZ","ParkBench_DZ","MetalGate_DZ","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","Plastic_Pole_EP1_DZ","Generator_DZ","StickFence_DZ","LightPole_DZ","FuelPump_DZ","DesertCamoNet_DZ","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ","SandNest_DZ","DeerStand_DZ","MetalPanel_DZ","WorkBench_DZ","WoodFloor_DZ","WoodLargeWall_DZ","WoodLargeWallDoor_DZ","WoodLargeWallWin_DZ","WoodSmallWall_DZ","WoodSmallWallWin_DZ","WoodSmallWallDoor_DZ","LockboxStorageLocked","WoodFloorHalf_DZ","WoodFloorQuarter_DZ","WoodStairs_DZ","WoodStairsSans_DZ","WoodStairsRails_DZ","WoodSmallWallThird_DZ","WoodLadder_DZ","Land_DZE_GarageWoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_WoodDoor","Land_DZE_GarageWoodDoorLocked","Land_DZE_LargeWoodDoorLocked","Land_DZE_WoodDoorLocked","CinderWallHalf_DZ","CinderWall_DZ","CinderWallDoorway_DZ","CinderWallDoor_DZ","CinderWallDoorLocked_DZ","CinderWallSmallDoorway_DZ","CinderWallDoorSmall_DZ","CinderWallDoorSmallLocked_DZ","MetalFloor_DZ","WoodRamp_DZ","GunRack_DZ","FireBarrel_DZ","WoodCrate_DZ","Scaffolding_DZ"];

2.2.1. И Добавить НИЖЕ:

DZE_SurvivedHouseRemove = ["GUE_WarfareBFieldhHospital","MAP_bouda2_vnitrek","MAP_deutshe_mini","MAP_Mil_Mil_Guardhouse"];

2.3. Найти:

DZE_maintainClasses = ["ModularItems","DZE_Housebase","LightPole_DZ","BuiltItems","Plastic_Pole_EP1_DZ","Fence_corrugated_DZ","CanvasHut_DZ","ParkBench_DZ","MetalGate_DZ","StickFence_DZ","DesertCamoNet_DZ","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ","DeerStand_DZ","Scaffolding_DZ","FireBarrel_DZ"];

2.4. ЗАМЕНИТЬ на:

DZE_maintainClasses = ["GUE_WarfareBFieldhHospital","MAP_bouda2_vnitrek","MAP_deutshe_mini","MAP_Mil_Mil_Guardhouse","ModularItems","DZE_Housebase","LightPole_DZ","BuiltItems","Plastic_Pole_EP1_DZ","Fence_corrugated_DZ","CanvasHut_DZ","ParkBench_DZ","MetalGate_DZ","StickFence_DZ","DesertCamoNet_DZ","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ","DeerStand_DZ","Scaffolding_DZ","FireBarrel_DZ"];

2.5. Найти:

dayz_resetSelfActions = {

2.6. Добавить НИЖЕ: 

s_player_plotmenu = -1;
s_player_hospitalhero = -1;

Все с Variables.sqf Закончили.





3. Открываем compile.sqf:
3.1. Найти:

player_removeObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\remove.sqf";

3.2. ЗАМЕНИТЬ на: 

player_removeObject = compile preprocessFileLineNumbers "custom\scripts\house\remove.sqf"; 

Все с Compile.sqf Закончили.




4. Открываем Extra_RC.sqf:
4.1. Если файл пустой, то:

class ExtraRc {

class ItemEtool {
     class shouse {
        text = "Small Houses";
        script = "execVM 'custom\scripts\house\smallhouse.sqf'";
     };    
     class mhouse {
        text = "Medium Houses";
        script = "execVM 'custom\scripts\house\mediumhouse.sqf'";
     };
     class lhouse {
        text = "Large Houses";
        script = "execVM 'custom\scripts\house\largehouse.sqf'";
     };
     class hhouse {
        text = "Hero House";
        script = "execVM 'custom\scripts\house\herohouse.sqf'";
     };
    };

};

4.2. Если класс "class ExtraRc" уже имеется, то:

class ItemEtool {
     class shouse {
        text = "Small Houses";
        script = "execVM 'custom\scripts\house\smallhouse.sqf'";
     };    
     class mhouse {
        text = "Medium Houses";
        script = "execVM 'custom\scripts\house\mediumhouse.sqf'";
     };
     class lhouse {
        text = "Large Houses";
        script = "execVM 'custom\scripts\house\largehouse.sqf'";
     };
     class hhouse {
        text = "Hero House";
        script = "execVM 'custom\scripts\house\herohouse.sqf'";
     };
    };

4.3. Если классы "class ExtraRc" и "class ItemEtool" уже имеются, то:

class shouse {
        text = "Small Houses";
        script = "execVM 'custom\scripts\house\smallhouse.sqf'";
     };    
     class mhouse {
        text = "Medium Houses";
        script = "execVM 'custom\scripts\house\mediumhouse.sqf'";
     };
     class lhouse {
        text = "Large Houses";
        script = "execVM 'custom\scripts\house\largehouse.sqf'";
     };
     class hhouse {
        text = "Hero House";
        script = "execVM 'custom\scripts\house\herohouse.sqf'";
     };



На этом все :3

Share this post


Link to post
Share on other sites



Для тех кто использует ПКМ через DZE_CLICK_ACTIONS делаем так:

открываем config.sqf и подабляем перед



["Binocular","5000 Meters","setViewDistance 5000; systemChat('ViewDistance: 5000'); systemChat('Warning: Higher the distance, the lower the FPS');","true"]

это



["ItemEtool","Малый дом","execVM 'custom\scripts\house\smallhouse.sqf';","true"],
["ItemEtool","Средний дом","execVM 'custom\scripts\house\mediumhouse.sqf';","true"],
["ItemEtool","Большой дом","execVM 'custom\scripts\house\largehouse.sqf';","true"],
["ItemEtool","Геройский дом","execVM 'custom\scripts\house\herohouse.sqf';","true"],
Edited by RedLink (see edit history)

Share this post


Link to post
Share on other sites

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

  • Similar Content

    • By BR0wi
      Подскажите где найти людей, которые делаю моды на заказ. К кому вообще обращаться? Или что бы реализовать свои идеи нужно самому "год" сидеть и изучать все механики модинга?
    • By CubeIn
      Приветствую господа, хочу создать новый проект, уникальный, но для этого нужен маппер.
      Я оставлю здесь свой дискрод, напишите в лс, кто готов взяться за крупный проект.
      4me#4542
    • By 6agu
      Поставил
      Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.
    • By 123new
      Много вопросов на данную тему наблюдаю от новичков, попробую прояснить немного сей вопрос.
       
      Предположим. что вы уже знаете на каких координатах вам надо спавнить определенное здание или объект\животное\бота, с каким углом поворота. И так. эта тема для вас.
       
      Сразу делаю пометку, метод, который добавили нам разработчики игры в патче 1.15, очень хорошо описал наш товарищ в сообщении форума:
      Рекоммендую вам использовать именно его!
      Ниже опубликованы старые методы.
       
      Если вы с расставили их с модифицированной версии Offline (Offline by Arksenor это называется), то вы получили и нашли код вида:
      GetGame().CreateObject("Land_CementWorks_ExpeditionB", "13251.875000 0.0 3748.525879").SetOrientation("-96.000000 0.000000 0.000000"); GetGame().CreateObject("Land_CementWorks_ExpeditionB", "13254.599609 0.0 3722.703613").SetOrientation("-96.000000 0.000000 0.000000"); GetGame().CreateObject("Land_CementWorks_ExpeditionB", "13257.344727 0.0 3696.718750").SetOrientation("-96.000000 0.000000 0.000000"); GetGame().CreateObject("Land_CementWorks_ExpeditionB", "13260.040039 0.0 3670.984131").SetOrientation("-96.000000 0.000000 0.000000"); GetGame().CreateObject("Land_CementWorks_ExpeditionB", "13262.756836 0.0 3645.180176").SetOrientation("-96.000000 0.000000 0.000000"); GetGame().CreateObject("Land_CementWorks_ExpeditionB", "13265.441406 0.0 3619.531982").SetOrientation("-96.000000 0.000000 0.000000"); GetGame().CreateObject("Land_CementWorks_ExpeditionB", "13268.124023 0.0 3593.995361").SetOrientation("-96.000000 0.000000 0.000000"); GetGame().CreateObject("Land_CementWorks_ExpeditionB", "13270.844727 0.0 3568.186523").SetOrientation("-96.000000 0.000000 0.000000"); GetGame().CreateObject("Land_CementWorks_ExpeditionB", "13273.514648 0.0 3542.561279").SetOrientation("-96.000000 0.000000 0.000000"); GetGame().CreateObject("Land_CementWorks_ExpeditionB", "13276.195313 0.0 3517.048828").SetOrientation("-96.000000 0.000000 0.000000"); GetGame().CreateObject("Land_CementWorks_ExpeditionB", "13278.399414 0.0 3496.097900").SetOrientation("-96.000000 0.000000 0.000000"); Здесь (по примеру первой строки) 1 значение в скобках - id постройки/объекта, 2 значение - координаты в формате X Y Z, разделенные пробелом, 3 - значение поворота примерно в том же формате.
      Как это делать в Offline - статья от автора Offine:
      https://github.com/Arkensor/DayZCommunityOfflineMode/wiki/Add-custom-objects-to-your-server-or-mission
       
      И так, инструкция:
      1. Добавляем в начало init.c файла в вашей mpmissions следующий код:
      #include "$CurrentDir:mpmissions\dayzOffline.chernarusplus\spawn_buildings.c" 2. Создаем в папке вашей активной mpmissions файлик spawn_buildings.c и заполняем его следующей информацией.
      void SpawnObject( string type, vector position, vector orientation ) { private string NameBlockLog = "[CreateObject] "; private string InfoLog = ""; if(type != "") { auto obj = GetGame().CreateObject( type, "0 0 0" ); if(obj) { if ((position[0] != 0) && (position[1] != 0) && (position[2] != 0)) { obj.SetPosition( position ); obj.SetOrientation( orientation ); obj.Update(); if (obj.CanAffectPathgraph()) { obj.SetAffectPathgraph(true, false); GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(GetGame().UpdatePathgraphRegionByObject, 100, false, obj); } InfoLog = "[Type: '" + obj.GetType() + "' Position: '" + obj.GetPosition().ToString() + "' Orientation: '" + obj.GetOrientation().ToString() + "']"; Write_Log(NameBlockLog + " Object has been created successfully! Info " + InfoLog); } else { InfoLog = "[Type: '" + type + "' Position: '" + position + "' Orientation: '" + orientation + "']"; Write_Log(NameBlockLog + " Object can't be created! Incorrect writed position. Info " + InfoLog); } } else { InfoLog = "[Type: '" + type + "' Position: '" + position + "' Orientation: '" + orientation + "']"; Write_Log(NameBlockLog + " Object can't be created! Info " + InfoLog); } } else { InfoLog = "[Type: '" + type + "' Position: '" + position + "' Orientation: '" + orientation + "']"; Write_Log(NameBlockLog + " Object can't be created! Incorrect writed type. Info " + InfoLog); } } void Write_Log(string message) { Print(String(message)); } 3. Открываем созданный нами файл,  и в конце файла дописываем следующее:
      void SpawnAirfeeldBuildings() { SpawnObject( "Land_CementWorks_ExpeditionB", "13251.875000 0.0 3748.525879", "-96.000000 0.000000 0.000000"); SpawnObject( "Land_CementWorks_ExpeditionB", "13254.599609 0.0 3722.703613", "-96.000000 0.000000 0.000000"); SpawnObject( "Land_CementWorks_ExpeditionB", "13257.344727 0.0 3696.718750", "-96.000000 0.000000 0.000000"); } void SpawnKrasnoBuildings() { SpawnObject( "Land_CementWorks_ExpeditionB", "13251.875000 0.0 3748.525879", "-96.000000 0.000000 0.000000"); SpawnObject( "Land_CementWorks_ExpeditionB", "13254.599609 0.0 3722.703613", "-96.000000 0.000000 0.000000"); SpawnObject( "Land_CementWorks_ExpeditionB", "13257.344727 0.0 3696.718750", "-96.000000 0.000000 0.000000"); } Где после void - название функции идет, а между открытыми скобками вызов спавна самих зданий на указанных координатах.
      На примере 1 строки:
      Land_CementWorks_ExpeditionB - id постройки (type)
      13251.875000 0.0 3748.525879 - координаты в формате X Y Z
      -96.000000 0.000000 0.000000 - значение поворота в формате X Y Z
      Внимание: id постройки и координаты в примере указаны не верные и требуют подключения дополнительной модификации для корректной работы!!! Координаты не соответствуют названию функции!!!
      4. открываем в MpMissions в папке с вашей активной миссией init.c и перед ЗАКРЫВАЮЩЕЙ скобкой '}' дописываем нужную нам функцию (это будет активация спавна на карте):
      SpawnAirfeeldBuildings(); 5. Готово, Запускайте сервер, и в scripts.log вы увидите процедуру спавна ваших зданий и увидите, спавнятся ли они на карте или нет.
      Можно написать конечно и более готовую, универсальную систему спавна на карте со считыванием конфигурации из файла, но я считаю это лишним.
       
      Как заполнить добавленные здания лутом на карте:
      вариант 1:
      https://github.com/Arkensor/DayZCommunityOfflineMode/wiki/Enable-loot-for-custom-placed-objects
      вариант 2: вручную заполнить xml-файл  mapgrouppos.xml в mpmssions данными о местоположении зданий, где rpy - значение поворота здания в формате Z Y X
       
      С помощью данной статьи вы можете разместить любой элемент игры(постройку, животное, зомби, бота), доступный к спавну через любую модификацию-админ. панель. Очень полезный мод в этом смысле BuilderItems, с его помощью можно творить поистину интересные локации!
    • By Venom21
      Появилась такая проблема, нужно закрыть некоторые слоты под одежду, когда на определённый слот одет предмет…
      пример: возьмём экзоскелет от Фидова, там есть две версии которая одеваеться как на тело и ноги, и есть которая одеваться на разгрузку и пояс, так вот, нужно например чтобы при одетом экзаче на тело и ноги слоты под пояс и разгрузку блокировались, либо только под определенные предметы, если есть интерес то цену можем в личке обсудить…
      P.S. Разрешение от Фидова на переделку и переупаковку есть)
  • Our picks

×
×
  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.