easier and there is no function calling, so it'd be way faster too. Less performance impactHaha, just an example from item names I could remember off the top of my head.
That looks a lot easier to do then all the add and remove if statements.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
easier and there is no function calling, so it'd be way faster too. Less performance impactHaha, just an example from item names I could remember off the top of my head.
That looks a lot easier to do then all the add and remove if statements.
easier and there is no function calling, so it'd be way faster too. Less performance impact
Ahhh yea, inventory space is an obvious issue. I would attempt to devise a short method to check inventory space, and if they have no room, check backpack space, and if they have no room in their backpack, create a weaponholder beneath the player. Just an idea though.I remembered the reasoning behind doing it the way I did now. It was to make sure each item was taken, and that each item was given.
such as in what you said:
player addMagazine ["FoodCanBeef",2];
I need to make sure that they really got 2 cans of beef.
I'm thinking I might do a mix between yours and mine, do the magazine check for items that need to be removed and remove them, then for adding I'd use the BIS_fnc.Ahhh yea, inventory space is an obvious issue. I would attempt to devise a short method to check inventory space, and if they have no room, check backpack space, and if they have no room in their backpack, create a weaponholder beneath the player. Just an idea though.
It would definitely work, but the functions will likely be laggier on lower end pc's of course it wont last long it will just be momentary, but it could still be a potential problem (assuming your server is edited to the tits like most are) if your server is relatively script empty then it shouldnt have any impact at all, but might take a second or two to run through the whole script. Its really preference, either method works, neither ones better. One has more ability, but is slower, ones barebones and fast, but has issues with inventory space. Like you said though, I think some sort of mix of the two would work perfectly.I'm thinking I might do a mix between yours and mine, do the magazine check for items that need to be removed and remove them, then for adding I'd use the BIS_fnc.
private ["_vehicletype","_position","_vehicle","_dir","_result3","_result2","_queststatus","_result","_quest"];
_quest = _this select 0;
if (_quest == "Boat") then {
_queststatus = player getVariable ["QuestBoat",0];
if (isnil "_queststatus") then {
player setVariable ["QuestBoat",0,true];
};
if (_queststatus == 1) exitwith {systemchat 'I do not need anymore parts at the moment, check back later and I may need more help.';};
_result = [player,"PartEngine"] call BIS_fnc_invRemove;
if (_result == 1) then {
if(DZSQ_Epoch)then{
_result2 = [player,"PartGeneric"] call BIS_fnc_invRemove;
}else{
_result2 = [player,"equip_hose"] call BIS_fnc_invRemove;
};
if (_result2 == 1) then {
if(DZSQ_Epoch)then{
_result3 = [player,"ItemWire"] call BIS_fnc_invRemove;
}else{
_result3 = [player,"equip_string"] call BIS_fnc_invRemove;
};
if (_result3 == 1) then {
//reward
_vehicletype = "PBX";
_position = [(position player),0,40,1,2,2000,0] call BIS_fnc_findSafePos;
if (!(_vehicletype in DayZ_SafeObjects)) then {
DayZ_SafeObjects = DayZ_SafeObjects + [_vehicletype];
publicVariable "DayZ_SafeObjects";
};
_vehicle = createVehicle [_vehicletype, _position, [], 0, "CAN_COLLIDE"];
_dir = getdir _vehicle;
PVDZ_obj_Publish = [0,_vehicle,[_dir,_position],[]];
publicVariableServer "PVDZ_obj_Publish";
systemchat 'Thank you for helping me out! I have left my PBX nearby, you can take it when you find it.';
} else {
if(DZSQ_Epoch)then{
[player,"PartGeneric"] call BIS_fnc_invAdd;
[player,"PartEngine"] call BIS_fnc_invAdd;
systemchat 'Something went wrong and you do not have Wire in your inventory. Try again once you have all the parts.';
}else{
[player,"equip_hose"] call BIS_fnc_invAdd;
[player,"PartEngine"] call BIS_fnc_invAdd;
systemchat 'Something went wrong and you do not have a string in your inventory. Try again once you have all the parts.';
};
};
} else {
if(DZSQ_Epoch)then{
[player,"PartEngine"] call BIS_fnc_invAdd;
systemchat 'Something went wrong and you do not have Scrap Metal in your inventory. Try again once you have all the parts.';
}else{
[player,"PartEngine"] call BIS_fnc_invAdd;
systemchat 'Something went wrong and you do not have a hose in your inventory. Try again once you have all the parts.';
};
};
} else {
systemchat 'Something went wrong and you do not have an engine in your inventory. Try again once you have all the parts.';
};
};
if (_controltype == "Boat") then { //cheesy as shit!
if(DZSQ_Epoch)then{
_text = [
"Ahoy there! I seem to have found myself in a situation that maybe you can help me with now that you are here. I drove my boat out here to checkout the island. I ran across some rocks and now the engine is fried so I need a new one. Could you go out and find me an Engine, some Scrap Metal, and some Wire ? Id do it myself but I dont know how to swim. Ill give you my boat if you help me out.",
"Do you have a second to help me out? My boat broke down and I need a new engine, some Scrap Metal, some Wire to repair it. I can't swim so I'm unable to get it myself. Would you be able to go out and find me what I need? If you do I'll give you my boat and wait for a passerby and get off this island myself.",
"You wouldn't happen to have an engine, some Scrap Metal, and some Wire would you? I got a boat I need to repair but I'm unable to get off this island to get the repair items I need. If you go out and bring me back the supplies I will give you my boat and you can do with it as you please."
] call BIS_fnc_selectrandom;
}else{
_text = [
"Ahoy there! I seem to have found myself in a situation that maybe you can help me with now that you are here. I drove my boat out here to checkout the island. I ran across some rocks and now the engine is fried so I need a new one. Could you go out and find me an Engine, a hose, and some string? Id do it myself but I dont know how to swim. Ill give you my boat if you help me out.",
"Do you have a second to help me out? My boat broke down and I need a new engine, hose, some string to repair it. I can't swim so I'm unable to get it myself. Would you be able to go out and find me what I need? If you do I'll give you my boat and wait for a passerby and get off this island myself.",
"You wouldn't happen to have an engine, a hose, and some string would you? I got a boat I need to repair but I'm unable to get off this island to get the repair items I need. If you go out and bring me back the supplies I will give you my boat and you can do with it as you please."
] call BIS_fnc_selectrandom;
};
((findDisplay 44412) displayCtrl 1103) ctrlSetText _text;
};
DZSQ_Epoch = true;
Thats fine with me haha... the requirements, and rewards can all be changed around I'm just kinda trying to get it all together. Shouldn't be hard to add an epoch check in.mind if i edit it for epoch??
perhaps add a switch to check for epoch and adjust the quests ??
hers an example of how the boat quest i edited for epoch
Code:private ["_vehicletype","_position","_vehicle","_dir","_result3","_result2","_queststatus","_result","_quest"]; _quest = _this select 0; if (_quest == "Boat") then { _queststatus = player getVariable ["QuestBoat",0]; if (isnil "_queststatus") then { player setVariable ["QuestBoat",0,true]; }; if (_queststatus == 1) exitwith {systemchat 'I do not need anymore parts at the moment, check back later and I may need more help.';}; _result = [player,"PartEngine"] call BIS_fnc_invRemove; if (_result == 1) then { if(DZSQ_Epoch)then{ _result2 = [player,"PartGeneric"] call BIS_fnc_invRemove; }else{ _result2 = [player,"equip_hose"] call BIS_fnc_invRemove; }; if (_result2 == 1) then { if(DZSQ_Epoch)then{ _result3 = [player,"ItemWire"] call BIS_fnc_invRemove; }else{ _result3 = [player,"equip_string"] call BIS_fnc_invRemove; }; if (_result3 == 1) then { //reward _vehicletype = "PBX"; _position = [(position player),0,40,1,2,2000,0] call BIS_fnc_findSafePos; if (!(_vehicletype in DayZ_SafeObjects)) then { DayZ_SafeObjects = DayZ_SafeObjects + [_vehicletype]; publicVariable "DayZ_SafeObjects"; }; _vehicle = createVehicle [_vehicletype, _position, [], 0, "CAN_COLLIDE"]; _dir = getdir _vehicle; PVDZ_obj_Publish = [0,_vehicle,[_dir,_position],[]]; publicVariableServer "PVDZ_obj_Publish"; systemchat 'Thank you for helping me out! I have left my PBX nearby, you can take it when you find it.'; } else { if(DZSQ_Epoch)then{ [player,"PartGeneric"] call BIS_fnc_invAdd; [player,"PartEngine"] call BIS_fnc_invAdd; systemchat 'Something went wrong and you do not have Wire in your inventory. Try again once you have all the parts.'; }else{ [player,"equip_hose"] call BIS_fnc_invAdd; [player,"PartEngine"] call BIS_fnc_invAdd; systemchat 'Something went wrong and you do not have a string in your inventory. Try again once you have all the parts.'; }; }; } else { if(DZSQ_Epoch)then{ [player,"PartEngine"] call BIS_fnc_invAdd; systemchat 'Something went wrong and you do not have Scrap Metal in your inventory. Try again once you have all the parts.'; }else{ [player,"PartEngine"] call BIS_fnc_invAdd; systemchat 'Something went wrong and you do not have a hose in your inventory. Try again once you have all the parts.'; }; }; } else { systemchat 'Something went wrong and you do not have an engine in your inventory. Try again once you have all the parts.'; }; };
and the dialog
Code:if (_controltype == "Boat") then { //cheesy as shit! if(DZSQ_Epoch)then{ _text = [ "Ahoy there! I seem to have found myself in a situation that maybe you can help me with now that you are here. I drove my boat out here to checkout the island. I ran across some rocks and now the engine is fried so I need a new one. Could you go out and find me an Engine, some Scrap Metal, and some Wire ? Id do it myself but I dont know how to swim. Ill give you my boat if you help me out.", "Do you have a second to help me out? My boat broke down and I need a new engine, some Scrap Metal, some Wire to repair it. I can't swim so I'm unable to get it myself. Would you be able to go out and find me what I need? If you do I'll give you my boat and wait for a passerby and get off this island myself.", "You wouldn't happen to have an engine, some Scrap Metal, and some Wire would you? I got a boat I need to repair but I'm unable to get off this island to get the repair items I need. If you go out and bring me back the supplies I will give you my boat and you can do with it as you please." ] call BIS_fnc_selectrandom; }else{ _text = [ "Ahoy there! I seem to have found myself in a situation that maybe you can help me with now that you are here. I drove my boat out here to checkout the island. I ran across some rocks and now the engine is fried so I need a new one. Could you go out and find me an Engine, a hose, and some string? Id do it myself but I dont know how to swim. Ill give you my boat if you help me out.", "Do you have a second to help me out? My boat broke down and I need a new engine, hose, some string to repair it. I can't swim so I'm unable to get it myself. Would you be able to go out and find me what I need? If you do I'll give you my boat and wait for a passerby and get off this island myself.", "You wouldn't happen to have an engine, a hose, and some string would you? I got a boat I need to repair but I'm unable to get off this island to get the repair items I need. If you go out and bring me back the supplies I will give you my boat and you can do with it as you please." ] call BIS_fnc_selectrandom; }; ((findDisplay 44412) displayCtrl 1103) ctrlSetText _text; };
and in init.sqf i add
Code:DZSQ_Epoch = true;
the box next to the quest givers is a brilliant idea, but make sure you use createVehicleLocal and execute it on every machine, that way no one can steal the others rewards.I am thinking about turning the rewards portion into a function that is called and having loot arrays setup so that I can just call the function with what I want so its more easily changed and randomized. Also maybe adding a box next to the quest givers to put the gear rewards into and a heli pad near vehicle reward ones to narrow down the searching players currently have to do for vehicle rewards.
With the function idea I was thinking of WAI and DZMS with how they fill the box.
!="DZSQ_RepairQ" !="DZSQ_MedsQ" !="DayZ_SafeObjects"
/*
DayZ Simple Quests (DZSQ)
Created by Inkko
Revision V1.0
Reward tiers for quests. Vehicles and Weapons with 3 tiers in each.
Format for weapons:
DZSQ_Weapon1 = [["M1014_DZ","8Rnd_12Gauge_Slug"],["Remington870_DZ","8Rnd_12Gauge_Slug"],["Gun","Mag"]];
Format for Vehicles:
DZSQ_Vehicle1 = ["UH1H_DZ","UH1H_DZ2","Vehicle"];
*/
private ["_medicalsupplies","_repairsupplies"];
DZSQ_Epoch = false;
// Attempts to create the vehicle and add it to the database using tent write. DZSQ_PermVehicle = true/false;
DZSQ_PermVehicle = true; // only compatible with dayz 1.8.5+ and epoch
// Create box to put rewards in rather then try and add to the player. (add box near quest giver in server side file to look for to add items?)
DZSQ_RewardBox = false; // WIP doesn't function yet.
/*-----------------------------------------------------
Configuration for Bandit, Hero, Zed, and Race quest
- Required timer/amount
- Reward ["type",level]
*/
// Zed kills
DZSQ_Zed1 = 20; // 1st level
DZSQ_Zed2 = 50; // 2nd level
DZSQ_Zed3 = 100; //...
DZSQ_Zed4 = 150;
// Zed rewards ["Reward Type",level of reward];
DZSQ_ZedRew1 = ["Weapon",1]; // level 1
DZSQ_ZedRew2 = ["Weapon",2]; // level 2...
DZSQ_ZedRew3 = ["Vehicle",1];
DZSQ_ZedRew4 = ["Vehicle",2];
// Bandit Level (Murders)
DZSQ_Bandit1 = 20;
DZSQ_Bandit2 = 50;
DZSQ_Bandit3 = 100;
DZSQ_Bandit4 = 150;
// Bandit Rewards
DZSQ_BanditRew1 = ["Weapon",1];
DZSQ_BanditRew2 = ["Weapon",2];
DZSQ_BanditRew3 = ["Vehicle",1];
DZSQ_BanditRew4 = ["Vehicle",2];
// Hero Levels (Bandit Kills)
DZSQ_Hero1 = 20;
DZSQ_Hero2 = 50;
DZSQ_Hero3 = 100;
DZSQ_Hero4 = 150;
// Hero Rewards
DZSQ_HeroRew1 = ["Weapon",1];
DZSQ_HeroRew2 = ["Weapon",2];
DZSQ_HeroRew3 = ["Vehicle",1];
DZSQ_HeroRew4 = ["Vehicle",2];
// Race times
DZSQ_RaceTime1 = 120;
DZSQ_RaceTime2 = 210;
DZSQ_RaceTime3 = 300;
DZSQ_RaceTime4 = 390;
//DZSQ_RaceTime5 = 390; (390 seconds plus)
// Race Rewards
DZSQ_RaceRew1 = ["Vehicle",2];
DZSQ_RaceRew2 = ["Vehicle",1];
DZSQ_RaceRew3 = ["Vehicle",0];
DZSQ_RaceRew4 = ["Weapon",1];
DZSQ_RaceRew5 = ["Weapon",0];
// required humanity for bandit quest
DZSQ_RequiredBandit = -2500;
// required humanity for hero quest.
DZSQ_RequiredHero = 5000;
// Race minimum time (in seconds)
DZSQ_RaceMin = 30; // long distance so shouldn't be able to do it extremely quickly
//-----------------------------------------------------
if (DZSQ_Epoch) then {
/*
Epoch mod (Changes vehicle DB write to epoch one only if DZSQ_PermVehicle = true;)
*/
//low tier
DZSQ_Weapon1 = [["",""],["",""],["",""],["",""],["",""]];
//mid tier
DZSQ_Weapon2 = [["",""],["",""],["",""],["",""],["",""]];
//high tier
DZSQ_Weapon3 = [["",""],["",""],["",""],["",""],["",""]];
//low tier
DZSQ_Vehicle1 = ["","","",""];
//mid tier
DZSQ_Vehicle2 = ["","","",""];
//high tier
DZSQ_Vehicle3 = ["","","",""];
//low tier
DZSQ_Buildables1 = ["","","",""];
//mid tier
DZSQ_Buildables2 = ["","","",""];
// high tier
DZSQ_Buildables3 = ["","","",""];
} else {
/*
Non Epoch mods
*/
//low tier
DZSQ_Weapon1 = [["M1014_DZ","8Rnd_12Gauge_Slug"],["Remington870_DZ","8Rnd_12Gauge_Slug"],["Bizon_DZ","64Rnd_9x19_Bizon"],["Bizon_SD_DZ","64Rnd_9x19_SD_Bizon"],["MP5_DZ","30Rnd_9x19_MP5"],["MP5_SD_DZ","30Rnd_9x19_MP5SD"],["AKS74U_Kobra_DZ","30Rnd_545x39_AK"],["AKS74U_Kobra_SD_DZ","30Rnd_545x39_AKSD"]];
//mid tier
DZSQ_Weapon2 = [["AK74_DZ","30Rnd_545x39_AK"],["G36C_DZ","30Rnd_556x45_G36"],["L85_Holo_DZ","30Rnd_556x45_Stanag"],["M16A2_DZ","30Rnd_556x45_Stanag"],["M16A4_DZ","30Rnd_556x45_Stanag"]];
//high tier
DZSQ_Weapon3 = [["M16A4_GL_FL_DZ","30Rnd_556x45_Stanag"],["M16A4_GL_CCO_FL_DZ","30Rnd_556x45_Stanag"],["G36C_Holo_SD_DZ","30Rnd_556x45_G36SD"],["AK74_PSO1_SD_DZ","30Rnd_545x39_AKSD"],["AK74_GL_PSO1_SD_DZ","30Rnd_545x39_AKSD"],["M249_Holo_DZ","200Rnd_556x45_M249"],["M24_Gh_DZ","5Rnd_762x51_M24"],["DMR_Gh_DZ","20Rnd_762x51_DMR"],["DMR_DZ","20Rnd_762x51_DMR"]];
//low tier
DZSQ_Vehicle1 = ["Old_bike_TK_INS_EP1","TT650_Civ","ATV_US_EP1","ATV_US_EP1"];
//mid tier
DZSQ_Vehicle2 = ["BAF_Offroad_D","HMMWV_DZ","SUV_DZ","Pickup_PK_INS","Offroad_DSHKM_INS"];
//high tier
DZSQ_Vehicle3 = ["MH6J_DZ","UH1H","Mi17_DZ","UH1H_DZ2"];
/*
Magazine tier for building reward quests.
Need to update QuestRewardSystem to have magazine statement.
*/
//
DZSQ_Buildables1 = ["itemlog","ItemPadlock","itemstone"]; // ONLY Magazines
DZSQ_Buildables2 = ["ItemStone","ItemPlank","itemlog","PartWoodPile","ItemPadlock"]; // ONLY Magazines
DZSQ_Buildables3 = ["itemDIY_Gate","itemDIY_wood","itemDIY_Metal","itemPickaxe","itemsledgehammer"]; // ONLY put tool belt items here.
};
// Semi-randomize medical quest on startup (first player randomizes variable for everyone.)
if (isnil "DZSQ_MedsQ") then {
_medicalsupplies = ["ItemEpinephrine","ItemMorphine","ItemAntibiotic"] call bis_fnc_selectrandom;
DZSQ_MedsQ = _medicalsupplies;
publicVariable "DZSQ_MedsQ";
};
// Semi-randomize boat quest on startup (first player randomizes variable for everyone.)
if (isnil "DZSQ_RepairQ") then {
_repairsupplies = ["PartFueltank","PartEngine","PartGeneric"] call bis_fnc_selectrandom;
DZSQ_RepairQ = _repairsupplies;
publicVariable "DZSQ_RepairQ";
};
/*
// Semi-randomize boat quest on startup (first player randomizes variable for everyone.)
if (isnil "DZSQ_RaceQ") then {
_races = [["City Name",[cords]],["City Name",[cords]]] call bis_fnc_selectrandom;
DZSQ_RaceQ = _races;
publicVariable "DZSQ_RaceQ";
};
*/
// Need to add these 2 variables to publicvariable.txt so they don't kick players as well as any other custom publicVariables used in this script.
Here is another update on the progress of this.
Should be pretty much completely done, kind of threw together an epoch config tho... Limitations in rewards are as follows:
I just downloaded it, so let me take a look and see if I can understand the code. I was a developer for years, but only about 6 months into dayz and with no documentation, its been a bit slower to learn.
1.8.7 is removing achievements which I think is the wrong way to go. I'd like to see some type of mission/quest/reward system to encourage more survival.