OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: laggy on 29 Jan 2010, 01:04:49

Title: RscTitles disappearing when: unit say "mySound"... why ???
Post 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
Code: [Select]
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
Code: [Select]
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
Title: Re: RscTitles disappearing when: unit say "mySound"... why ???
Post by: savedbygrace on 31 Jan 2010, 04:24:28
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.
Code: [Select]
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.

   
Title: Re: RscTitles disappearing when: unit say "mySound"... why ???
Post by: kju on 31 Jan 2010, 08:48:18
how do you call 'rm'?
Title: Re: RscTitles disappearing when: unit say "mySound"... why ???
Post by: laggy on 31 Jan 2010, 10:37:54
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
Title: Re: RscTitles disappearing when: unit say "mySound"... why ???
Post by: dr. seltsam on 01 Feb 2010, 01:42:38
I remember this kind of problem from an older mission...

This was the solution:
Code: [Select]
class CfgSounds
{

sounds[] = {mySound};


class mySound
{
name = "mySound";
sound[] = {\sound\mySound.ogg, db + 30, 1.0,  100};
titles[] = {};
};
};

Tell us, it this works...
Title: Re: RscTitles disappearing when: unit say "mySound"... why ???
Post by: laggy on 01 Feb 2010, 08:43:06
Ahh... so it's the titles maybe causing a prob  :scratch:

Thanks a lot, will try it.

Laggy
Title: Re: RscTitles disappearing when: unit say "mySound"... why ???
Post by: savedbygrace on 07 Feb 2010, 19:50:27
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.