OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: laggy on 29 Jan 2010, 01:04:49
-
Hello,
I want a resource image (.paa) to be shown (see below) and an object to say a sound at the same time.
However, as soon as the say command is given the resource disappears, even though it should show for another 10 seconds at least.
Without the "say" command it works as it should... weird???
.ext
class RscTitles
{
class rm
{
idd=-1;
movingEnable=true;
duration=15;
fadein = 2;
fadeout = 3;
name="rm";
controls[]={"rm"};
class rm
{
x = - 0.65; y = - 0.4;
w = 2.3; h = 2.0;
type = 0;
idc = -1;
style = 48;
colorBackground[] = {0, 0, 0, 0};
colorText[] = {1, 1, 1, 1};
font = BitStream;
sizeEx = 0;
lineSpacing = 0;
access = ReadAndWrite;
text = "rm.paa";
};
};
};
class CfgSounds
{
sounds[] = {mySound};
class mySound
{
name = "mySound";
sound[] = {\sound\mySound.ogg, db + 30, 1.0, 100};
titles[] = {0, ""};
};
};
objectSay.sqf
while {isNil "myVar1" AND isNil "myVar2"} do
{
myObject say "mySound";
sleep 1;
};
The resource is started through a trigger, and the image is found in the triggers list of resources.
I don't see a logical reason for a command collision, is this a bug?
Thanks in advance,
Laggy
-
I could be wrong but if the resource is listed in a triggers list of effects...so to is your sound listed there and to prevent overlap, it may be cancelling it out. Try removing "mySound" from the array above your classes.
sounds[] = {mySound}; -->>> sounds[] = {};
This may remove your sound from being listed as a trigger effects option and thus prevent a clash. It's a long shot but I think I recall something similar in OFP. If anything, It's something to try.
-
how do you call 'rm'?
-
I do call "rm" from an editor placed trigger.
Can I call it any other way (i.e by name in a script) to make it not clash?
Thanks both of you,
Laggy
-
I remember this kind of problem from an older mission...
This was the solution:
class CfgSounds
{
sounds[] = {mySound};
class mySound
{
name = "mySound";
sound[] = {\sound\mySound.ogg, db + 30, 1.0, 100};
titles[] = {};
};
};
Tell us, it this works...
-
Ahh... so it's the titles maybe causing a prob :scratch:
Thanks a lot, will try it.
Laggy
-
Yep, it is the string qoutes withing the curly braces of the title section that cancels out the dialogue. As it expects a string of text to print but has nothing but empty quotes. This is obvious but just in case it's not clear for others, I went ahead and commented.