...Среда, 25.12.2024, 20:28



Приветствую Вас Гость | RSS
Главная
[ Обновленные темы · Новые сообщения · Участники · Правила форума · Поиск · RSS ]
  • Страница 1 из 1
  • 1
I really need help, My XML code won't work
@737@Дата: Четверг, 14.01.2010, 16:19 | Сообщение # 1
Полковник
Группа: Персонал
Сообщений: 104
Награды: 0
Репутация: 0
Замечания: 0%
Статус: Не в сети
Hello!

I've tried for days to get this code to work but I simply can't see the problem with it. dry.gif All other sections of the XML gauge works but not this one.

<Element>
<Select>
<Value>
(A:SPOILERS HANDLE POSITION,percent) 10 < if{ 0 (>G:Var3) }
</Value>
</Select>
</Element>

<Element>
<Select>
<Value>
(A:SPOILERS ARMED, bool) (A:SIM ON GROUND, bool) && if{ (G:Var3) ! (A:SPOILERS HANDLE POSITION,percent) 10 > && if{ 1 (>L:SPOILER_SOUND,number) 1 (>G:Var3) } } els{ 0 (>L:SPOILER_SOUND,number) }
</Value>
</Select>
</Element>

It's supposed to play the "spoiler arm whine" sound when the spoilers are armed, the aircraft is on the ground and the spoiler handle is above 10%. I wanted this sound to be played only once so therefore I tried to store a 1 in G:Var3 after the code was executed. In order for the code to be executed, G:Var3 must be equal to 0.
To make it happen, I added a reset code that sets G:Var3 to 0 after the spoiler handle is below 10%.

I would be very grateful if I could get some help with this.

 
AlexДата: Четверг, 14.01.2010, 16:21 | Сообщение # 2
Группа: Удаленные





Klas,

I dunno but this may be redundent - spoilers armed & handle pos 10 >

Maybe try 1 of the 2, the second taking care of the redundency -

Quote (@737@)
<Element>
<Select>
<Value>
(A:SPOILERS HANDLE POSITION,percent) 10 < if{ 0 (>G:Var3) }
</Value>
</Select>
</Element>

<Element>
<Select>
<Value>
(A:SPOILERS ARMED, bool) (A:SIM ON GROUND, bool) && if{ (G:Var3) ! (A:SPOILERS HANDLE POSITION,percent) 10 > && if{ 1 (>L:SPOILER_SOUND,number) 1 (>G:Var3) } } els{ 0 (>L:SPOILER_SOUND,number) }
</Value>
</Select>
</Element>

<Element>
<Select>
<Value>
(G:Var3) ! (A:SIM ON GROUND, bool) & (A:SPOILERS ARMED, bool) (A:SPOILERS HANDLE POSITION,percent) 10 > || & if{ 1 (>L:SPOILER_SOUND,number) 1 (>G:Var3) } els{ (G:Var3) 1 == if{ 0 (>G:Var3) } }
</Value>
</Select>
</Element>

Not tested, but hope this input can help.
Akex

 
AlexДата: Четверг, 14.01.2010, 16:25 | Сообщение # 3
Группа: Удаленные





Klas,

Please disregard the above post, as that code would've resulted in repeating sounds even if it did work. Doh.gif Doh.gif

The following code(s) are very similar to the above except they use a Macro for brevity.

"I dunno but this may be redundent - spoilers armed & handle pos 10 >" - A little more explanation. I donot think that the spoilers can be armed and handle greater than 10% at the same time, I believe they can be this OR that though. Again I provided 2 examples the 1st ANDed and the 2nd ORd. The only difference between the 2 codes are in the Macro.

Just FYI, if you are using DSD_XML_Sound3 gauge for your sounds. Setting a 1 to the trigger variable will play the sound only once, setting the variable to 2 will continually play the sound until the variable is forced back to 0.

<Macro Name="SP_ARM_COND">
(A:SIM ON GROUND, bool)
(A:SPOILERS ARMED, bool)
(A:SPOILERS HANDLE POSITION,percent) 10 >
& &
</Macro>

<Element Name="Play Spoiler Sound">
<Select>
<Value>@SP_ARM_COND (G:Var3) ! & if{ 1 (>L:SPOILER_SOUND,number) 1 (>G:Var3) }
</Value>
</Select>
</Element>

<Element Name="Reset Spoiler Sound">
<Select>
<Value>@SP_ARM_COND ! (G:Var3) & if{ 0 (>G:Var3) }
</Value>
</Select>
</Element>

<Macro Name="SP_ARM_COND">
(A:SIM ON GROUND, bool)
(A:SPOILERS ARMED, bool)
(A:SPOILERS HANDLE POSITION,percent) 10 >
|| &
</Macro>

<Element Name="Play Spoiler Sound">
<Select>
<Value>@SP_ARM_COND (G:Var3) ! & if{ 1 (>L:SPOILER_SOUND,number) 1 (>G:Var3) }
</Value>
</Select>
</Element>

<Element Name="Reset Spoiler Sound">
<Select>
<Value>@SP_ARM_COND ! (G:Var3) & if{ 0 (>G:Var3) }
</Value>
</Select>
</Element>

I hope you haven't tried my previous post and are still having troubles, hopefully this will get you going. Again it is not tested. Good luck & happy coding!

 
@737@Дата: Четверг, 14.01.2010, 16:26 | Сообщение # 4
Полковник
Группа: Персонал
Сообщений: 104
Награды: 0
Репутация: 0
Замечания: 0%
Статус: Не в сети
OK!
 
  • Страница 1 из 1
  • 1
Поиск:


Copyright MyCorp © 2024
Бесплатный конструктор сайтов - uCoz