Stuff and Junk
Well-Known Member
your welcome 8) always glad to help
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.
that sounds very odd. Start form your default PBO and add each one in. Do this one mod at a time until you replicate the double objects issue. Then that will at least reveal what is causing the issue. When you find this out then we can fix the issue.DayZCC_V5.9.4.1 Dayz 1.8.0.3 beta patch 103718
Scripts: selfbloodbag,carradio,bridge,spawn uid, newspawn, safe zone uid
now i have add this addin script with dogs and anomalies and my server
works but have some problems
After restart and relog-
>Inevtart items x2 vehicles x2 cars spawns in cars
>heli, buildings-2 door insisde door
Just a quick questionYa it never is :/ btw here are those dog files you wanted.
//filter useless publicBroadcast
if (_action == player getVariable "dogAction") exitWith {_nul = [objNull, player, rSAY, "whistleNon"] call RE;};
if (_action == "follow") then
{
player setVariable ["dogAction",_action,true];
_nul = [objNull, player, rSAY, "whistleFollow"] call RE;
};
if (_action == "stay") then
{
player setVariable ["dogAction",_action,true];
_nul = [objNull, player, rSAY, "whistleStay"] call RE;
};
if (_action == "find") then
{
player setVariable ["dogAction",_action,true];
_nul = [objNull, player, rSAY, "whistleFind"] call RE;
};[/CODE]
in your init.sqf add this:
Code:[] execVM "addin\dog.sqf";
right after if (!isDedicated) then {
and this:
Code:_null = [] execVM "addin\plrInit.sqf";
after _playerMonitor = blah blah blah
then enjoy your permanent dogs
we only used the German Shepard model btw.
[] execVM "addin\dogInit.sqf";
//private ["_dogHouse","_mapCenter"];
if (!hasInterface) then {
_mapCenter = getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition");
_dogHouses = nearestObjects [_mapCenter, ["Land_psi_bouda"], 10000];
_dogHouseNumber = 0;
_num = count _dogHouses;
for "_i" from 0 to _num - 1 do {
_dogHouse = _dogHouses select _dogHouseNumber;
_dogHousePos = getPos _dogHouse;
_rndMarker = format ["_rndMarker_%1", _i];
_dummyMarker = createMarker [_rndMarker, _dogHousePos];
_dummyMarker setMarkerAlpha 0;
_dummyMarker setMarkerColor "ColorRed";
_dummyMarker setMarkerShape "ELLIPSE";
_dummyMarker setMarkerBrush "Grid";
_dummyMarker setMarkerSize [3,3];
_rndTrigger = format ["_randTrigger_%1", _i];
_rndTrigger = createTrigger["EmptyDetector", getMarkerPos _rndMarker];
_rndTrigger setTriggerArea[2,2,0,false];
_rndTrigger setTriggerActivation["West","Present",true];
_rndTrigger setTriggerStatements["isPlayer (thisList select 0)","nul = [(thisList select 0)] execVM 'addin\dog.sqf'",""];
_dogHouseNumber = _dogHouseNumber + 1;
sleep 0.1;
};
};
//===================piXel 12-02-2013============
if (!hasInterface) exitWith {
//waitUntil {initialized};
private ["_dogHumnty","_leader","_dog","_breed","_grp","_dogname","_clientID","_humans","_distance","_foo","_commd","_animals","_targetAnimal","_stopWait","_veh"];
_leader = _this select 0;
_clientID = owner _leader;
if (count dogOwner >= 10) exitWith {[nil, _leader, "loc", rTITLETEXT, "Sorry, all available dogs found a companion", "PLAIN DOWN"] call RE;};
if ({_X == _leader} count dogOwner == 1) exitWith {[nil, _leader, "loc", rTITLETEXT, "This dog is not interested", "PLAIN DOWN"] call RE;};
_dogHumnty = _leader getVariable ["humanity",0];
if (_dogHumnty >= 0) then {
_breed = "Pastor";
} else {
_breed = "Fin";
};
_grp = creategroup (side _leader);
_dogname = "K9";
call compile format ['"%2" createUnit [getposATL _leader, _grp,"%1=this; this setSpeedMode ""full""; this disableAI ""autotarget""; this setbehaviour ""aware"";",1]',_dogname,_breed];
_dog = call compile format ["%1",_dogname];
_dog setIdentity "dogs";
_nul = [objNull, _dog, rSAY, "bark"] call RE;
dogOwner = dogOwner + [_leader];
sleep 1;
_clientID publicVariableClient "dogOwner";
while {(alive _dog) && (alive _leader)} do
{
waitUntil {(alive _dog) && (alive _leader)};
_humans = [];
_distance = 1000;
_humans = nearestObjects [_leader , ["CAManBase"], 40] - [_leader,_dog];
_foo = _humans select 0;
_commd = _leader getVariable "dogAction";
//debug menu
//_txt = parseText format["debugDog: %1 %2",_leader,_commd];
//[nil, _leader, "loc", rHINT, _txt, "PLAIN DOWN"] call RE;
if (_commd == "stay") then
{
_dog switchmove "Dog_Sit1";
_dog disableAI "move";
sleep 4;
};
if (_commd == "find") then
{
_dog enableAI "move";
_dog switchmove "";
_animals = nearestObjects [_dog, ["Hen","Cock","Cow04","Cow03","Cow02","Cow01","Goat","Sheep","WildBoar"],3000];
if (count _animals != 0) then
{
_targetAnimal = _animals select 0;
_stopWait = (time + 60);
_dog domove (position _targetAnimal);
_dog setspeedmode "FULL";
waituntil {_dog domove (position _targetAnimal); sleep 2; (_dog distance _targetAnimal < 20) || (time > _stopWait) || (_leader getVariable "dogAction" != "find")};
_dog switchmove "Dog_Walk";
_nul = [objNull, _dog, rSAY, "bark"] call RE;
};
_dog switchmove "Dog_Walk";
sleep 4;
};
if (_commd == "follow") then
{
_dog enableAI "move";
_dog switchmove "";
//foo
if ((count _humans > 0) && (alive _foo)) then
{
_distance = _leader distance _foo;
// warning
/*
If ((_distance > 10) && (_distance < 30)) then
{
//_nul = [objNull, _dog, rSAY, "bark"] call RE;
_dog domove (position _foo);
_dog setspeedmode "FULL";
//_nul = [objNull, _dog, rSAY, "bark"] call RE;
};
*/
//initiate attack
If ((_distance < 11) && (side _foo != side _leader)) then
{
_nul = [objNull, _dog, rSAY, "growl"] call RE;
_dog domove (position _foo);
_dog setspeedmode "FULL";
};
//attack
If ((_distance < 10) && (side _foo != side _leader)) then
{
_dog domove (position _foo);
_dog setspeedmode "FULL";
_stopWait = (time + 4);
waitUntil {sleep 0.5; (_dog distance _foo) < 5 || time > _stopWait};
_dog domove (position _foo);
_dog setspeedmode "FULL";
if ((alive _dog) && (_foo isKindOf "zZombie_Base")) then
{
_dog attachTo [_foo,[0,0.8,0],"hrudnik"];
_dog setDir 180;
_foo setdamage 0.3;
sleep 1;
};
if ((alive _dog) && (_foo isKindOf "zZombie_Base")) then
{
_foo setdamage 0.3;
sleep 1;
};
if ((alive _dog) && (_foo isKindOf "zZombie_Base")) then
{
_dog setDir 160;
_foo setdamage 0.6;
sleep 1;
};
if ((alive _dog) && (_foo isKindOf "zZombie_Base")) then
{
_dog setDir 180;
_foo setdamage 0.8;
sleep 1;
};
if ((alive _dog) && (_foo isKindOf "zZombie_Base")) then
{
_dog setDir 200;
_foo setdamage 1;
};
detach _dog;
_dog domove (position _leader);
_dog setspeedmode "FULL";
};
};
//getin
if ((vehicle _leader != _leader) && ((vehicle _leader isKindOf "car") || (vehicle _leader isKindOf "air"))) then
{
_veh = vehicle _leader;
_dog domove position _veh;
_dog setspeedmode "FULL";
_stopWait = (time + 10);
waituntil {_dog domove position _veh; sleep 1; (_dog distance _veh < 5) || time > _stopWait};
_dog attachto [_veh,[0,-0.5,-1],"podlaha"];
//getout
waitUntil{sleep 2;((vehicle _leader == _leader) || (!alive _dog) || (!alive _leader))};
sleep 1;
detach _dog;
_dog setPos (getposATL _leader);
_veh = objNull;
};
//tofar
if ((_leader distance _dog) > 1200) then
{
_dog setDamage 1;
};
//toClose
if ((_leader distance _dog) < 5) then
{
_dog switchmove "Dog_Siting";
}
else
{
_dog switchmove ""; //Dog_Sprint
_dog domove position _leader;
_dog setspeedmode "full";
};
_foo = objNull;
sleep 3;
};
};
_dog setDamage 1;
sleep 15;
hideBody _dog;
sleep 5;
deleteVehicle _dog;
_grp = grpNull;
_stopWait = (time + 120);
waitUntil {time >= _stopWait};
dogOwner = dogOwner - [_leader];
sleep 1;
_clientID publicVariableClient "dogOwner";
};
So just to recap, with your edits to this script dogs will spawn at any doghouse on the map. And then stay with you after loging???Actually it has been so long since i used this version i couldnt tell you lol. I now run them a bit differently:
I run this script on a headless client now too, seems to still be very sluggish and "stupid" behavior, scripts just need some tweaking:
In the init.sqf add this and make sure it is executed GLOBALLY, i.e. not isServer or !isDedicated,
Code:[] execVM "addin\dogInit.sqf";
Now this is the dogInit.sqf:
This searches for all existing dog houses on the map and creates the trigger.Code://private ["_dogHouse","_mapCenter"]; if (!hasInterface) then { _mapCenter = getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition"); _dogHouses = nearestObjects [_mapCenter, ["Land_psi_bouda"], 10000]; _dogHouseNumber = 0; _num = count _dogHouses; for "_i" from 0 to _num - 1 do { _dogHouse = _dogHouses select _dogHouseNumber; _dogHousePos = getPos _dogHouse; _rndMarker = format ["_rndMarker_%1", _i]; _dummyMarker = createMarker [_rndMarker, _dogHousePos]; _dummyMarker setMarkerAlpha 0; _dummyMarker setMarkerColor "ColorRed"; _dummyMarker setMarkerShape "ELLIPSE"; _dummyMarker setMarkerBrush "Grid"; _dummyMarker setMarkerSize [3,3]; _rndTrigger = format ["_randTrigger_%1", _i]; _rndTrigger = createTrigger["EmptyDetector", getMarkerPos _rndMarker]; _rndTrigger setTriggerArea[2,2,0,false]; _rndTrigger setTriggerActivation["West","Present",true]; _rndTrigger setTriggerStatements["isPlayer (thisList select 0)","nul = [(thisList select 0)] execVM 'addin\dog.sqf'",""]; _dogHouseNumber = _dogHouseNumber + 1; sleep 0.1; }; };
This is my custom version that uses humanity to determine which player gets which type of dog. Bandits get a mastiff and all other players get a Shepard,
replace if (!hasInterface) exitWith {
with if (isServer) exitWith {
same with any !hasInterface. There is one in the doginit.sqf also
Code://===================piXel 12-02-2013============ if (!hasInterface) exitWith { //waitUntil {initialized}; private ["_dogHumnty","_leader","_dog","_breed","_grp","_dogname","_clientID","_humans","_distance","_foo","_commd","_animals","_targetAnimal","_stopWait","_veh"]; _leader = _this select 0; _clientID = owner _leader; if (count dogOwner >= 10) exitWith {[nil, _leader, "loc", rTITLETEXT, "Sorry, all available dogs found a companion", "PLAIN DOWN"] call RE;}; if ({_X == _leader} count dogOwner == 1) exitWith {[nil, _leader, "loc", rTITLETEXT, "This dog is not interested", "PLAIN DOWN"] call RE;}; _dogHumnty = _leader getVariable ["humanity",0]; if (_dogHumnty >= 0) then { _breed = "Pastor"; } else { _breed = "Fin"; }; _grp = creategroup (side _leader); _dogname = "K9"; call compile format ['"%2" createUnit [getposATL _leader, _grp,"%1=this; this setSpeedMode ""full""; this disableAI ""autotarget""; this setbehaviour ""aware"";",1]',_dogname,_breed]; _dog = call compile format ["%1",_dogname]; _dog setIdentity "dogs"; _nul = [objNull, _dog, rSAY, "bark"] call RE; dogOwner = dogOwner + [_leader]; sleep 1; _clientID publicVariableClient "dogOwner"; while {(alive _dog) && (alive _leader)} do { waitUntil {(alive _dog) && (alive _leader)}; _humans = []; _distance = 1000; _humans = nearestObjects [_leader , ["CAManBase"], 40] - [_leader,_dog]; _foo = _humans select 0; _commd = _leader getVariable "dogAction"; //debug menu //_txt = parseText format["debugDog: %1 %2",_leader,_commd]; //[nil, _leader, "loc", rHINT, _txt, "PLAIN DOWN"] call RE; if (_commd == "stay") then { _dog switchmove "Dog_Sit1"; _dog disableAI "move"; sleep 4; }; if (_commd == "find") then { _dog enableAI "move"; _dog switchmove ""; _animals = nearestObjects [_dog, ["Hen","Cock","Cow04","Cow03","Cow02","Cow01","Goat","Sheep","WildBoar"],3000]; if (count _animals != 0) then { _targetAnimal = _animals select 0; _stopWait = (time + 60); _dog domove (position _targetAnimal); _dog setspeedmode "FULL"; waituntil {_dog domove (position _targetAnimal); sleep 2; (_dog distance _targetAnimal < 20) || (time > _stopWait) || (_leader getVariable "dogAction" != "find")}; _dog switchmove "Dog_Walk"; _nul = [objNull, _dog, rSAY, "bark"] call RE; }; _dog switchmove "Dog_Walk"; sleep 4; }; if (_commd == "follow") then { _dog enableAI "move"; _dog switchmove ""; //foo if ((count _humans > 0) && (alive _foo)) then { _distance = _leader distance _foo; // warning /* If ((_distance > 10) && (_distance < 30)) then { //_nul = [objNull, _dog, rSAY, "bark"] call RE; _dog domove (position _foo); _dog setspeedmode "FULL"; //_nul = [objNull, _dog, rSAY, "bark"] call RE; }; */ //initiate attack If ((_distance < 11) && (side _foo != side _leader)) then { _nul = [objNull, _dog, rSAY, "growl"] call RE; _dog domove (position _foo); _dog setspeedmode "FULL"; }; //attack If ((_distance < 10) && (side _foo != side _leader)) then { _dog domove (position _foo); _dog setspeedmode "FULL"; _stopWait = (time + 4); waitUntil {sleep 0.5; (_dog distance _foo) < 5 || time > _stopWait}; _dog domove (position _foo); _dog setspeedmode "FULL"; if ((alive _dog) && (_foo isKindOf "zZombie_Base")) then { _dog attachTo [_foo,[0,0.8,0],"hrudnik"]; _dog setDir 180; _foo setdamage 0.3; sleep 1; }; if ((alive _dog) && (_foo isKindOf "zZombie_Base")) then { _foo setdamage 0.3; sleep 1; }; if ((alive _dog) && (_foo isKindOf "zZombie_Base")) then { _dog setDir 160; _foo setdamage 0.6; sleep 1; }; if ((alive _dog) && (_foo isKindOf "zZombie_Base")) then { _dog setDir 180; _foo setdamage 0.8; sleep 1; }; if ((alive _dog) && (_foo isKindOf "zZombie_Base")) then { _dog setDir 200; _foo setdamage 1; }; detach _dog; _dog domove (position _leader); _dog setspeedmode "FULL"; }; }; //getin if ((vehicle _leader != _leader) && ((vehicle _leader isKindOf "car") || (vehicle _leader isKindOf "air"))) then { _veh = vehicle _leader; _dog domove position _veh; _dog setspeedmode "FULL"; _stopWait = (time + 10); waituntil {_dog domove position _veh; sleep 1; (_dog distance _veh < 5) || time > _stopWait}; _dog attachto [_veh,[0,-0.5,-1],"podlaha"]; //getout waitUntil{sleep 2;((vehicle _leader == _leader) || (!alive _dog) || (!alive _leader))}; sleep 1; detach _dog; _dog setPos (getposATL _leader); _veh = objNull; }; //tofar if ((_leader distance _dog) > 1200) then { _dog setDamage 1; }; //toClose if ((_leader distance _dog) < 5) then { _dog switchmove "Dog_Siting"; } else { _dog switchmove ""; //Dog_Sprint _dog domove position _leader; _dog setspeedmode "full"; }; _foo = objNull; sleep 3; }; }; _dog setDamage 1; sleep 15; hideBody _dog; sleep 5; deleteVehicle _dog; _grp = grpNull; _stopWait = (time + 120); waitUntil {time >= _stopWait}; dogOwner = dogOwner - [_leader]; sleep 1; _clientID publicVariableClient "dogOwner"; };
_delQtyAnimal = 0;
{
if (local _x ) then {
_x call sched_co_deleteVehicle;
_delQtyAnimal = _delQtyAnimal + 1;
};
} forEach entities "CAAnimalBase";
_delQtyAnimal = 0;
{
if (local _x && !((typeOf _x) in ["Pastor","Fin"])) then {
_x call sched_co_deleteVehicle;
_delQtyAnimal = _delQtyAnimal + 1;
};
} forEach entities "CAAnimalBase";
these dogs do not persist through logging out and restarts. I have been implementing a secondary database to save variables to allow for this to happen though. They are disappearing due to your server cleanup script. Open your sched_corpses.sqf in the server pbo in the scheduler folder and look for this:
Then replace it with this:Code:_delQtyAnimal = 0; { if (local _x ) then { _x call sched_co_deleteVehicle; _delQtyAnimal = _delQtyAnimal + 1; }; } forEach entities "CAAnimalBase";
Code:_delQtyAnimal = 0; { if (local _x && !((typeOf _x) in ["Pastor","Fin"])) then { _x call sched_co_deleteVehicle; _delQtyAnimal = _delQtyAnimal + 1; }; } forEach entities "CAAnimalBase";
Got a version of PiXels cool dogs working client side. But, have not yet been able to get rid of the serious error where when the player model changes due to humanity morph or changing clothes.
I have removed object references between player and dog even, and making sure I deleteVehicle the dog first before the player object gets deleted and the player gets a new player object. I believe I have even just hide the body and not delete the dog and it still happens. Its something I think with a reference from the dog to player, or maybe vice versa that I am not seeing, and since I have a work-around for now (my code catches when model changes and has player logout and login again and whistle for dog), as well as spending hours on other aspects of my mod, I dont feel motivated to dig deeper atm.
Has anyone fixed this?
Vehicle not found error, player cant get back into the server. all scripts client side stop working. some people have reported that the server may need to be restarted as well., since the original dog code ran server side.
yeah, Im using DayZ 1.7.6.1 codebase. I basically catch when there is a switch of model, like with humanity morph or with changing clothes, and get rid of the dog and let the player know that they will need to log out and back in to get the dog back. When changing clothes, I tell them to changes the clothes first.
Its long winded but good enough. Its based on requiring an inventory item by the player, that is given to them when the dog is tamed, then taken away when the dog actually dies. I implemented this workaround when I didnt have as much experience working with arma modding. Was reading about deleteVehicle on the BIS community wiki, and that said that scripts referencing a handle to an object that has deleted can cause serious problems, which somehow is happening here I believe with the player object being deleted. Ah, when/if I get the time and motivation in the future will take another look at it.
Ideally I think dogs should be implemented as deployables, in the DB, but do deployables get removed when they have damage =1? havent tested
when I get some time, I can post my workaround, if there is any interest. I think it would worth waiting to find out if any fixed it properly first.
_anonstat = profileNamespace getVariable "Anon";
if (isnil "_anonstat") then {
player setVariable ["Anon",false,true];
profileNamespace setVariable ["Anon",false];
saveProfileNamespace;
} else {
if (_anonstat) then {
player setVariable ["Anon",true,true];
} else {
player setVariable ["Anon",false,true];
};
};
["Toggle Anonymous", [8], "", -5, [["expression","_anonstat = profileNamespace getVariable 'Anon';if (isnil '_anonstat') then {player setVariable ['Anon',false,true];};if (player getvariable 'Anon') then { profileNamespace setVariable ['Anon',false];player setVariable ['Anon',false,true]; systemchat 'Your name will show up in kill messages now...';} else { profileNamespace setVariable ['Anon',true]; player setVariable ['Anon',true,true]; systemchat 'You will now be anonymous in kill messages.';};saveProfileNamespace;"]], "1", "1"],
thanks. going over the dog code again. I am only setting some simple variables on the player and on the dog like characterid. odd.
Do profilenamespace variables get obsfucated so that players cannot tinker with the values in their profile?