Jump to content

jeanmoul

Member
  • Content Count

    5
  • Joined

  • Last visited

  • Medals

Community Reputation

10 Good

About jeanmoul

  • Rank
    Rookie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. finally the day has come !
  2. Hi, I'd like to have a sound played when the player enters an area, and another sound when he's outside of it. It's an ambiant sound so I want it to loop with a short overlap between two loops for a smooth transition. So I have to use CfgSound which allows that, unlike CfgMusic. As I've read here and there, the only way to make a sound stop on demand is to make it said by an object, and then delete the object when you want it to stop. So I've done this : myinsidesound.sqf: [color="#FF8040"] insidesoundsource [color="#8B3E2F"][b]=[/b][/color] [color="#7A7A7A"]"Empty_HeliH"[/color] [color="#191970"][b]createVehicle[/b][/color] [color="#191970"][b]position[/b][/color] [color="#000000"]player[/color][color="#8B3E2F"][b];[/b][/color] insidesoundsource [color="#191970"][b]attachTo[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#000000"]player[/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]while[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]do[/b][/color] [color="#8B3E2F"][b]{[/b][/color] insidesoundsource [color="#191970"][b]say[/b][/color] [color="#7A7A7A"]"myinsidesound"[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]sleep[/b][/color] [color="#FF0000"]20[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color][/color] I have a "myoutsidesound.sqf" that has exactly the same structure. And then the following code : [color="#FF8040"][color="#191970"][b]while[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]do[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#191970"][b]if[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#8B3E2F"][b][[/b][/color][color="#000000"]player[/color][color="#8B3E2F"][b],[/b][/color] [color="#7A7A7A"]"myinsidearea"[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] CBA_fnc_inArea[color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#1874CD"]_inareasound[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]execVM[/b][/color] [color="#7A7A7A"]"myinsidesound.sqf"[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]sleep[/b][/color] [color="#FF0000"]0.1[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]terminate[/b][/color] [color="#1874CD"]_outofareasound[/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// (optionnal, I've removed this and it doesn't change anything) [/i][/color] [color="#191970"][b]deleteVehicle[/b][/color] outsidesoundsource[color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// (outidesoundsource is defined in myoutsidesound.sqf) [/i][/color] [color="#191970"][b]while[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#000000"]player[/color][color="#8B3E2F"][b],[/b][/color] [color="#7A7A7A"]"myinsidearea"[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] CBA_fnc_inArea[color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]do[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#191970"][b]sleep[/b][/color] [color="#FF0000"]0.05[/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]else[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#1874CD"]_outofareasound[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]execVM[/b][/color] [color="#7A7A7A"]"myoutsidesound.sqf"[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]sleep[/b][/color] [color="#FF0000"]0.1[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]terminate[/b][/color] [color="#1874CD"]_inareasound[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]deleteVehicle[/b][/color] insidesoundsource[color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]waitUntil[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#000000"]player[/color][color="#8B3E2F"][b],[/b][/color] [color="#7A7A7A"]"myinsidearea"[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] CBA_fnc_inArea[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]sleep[/b][/color] [color="#FF0000"]0.05[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [/color] It works fine exept for one big issue : When I walk inside the area, and then exit and comme back let's say 8 seconds after my first entry, the insidesound will be played as planned but after 12 seconds a second iteration of this sound will overlap the first one. It's actually the repeat of the 20 second loop initiated during my first appearance within the area. As it appears my object that I have deleted and created again when I came back inside the area have kept memory of the first loop and initialize it on top of the one that is currently running. And if I exit the zone and come back in it again, there will now be three successives loops that will be triggered, and so on... I was wondering how to avoid that, maybe by creating a different object with different value each time, but I have no clue how to do that. If someone has an idea on how to resolve this problem I would be so pleased.
  3. Hi, First of all congrats for this fantastic tool, it allows me to build some structures I would have been unable to make without it.:) One thing I would love to do is be abble to have sub-menu that would allow to chose the "type" of objects (cargo, military ...) so it would be easier to find them, because there is a pretty long list of objects (especially if you use addons). Maybe someday when I'll be better at scripting, I'll come back to this thread to ask you permission to modify the code in order to do this. Got a lot to learn untill I can do that though.
  4. jeanmoul

    The Newcomers' Introduction Thread

    Hi ! I'm jeanmoul from France, playing Arma since Arma2. I'm member of the french team DTB and a fresh mission editor. I came here mainly to discuss about scripting.
×