Da ich leider mit der SUFU nichts gefunden habe komme ich hier zur nächsten Frage.
Standart wird ja fast alles mit der Spitzhacke abgebaut, das schien mir aber ein wenig zu fade, daher habe ich einige Farming Items mit anderen Gegenständen versehen wie zb. Schaufel für Sand und Salz sowie ein Sieb zum Gold Sieben.
Nun wollte ich natürlich auch die dazu passenden Sounds denn die Spitzhacke is a bissl doof wenn man Sand schaufelt.
Ich habe mir also für Schaufel einen Sound und fürs Sieb einen Sound erstellt und diese in die Sounds gegeben, natürlich auch in die description.ext eingetragen unter class CfgSounds
Ich höre aber immer noch überall die Spitzhacke klopfen!?
disableChannels[] = {{0,true,true},{1,true,true},{2,true,true}}; // Disabled text and voice for global, side, and command channels. Syntax: disableChannels[] = {{channelID<number>, disableChat<bool>, disableVoice<bool>}};
overviewText = "$STR_MISC_overviewText"; // Text to be displayed below the overviewPicture on the mission selection screen when the mission is available to play.
#include "config\Config_SpyGlass.hpp"
#include "CfgRemoteExec.hpp"
#include "dialog\MasterHandler.hpp"
#include "config\Config_Master.hpp"
class CfgServer {
DatabaseName = "altislife"; //Config name that'll be grep in the extdb-conf.ini. Default: [altislife]
DebugMode = 0; //Enable many server/hc debugging logs. Default: 0 (1 = Enabled / 0 = Disabled)
HeadlessSupport = 0; //Enable/Disable Headless client support. Default: 1 (1 = Enabled / 0 = Disabled)
/*
Enabled: When HeadlessSupport is set to 1 (enabled), the server will run without fault when no Headless Client is connected. However, it will support the Headless Client if you choose to connect one.
Disabled: If HeadlessSupport is set to 0 (disabled), the connection of a Headless Client will make no difference. This option will increase server performance a TINY but negligible amount.
*/
};
class RscTitles {
#include "dialog\progress.hpp"
#include "dialog\hud_nameTags.hpp"
#include "dialog\hud_stats.hpp"
};
class CfgFunctions {
#include "Functions.hpp"
#include "cation\cation_functions.cpp"
};
class CfgSounds {
sounds[] = {};
class sirenLong {
name = "sirenLong";
sound[] = {"\sounds\sirenLong.ogg", 1.0, 1};
titles[] = {};
};
class wiggle {
name = "wiggle";
sound[] = {"\sounds\wiggle.ogg", 1.0, 1};
titles[] = {};
};
class bip {
name = "bip";
sound[] = {TV\TV logo & beep\Sounds\bip.ogg, 1, 1.0};
titles[] = {};
};
class bip2 {
name = "bip2";
sound[] = {TV\TV logo & beep\Sounds\bip2.ogg, 1, 1.0};
titles[] = {};
};
class speech {
name = "speech";
sound[] = {"\sounds\speech.ogg", 1.0, 1};
titles[] = {};
};
class medicSiren {
name = "medicSiren";
sound[] = {"\sounds\medicSiren.ogg", 1.0, 1};
titles[] = {};
};
class tazerSound {
name = "tazerSound";
sound[] = {"\sounds\tazer.ogg", 0.25, 1};
titles[] = {};
};
class flashbang {
name = "flashbang";
sound[] = {"\sounds\flashbang.ogg", 1.0, 1};
titles[] = {};
};
class mining {
name = "mining";
sound[] = {"\sounds\mining.ogg", 1.0, 1};
titles[] = {};
};
class Shovel { //Sound für Schaufel
name = "Shovel";
sound[] = {"\sounds\Shovel.ogg", 1.0, 1};
titles[] = {};
};
class Goldnuggets { /Sound für Goldschürfen - Sieb
name = "Goldnuggets";
sound[] = {"\sounds\Goldnuggets.ogg", 1.0, 1};
titles[] = {};
};
class harvest {
name = "harvest";
sound[] = {"\sounds\harvest.ogg", 1.0, 1};
titles[] = {};
};
class lockCarSound {
name = "lockCarSound";
sound[] = {"\sounds\carLock.ogg", 0.25, 1};
titles[] = {};
};
class unlockCarSound {
name = "unlockCarSound";
sound[] = {"\sounds\carUnlock.ogg", 0.25, 1};
titles[] = {};
};
};
class CfgDebriefing {
class NotWhitelisted {
title = "$STR_NotWhitelisted_Title";
subtitle = "$STR_NotWhitelisted_SubTitle";
description = "$STR_NotWhitelisted_Descript";
pictureBackground = "";
picture = "";
pictureColor[] = {0,0.3,0.6,1};
};
class Blacklisted {
title = "$STR_Blacklisted_Title";
subtitle = "$STR_Blacklisted_SubTitle";
description = "$STR_Blacklisted_Descript";
pictureBackground = "";
picture = "";
pictureColor[] = {0,0.3,0.6,1};
};
};
class CfgNotifications {
class MedicalRequestEmerg {
title = "$STR_MedicalRequestEmerg_Title";
iconPicture = "\A3\ui_f\data\map\mapcontrol\taskIcon_ca.paa";
description = "%1";
duration = 5;
priority = 7;
};
class DeliveryAssigned {
title = "$STR_DeliveryAssigned_Title";
iconPicture = "\A3\ui_f\data\map\mapcontrol\taskIcon_ca.paa";
description = "%1";
duration = 10;
priority = 7;
};
class DeliveryFailed {
title = "$STR_DeliveryFailed_Title";
iconPicture = "\A3\ui_f\data\map\mapcontrol\taskiconfailed_ca.paa";
description = "%1";
duration = 7;
priority = 7;
};
class DeliverySucceeded {
title = "$STR_DeliverySucceeded_Title";
iconPicture = "\A3\ui_f\data\map\mapcontrol\taskIcondone_ca.paa";
description = "%1";
duration = 6;
priority = 6;
};
class TextMessage {
title = "$STR_TextMessage_Title";
iconPicture = "icons\ico_messageNew.paa";
description = "%1";
duration = 10;
priority = 6;
};
class PoliceDispatch {
title = "$STR_PoliceDispatch_Title";
iconPicture = "icons\ico_messagePolice.paa";
description = "%1";
duration = 10;
priority = 6;
};
class AdminDispatch {
title = "$STR_AdminDispatch_Title";
iconPicture = "icons\ico_messageAdmin.paa";
description = "%1";
duration = 10;
priority = 6;
};
class AdminMessage {
title = "$STR_AdminMessage_Title";
iconPicture = "icons\ico_messageAdmin.paa";
description = "%1";
duration = 10;
priority = 5;
};
};
#include "cation\cation_master.cpp"
Alles anzeigen
In der fn_mine.sqf habe ich benötigten Items eingetragen
#include "..\..\script_macros.hpp"
/*
File: fn_mine.sqf
Author: Devilfloh
Editor: Dardo
Description:
Same as fn_gather,but it allows use of probabilities for mining.
*/
private ["_maxGather", "_resource", "_amount", "_requiredItem", "_mined"];
if (life_action_inUse) exitWith {};
if !(isNull objectParent player) exitWith {};
if (player getVariable "restrained") exitWith {
hint localize "STR_NOTF_isrestrained";
};
_exit = false;
if (player getVariable "playerSurrender") exitWith {
hint localize "STR_NOTF_surrender";
};
life_action_inUse = true;
_zone = "";
_requiredItem = "";
_resourceCfg = missionConfigFile >> "CfgGather" >> "Minerals";
_percent = (floor random 100) + 1; //Make sure it's not 0
for "_i" from 0 to count(_resourceCfg)-1 do {
_curConfig = _resourceCfg select _i;
_resources = getArray(_curConfig >> "mined");
_maxGather = getNumber(_curConfig >> "amount");
_zoneSize = getNumber(_curConfig >> "zoneSize");
_resourceZones = getArray(_curConfig >> "zones");
_requiredItem = getText(_curConfig >> "item");
_mined = "";
if (_resources isEqualTo []) exitWith {}; //Smart guy :O
for "_i" from 0 to count (_resources) do {
if (count _resources isEqualTo 1) exitWith {
if (!((_resources select 0) isEqualType [])) then {
_mined = _resources select 0;
} else {
_mined = (_resources select 0) select 0;
};
};
_resource = (_resources select _i) select 0;
_prob = (_resources select _i) select 1;
_probdiff = (_resources select _i) select 2;
if ((_percent >= _prob) && (_percent <= _probdiff)) exitWith {
_mined = _resource;
};
};
{
if ((player distance(getMarkerPos _x)) < _zoneSize) exitWith {
_zone = _x;
};
} forEach _resourceZones;
if (_zone != "") exitWith {};
};
if (_zone isEqualTo "") exitWith {
life_action_inUse = false;
};
if (_requiredItem != "") then {
_valItem = missionNamespace getVariable "life_inv_" + _requiredItem;
if (_valItem < 1) exitWith {
switch (_requiredItem) do {
case "pickaxe": {
titleText[(localize "STR_NOTF_Pickaxe"), "PLAIN"];
};
};
life_action_inUse = false;
_exit = true;
};
};
if (_requiredItem != "") then {
_valItem = missionNamespace getVariable "life_inv_" + _requiredItem;
if (_valItem < 1) exitWith {
switch (_requiredItem) do {
case "schaufel": {
titleText[(localize "STR_NOTF_schaufel"), "PLAIN"];
};
};
life_action_inUse = false;
_exit = true;
};
};
if (_requiredItem != "") then {
_valItem = missionNamespace getVariable "life_inv_" + _requiredItem;
if (_valItem < 1) exitWith {
switch (_requiredItem) do {
case "Sieb": {
titleText[(localize "STR_NOTF_Sieb"), "PLAIN"];
};
};
life_action_inUse = false;
_exit = true;
};
};
if (_exit) exitWith {
life_action_inUse = false;
};
//SCHLEIFE
while {true} do {
//ABFRAGE
if(life_interrupted) exitWith {life_interrupted = false;}; // Damit ist die Zeile hier gemeint
_amount = round(random(_maxGather)) + 1;
_diff = [_mined, _amount, life_carryWeight, life_maxWeight] call life_fnc_calWeightDiff;
if (_diff isEqualTo 0) exitWith {
hint localize "STR_NOTF_InvFull";
life_action_inUse = false;
};
player say3D "mining";
for "_i" from 0 to 4 do {
player playMoveNow "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";
waitUntil {
animationState player != "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";
};
sleep 0.5;
};
if (([true, _mined, _diff] call life_fnc_handleInv)) then {
_itemName = M_CONFIG(getText, "VirtualItems", _mined, "displayName");
titleText[format [localize "STR_NOTF_Mine_Success", (localize _itemName), _diff], "PLAIN"];
};
};
sleep 2.5;
life_action_inUse = false;
Alles anzeigen
In der fn_gather.sqf habe ich die Sounds für die jeweiligen Abbau Gegenstände hinzugefügt
#include "..\..\script_macros.hpp"
/*
File: fn_gather.sqf
Author: Devilfloh
Description:
Main functionality for gathering.
*/
private ["_maxGather","_resource","_amount","_maxGather","_requiredItem"];
if (life_action_inUse) exitWith {};
if !(isNull objectParent player) exitWith {};
if (player getVariable "restrained") exitWith {hint localize "STR_NOTF_isrestrained";};
if (player getVariable "playerSurrender") exitWith {hint localize "STR_NOTF_surrender";};
life_action_inUse = true;
_zone = "";
_requiredItem = "";
_exit = false;
_resourceCfg = missionConfigFile >> "CfgGather" >> "Resources";
for "_i" from 0 to count(_resourceCfg)-1 do {
_curConfig = _resourceCfg select _i;
_resource = configName _curConfig;
_maxGather = getNumber(_curConfig >> "amount");
_zoneSize = getNumber(_curConfig >> "zoneSize");
_resourceZones = getArray(_curConfig >> "zones");
_requiredItem = getText(_curConfig >> "item");
{
if ((player distance (getMarkerPos _x)) < _zoneSize) exitWith {_zone = _x;};
} forEach _resourceZones;
if (_zone != "") exitWith {};
};
if (_zone isEqualTo "") exitWith {life_action_inUse = false;};
if (_requiredItem != "") then {
_valItem = missionNamespace getVariable "life_inv_" + _requiredItem;
if (_valItem < 1) exitWith {
switch (_requiredItem) do {
//Messages here
};
life_action_inUse = false;
_exit = true;
};
};
if (_exit) exitWith {life_action_inUse = false;};
//HIER DIE SCHLEIFE
while{true} do {
//ABFRAGE
if(life_interrupted) exitWith {life_interrupted = false;}; // Diese Zeile ist damit gemeint
_amount = round(random(_maxGather)) + 1;
_diff = [_resource,_amount,life_carryWeight,life_maxWeight] call life_fnc_calWeightDiff;
if (_diff isEqualTo 0) exitWith {
hint localize "STR_NOTF_InvFull";
life_action_inUse = false;
};
switch (_requiredItem) do {
case "pickaxe": {player say3D "mining";};
default {player say3D "harvest";};
};
switch (_requiredItem) do {
case "schaufel": {player say3D "Shovel";};
default {player say3D "harvest";};
};
switch (_requiredItem) do {
case "sieb": {player say3D "Goldnuggets";};
default {player say3D "harvest";};
};
for "_i" from 0 to 4 do {
player playMoveNow "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";
waitUntil{animationState player != "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";};
sleep 0.5;
};
if ([true,_resource,_diff] call life_fnc_handleInv) then {
_itemName = M_CONFIG(getText,"VirtualItems",_resource,"displayName");
titleText[format [localize "STR_NOTF_Gather_Success",(localize _itemName),_diff],"PLAIN"];
};
};
sleep 1;
life_action_inUse = false;
Alles anzeigen
Natürlich wie oben schon erwähnt habe ich die Soundfiles im .ogg Format im sounds Ordner auch drinnen.
Warum geht das nicht?
Die zweite Frage dazu passend wäre nun, wenn ich bei einem Verarbeiter einen Sound wie zb. Fabrik haben möchte (ich erstelle mir eine fabriksound.ogg) wie kann ich diese einfügen sodass sie nur in der Umgebung des Verarbeiters zu hören ist und da auch nur während jemand dort ist (habe an einen Auslöser gedacht wenn der überschritten wird, wird Sound fabriksound.ogg abgespielt.
Wie kann ich das am besten umsetzen?
Dankeschön