Hey dear The-Programmer Forum.
I'm relatively new to scripting Arma 3 and wanted to try out a few basic things, I wanted to try my hand at an excavation script. Now to my problem.
I have focal files
[CODE title="fn_ausgrabung.sqf"]private _ausgrabungsGebiet = getText (MissionConfigFile >> "peragh_ausgrab_config" >> "peragh_ausgrabungsGebiet");
private _requiredItem = getText (MissionConfigFile >> "peragh_ausgrab_config" >> "peragh_requiredItem");
private _searchTime = getNumber (MissionConfigFile >> "peragh_ausgrab_config" >> "peragh_searchTime");
private _anim = getText (MissionConfigFile >> "peragh_ausgrab_config" >> "peragh_ausgrabungAnim");
private _loot = getArray (MissionConfigFile >> "peragh_ausgrab_config" >> "peragh_lootAusgrabung");
fnc_startAusgrabung = {
private ["_item", "_startTime"];
hint "Start ausgrabung";
if (player inArea _ausgrabungsGebiet) then {
hint "Start Ausgrabung2";
if (!(_requiredItem in assignedItems player)) exitWith {
hint format ["Du benötigst %1 um hier ausgraben zu können", _requiredItem];
};
if (_requiredItem in assignedItems player) then {
player playMove _anim;
hint "Animation";
uiSleep _searchTime;
private _randomLoot = selectRandom _loot;
_item = _randomLoot select 0;
if (random 1 <= _randomLoot select 2) then {
if ((_randomLoot select 1) == "weapon") then {
player addItemToBackpack _item;
} else {
player addItem [_loot select 0, 1];
};
};
};
hint format ["Du hast %1 Augegraben", _randomLoot select 0];
} else {
hint "Du befindest dich nicht im Ausgrabungsgebiet";
};
};
[/CODE]
[CODE title="Config_Ausgrabung.hpp"]class peragh_ausgrab_config {
peragh_ausgrabungsGebiet = "test"; //Hier legst du das ausgrabungsGebiet fest
peragh_ausgrabungsSize = 30; //Hier legst die Größe des Ausgrabungsgebietes Fest
peragh_requiredItem = ""; //Item was benötigt wird zum suchen in der Ausgrabuingstätte || Falls nichts Drinne steht braucht man nichts!
peragh_searchTime = 10; //Zeit die zum Suchen benötigt wird
peragh_ausgrabungAnim = ""; //Hier legst du die Animation fest die Ausgeführt wird wenn der user was ausgräbt
peragh_lootAusgrabung[] = {
{"hgun_P07_F", "weapon", 0.5},
{"peach", "vitem", 0.8}
};
};[/CODE]
[CODE title="fn_actionKeyHandler.sqf"]if (player inArea _ausgrabunsgGebiet) then {
[] spawn life_fnc_ausgrabung;
};[/CODE]
[CODE title="functions.hpp"]class peragh_functions {
file = "peragh\functions";
class ausgrabung {};
};[/CODE]
So and because I'm dating it's probably because of the call in actionKeyHandler, I also adjusted the functions.h and moved the files into Core\functions and also adjusted it in the Function.hpp.
Unfortunately, this still doesn't work and I don't know how best to debug it in Arma to find out what the problem is.
I have the problem that the script is not even executed or any hints are displayed
Thank you in advance
I'm relatively new to scripting Arma 3 and wanted to try out a few basic things, I wanted to try my hand at an excavation script. Now to my problem.
I have focal files
[CODE title="fn_ausgrabung.sqf"]private _ausgrabungsGebiet = getText (MissionConfigFile >> "peragh_ausgrab_config" >> "peragh_ausgrabungsGebiet");
private _requiredItem = getText (MissionConfigFile >> "peragh_ausgrab_config" >> "peragh_requiredItem");
private _searchTime = getNumber (MissionConfigFile >> "peragh_ausgrab_config" >> "peragh_searchTime");
private _anim = getText (MissionConfigFile >> "peragh_ausgrab_config" >> "peragh_ausgrabungAnim");
private _loot = getArray (MissionConfigFile >> "peragh_ausgrab_config" >> "peragh_lootAusgrabung");
fnc_startAusgrabung = {
private ["_item", "_startTime"];
hint "Start ausgrabung";
if (player inArea _ausgrabungsGebiet) then {
hint "Start Ausgrabung2";
if (!(_requiredItem in assignedItems player)) exitWith {
hint format ["Du benötigst %1 um hier ausgraben zu können", _requiredItem];
};
if (_requiredItem in assignedItems player) then {
player playMove _anim;
hint "Animation";
uiSleep _searchTime;
private _randomLoot = selectRandom _loot;
_item = _randomLoot select 0;
if (random 1 <= _randomLoot select 2) then {
if ((_randomLoot select 1) == "weapon") then {
player addItemToBackpack _item;
} else {
player addItem [_loot select 0, 1];
};
};
};
hint format ["Du hast %1 Augegraben", _randomLoot select 0];
} else {
hint "Du befindest dich nicht im Ausgrabungsgebiet";
};
};
[/CODE]
[CODE title="Config_Ausgrabung.hpp"]class peragh_ausgrab_config {
peragh_ausgrabungsGebiet = "test"; //Hier legst du das ausgrabungsGebiet fest
peragh_ausgrabungsSize = 30; //Hier legst die Größe des Ausgrabungsgebietes Fest
peragh_requiredItem = ""; //Item was benötigt wird zum suchen in der Ausgrabuingstätte || Falls nichts Drinne steht braucht man nichts!
peragh_searchTime = 10; //Zeit die zum Suchen benötigt wird
peragh_ausgrabungAnim = ""; //Hier legst du die Animation fest die Ausgeführt wird wenn der user was ausgräbt
peragh_lootAusgrabung[] = {
{"hgun_P07_F", "weapon", 0.5},
{"peach", "vitem", 0.8}
};
};[/CODE]
[CODE title="fn_actionKeyHandler.sqf"]if (player inArea _ausgrabunsgGebiet) then {
[] spawn life_fnc_ausgrabung;
};[/CODE]
[CODE title="functions.hpp"]class peragh_functions {
file = "peragh\functions";
class ausgrabung {};
};[/CODE]
So and because I'm dating it's probably because of the call in actionKeyHandler, I also adjusted the functions.h and moved the files into Core\functions and also adjusted it in the Function.hpp.
Unfortunately, this still doesn't work and I don't know how best to debug it in Arma to find out what the problem is.
I have the problem that the script is not even executed or any hints are displayed
Thank you in advance
- Vos logs serveur | Your server logs
- https://paste-me.net/usiqi
- Vos logs client | Your client logs
- https://paste-me.net/komey