Code: Select all
<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Caption="ZGameEditor application" FileVersion="2">
<OnUpdate>
<Group Comment="Sound 1 (works)">
<Children>
<Condition Expression="return trigger_sound1;">
<OnTrue>
<ZExpression>
<Expression>
<![CDATA[trigger_sound1 = 0;
sfx_1.Length = 1;]]>
</Expression>
</ZExpression>
<PlaySound Sound="sfx_1" NoteNr="60" ByReference="255"/>
</OnTrue>
</Condition>
<KeyPress Keys="1" RepeatDelay="0.1">
<OnPressed>
<ZExpression>
<Expression>
<![CDATA[sfx_1.Length = 0;
trigger_sound1 = 1;]]>
</Expression>
</ZExpression>
</OnPressed>
</KeyPress>
</Children>
</Group>
<Group Comment="Sound 2">
<Children>
<Condition Expression="return trigger_sound2;">
<OnTrue>
<ZExpression>
<Expression>
<![CDATA[trigger_sound2 = 0;
sfx_2.Length = 0.2;]]>
</Expression>
</ZExpression>
<PlaySound Sound="sfx_2" NoteNr="60" ByReference="255"/>
</OnTrue>
</Condition>
<KeyPress Keys="2" RepeatDelay="0.1">
<OnPressed>
<ZExpression>
<Expression>
<![CDATA[sfx_2.Length = 0;
trigger_sound2 = 1;]]>
</Expression>
</ZExpression>
</OnPressed>
</KeyPress>
</Children>
</Group>
</OnUpdate>
<Content>
<Sound Name="sfx_1" Volume="0.88" Osc1Waveform="1" Mod0Active="1" Mod0Destination="11" Mod0Amount="1" Mod1Active="1" Mod1Source="1" Mod1Destination="2" Mod1Amount="1" Env0Active="1" Env0DecayTime="0.38" Env0SustainLevel="0.328" Env0ReleaseTime="1.38" Env1Active="1" Env1AttackTime="0.22" Env1DecayTime="0.7" Env1SustainLevel="0.276"/>
<Variable Name="trigger_sound1" Type="4"/>
<Sound Name="sfx_2" Length="0.3" Volume="0.2" Osc1Waveform="3" Osc1PW="-0.87" UseOsc2="1" Osc2Volume="0.38" UseFilter="1" FilterCutoff="0.9091" FilterQ="0.0999" Mod0Active="1" Mod0Source="2" Mod0Destination="2" Mod0Amount="0.36" Mod1Active="1" Mod1Source="3" Mod1Destination="11" Mod1Amount="1" Mod2Active="1" Mod2Amount="1" Mod3Destination="11" Mod3Amount="1" Env0Active="1" Env0AttackTime="0.22" Env0ReleaseTime="0.22" Lfo0Active="1" Lfo0Style="2" Lfo0Speed="0.06" Lfo1Active="1" Lfo1IsBipolar="1" Lfo1Style="2" Lfo1Speed="0.24"/>
<Variable Name="trigger_sound2"/>
</Content>
</ZApplication>
If you want to hear what the sound 2 really sounds like, play it in the Sound preview and don't click Start / press Alt+Enter (the sound will get glitchy as soon as it is played the first time in Preview).