Ammo Press Help

Did you add the sound class to description.ext? It won't work unless you do that.

Code:
class engine_12s
{
name="engine_12s";
sound[]={sound\engine_12s.ogg,0.9,1};
titles[] = {};
};

it will look like that. put that under your class CfgSounds in description.ext
 
Did you add the sound class to description.ext? It won't work unless you do that.
Yep, i add, all my sounds:
Code:
class CfgSounds
{
    sounds[] =
    {
    engine_12s,nam,bark,growl,whistleFollow,whistleStay,whistleFind,whistleNon,playerSnoring
    };
    class engine_12s
    {
    name="engine_12s";
    sound[]={sound\engine_12s.ogg,0.9,1};
    titles[] = {};
    };
    class nam
    {
    name = "Siren1";
    sound[] = {\sound\SirenLoopMono.ogg, db-6, 1.0};
    titles[] = {""};
    };
    class bark
    {
    name="bark";
    sound[]={\addin\fx\bark.ogg,0.4,1};
    titles[] = {};
    };
    class growl
    {
    name="growl";
    sound[]={\addin\fx\growl.ogg,0.5,1};
    titles[] = {};
    };
    class whistleFollow
    {
    name="whistleFollow";
    sound[]={\addin\fx\whistleFollow.ogg,0.8,1};
    titles[] = {};
    };
    class whistleStay
    {
    name="whistleStay";
    sound[]={\addin\fx\whistleStay.ogg,0.8,1};
    titles[] = {};
    };
    class WhistleFind
    {
    name="WhistleFind";
    sound[]={\addin\fx\whistleFind.ogg,0.8,1};
    titles[] = {};
    };
    class whistleNon
    {
    name="whistleNon";
    sound[]={\addin\fx\whistleNon.ogg,0.9,1};
    titles[] = {};
    };
    class playerSnoring
    {
    name="playerSnoring";
    sound[]={\custom\sfx\snoring.ogg,0.9,1};
    titles[] = {};
    };
};
 
Try naming it something else, maybe. Something without an underscore. Just call it engine. Then go into one of the sqf files and change engine_12s to engine, to try it. If it works then just change it in the other sqfs.
 
Ok, I tried to use sound "Engine_12s" in the 2D editor in single player mode and it work great.
On my dayz server, when I tryed to make an ammo clip the sound play correctly and a message showing me: "Sound z_engine_12s_0 not found.

I investigated arma2OAserveur.rpt but nothing in there...
Also, I investigated my arma2OA.rpt and i've found this two lines:
Code:
Warning Message: Sound z_engine_12s_0 not found
Warning Message: Sound z_engine_12s_0 not found

I think there is a problem with this line in your code:
Code:
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;

But what's the problem? :rolleyes:
 
Try naming it something else, maybe. Something without an underscore. Just call it engine. Then go into one of the sqf files and change engine_12s to engine, to try it. If it works then just change it in the other sqfs.
nope, now "Sound z_ engine12s_0 not found"
 
nope, now "Sound z_ engine12s_0 not found"
Make sure your sqfs look like this:
Code:
 private ["_chance", "_sounddist", "_press", "_sfx", "_dis"];
 
_dis=100;
_sfx = "engine";
_chance = floor(random 100);
_press = nearestObject [player, "Land_Ind_Stack_Big"];
_sounddist = 15;
 
player playActionNow "Medic";
sleep 1;
titleText ["You have activated the ammo press.","PLAIN DOWN"]; titleFadeOut 5;
sleep 2;
 
 
if (_chance > 10) then
    {
 
        [nil,_press,rSAY,["engine", _sounddist]] call RE; 
        [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
        [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
        player addMagazine "20Rnd_762x51_FNFAL"; 
        player addMagazine "20Rnd_762x51_FNFAL";
        player addMagazine "20Rnd_762x51_FNFAL";
        player removeMagazine "PartGeneric"; 
        sleep 0.01; 
        titleText ["You pressed some FN FAL mags.","PLAIN DOWN"]; titleFadeOut 5;
    }
else
    {
        [nil,_press,rSAY,["PMC_ElectricBlast1", _sounddist]] call RE; 
        player removeMagazine "PartGeneric"; 
        sleep 0.01;
   
        titleText ["The press has malfunctioned.","PLAIN DOWN"]; titleFadeOut 5;
    };
 
 
//Ammo Press by Smokey Meadow

If it still calls the engine_12s sfx after that, I have no idea, because there is no reference to that sfx in the code.

Ok, I tried to use sound "Engine_12s" in the 2D editor in single player mode and it work great.
On my dayz server, when I tryed to make an ammo clip the sound play correctly and a message showing me: "Sound z_engine_12s_0 not found.

I investigated arma2OAserveur.rpt but nothing in there...
Also, I investigated my arma2OA.rpt and i've found this two lines:
Code:
Warning Message: Sound z_engine_12s_0 not found
Warning Message: Sound z_engine_12s_0 not found

I think there is a problem with this line in your code:
Code:
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;

But what's the problem? :rolleyes:

The line you referenced is what alerts zombies when the press activates. You can delete the lines

Code:
_sfx = "engine_12s";

And the lines

Code:
        [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
        [player,_dis,true,(getPosATL player)] spawn player_alertZombies;

And it will still work, but it won't alert the zombies.
Try that and see what happens. Just comment them out by putting // at the beginning of the lines.
 
Ok, I commented this three line only in stnagmag.sqf:
Code:
 private ["_chance", "_sounddist", "_press", "_sfx", "_dis"];
 
_dis=100;
//_sfx = "engine_12s";
_chance = floor(random 100);
_press = nearestObject [player, "Land_Ind_Stack_Big"];
_sounddist = 15;
 
player playActionNow "Medic";
sleep 1;
titleText ["You have activated the ammo press.","PLAIN DOWN"]; titleFadeOut 5;
sleep 2;
 
 
if (_chance > 10) then
    {
 
        [nil,_press,rSAY,["engine_12s", _sounddist]] call RE;   
        //[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
        //[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
        player addMagazine "30Rnd_556x45_Stanag";   
        player addMagazine "30Rnd_556x45_Stanag"; 
        player addMagazine "30Rnd_556x45_Stanag";   
        player removeMagazine "PartGeneric";   
        sleep 0.01;   
        titleText ["You pressed some STNAG mags.","PLAIN DOWN"]; titleFadeOut 5;
    }
else
    {
        [nil,_press,rSAY,["PMC_ElectricBlast1", _sounddist]] call RE;   
        player removeMagazine "PartGeneric";   
        sleep 0.01;
     
        titleText ["The press has malfunctioned.","PLAIN DOWN"]; titleFadeOut 5;
    };
 
 
//Ammo Press by Smokey Meadow

Manufacture stanag magazine works well, by cons manufacture another magazine causes the same error as above.

Little problem with [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
 
You'll need to comment out the same respective lines in FNMAG.sqf, AKMmag.sqf, and AK.sqf, then they should work the same as the one for stnag.
 
Ok, i know how to fix it.
1. In scripts replace all "engine_12s" on "engine12s"
2. In description.ext add 2 classes:
Code:
    class z_engine12s_0
    {
    name="z_engine12s_0";
    sound[]={\sound\z_engine12s_0.ogg,0.9,1};
    titles[] = {};
    };
    class engine12s
    {
    name="engine12s";
    sound[]={\sound\z_engine12s_0.ogg,0.9,1};
    titles[] = {};
    };
3. In mission.pbo create folder "sound" and add in this folder file http://www.mediafire.com/?laanni90aoaqz40
4. Rename this file to "z_engine12s_0.ogg"
5. Done!
 
You'll need to comment out the same respective lines in FNMAG.sqf, AKMmag.sqf, and AK.sqf, then they should work the same as the one for stnag.

Yes, I know. It is only to test and confirm that these two lines cause problems. In which file are "player_alertZombies" and "dayz_zombieSpeak" functions?
 
Yes, I know. It is only to test and confirm that these two lines cause problems. In which file are "player_alertZombies" and "dayz_zombieSpeak" functions?
Not sure what you mean. They are a function in each of the sqf files activated by fn_selfactions.
This part labels the sound as one that will alert zombies, and the distance it will work for:
Code:
_dis=100;
_sfx = "engine_12s";
Then when this part executes, it notes that _sfx was the zombie calling sound, and calls all zombies within 100 meters around the activating player.
Code:
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
 
One thing that might work would be to change it to:
Code:
[_press,_sfx,0,false,_dis] call dayz_zombieSpeak;
[_press,_dis,true,(getPosATL player)] spawn player_alertZombies;
 
Ok, I just tested and it generates the same error:
"Sound z_engine_12s_0 not found"

Otherwise I tested by simply removing this line:
[_press,_sfx,0,false,_dis] call dayz_zombieSpeak;

It works perfectly, sound works and zombies comes fast!

I wonder what exactly does the function dayz_zombieSpeak?
The error comes from that particular function. player_alertZombies it works perfectly.

I have a small improvement to you propose, rather than activate the menu at this location:
ulzw.png

Why not the other side near the door:
gb07.png
 
Honestly, I don't know exactly what that function does. It was just part of another script I wrote that used a code snippet someone else wrote. So I guess that can be taken out of the release, if it's superfluous.

I like your suggestion, too. Not exactly sure how to do that, but I think it would involve the cursortarget < 8 part of the fn_selfactions.
We would need to guess how far away the door is and make it say something like cursortarget < 8 && cursortarget > 6, or something similar. I'll play around with the syntax.
 
Ok, I use this portion of code to activate ammo press only near the door:
Code:
private["_playerPosX","_playerPosY","_playerPosZ","_canPress"];
 
_playerPosX = getPosASL player select 0;
_playerPosY = getPosASL player select 1;
_playerPosZ = getPosASL player select 2;
_canPress = _playerPosX > 10410 and _playerPosX < 10412 and _playerPosY > 2596 and _playerPosY < 2598 and _playerPosZ > 29 and _playerPosZ < 30;
 
if ( _canPress ) then {
    ... addactions...
    }
else {
     ... addactions = -1...
    };
 
Ok, I use this portion of code to activate ammo press only near the door:
Code:
private["_playerPosX","_playerPosY","_playerPosZ","_canPress"];
 
_playerPosX = getPosASL player select 0;
_playerPosY = getPosASL player select 1;
_playerPosZ = getPosASL player select 2;
_canPress = _playerPosX > 10410 and _playerPosX < 10412 and _playerPosY > 2596 and _playerPosY < 2598 and _playerPosZ > 29 and _playerPosZ < 30;
 
if ( _canPress ) then {
    ... addactions...
    }
else {
    ... addactions = -1...
    };
Awesome! I'm trying it now.
 
Back
Top