How to auto-repeat sound effects

#1
Attached is a project showing one way to repeat a timed sound effect. ‎ 
The 'Trigger Loop' event which is currently set to 'When Examined' can be changed to activate 'If Approached' or such. ‎  Tongue

Here's the breakdown
-------------------------------------------
Event#1 (Event Trigger=[trigger can be anything you want it to be]) [This Event starts up the loop in Event#2]
Control Active Leaf (Target='Event#2' - Move to Leaf01)

--------------------------------------------
Event#2 (Event Trigger=Always On) [This Event actually plays the timed/looped the sound effect]
Leaf00
Change Counter Value (Set 'Counter00-Times Played' to 0)

Leaf01
Play Sound Effect
Alter Counter Value (Raise 'Counter00-Times Played ' by 1)
Begin Timer00
Control Active Leaf (This Event Forward by 1)

Leaf02
IF ('Times Played Counter' =4)
‎  ‎  Control Active Leaf (This Event to Leaf0)[This ends the loop after 4 plays]
OTHERWISE
‎  ‎  Set Timer Value In Counter (Acquire Value From 'Timer0' & Set its value in 'Counter01-TimePassed')
‎  ‎  ‎ IF ('Counter01-TimePassed' =3)[This waits 3 seconds before replaying the sound]
‎  ‎  ‎  ‎ Control Active Leaf (This Event Move to Leaf01)[This restarts the loop]
‎  ‎  END IF
END IF
-----------------------------------------------





Attached Files
.zip   Bell Loop Demo.zip (Size: 14.53 KB / Downloads: 193)
Reply

#2
I'm Sure it's great and all but my SoM Crashes when I try to load this or any other sample projects you have made , Don't know why exactly I know I always have to disable my DirectX to edit and re-enable to test, but my saved projects work just fine when I try to load any of the samples I get " SoM Main has encountered a blah-da-be -blah-de-dee" so ...any sugestions on this, I know your tutorials are sure to be an awesome help and would have saved me so much time but, unfortunaly I have had to "wing much of the begginning, ‎  until I found you wonderful people:) I love you all Wink I like mostly the age group we share I am 34 by the way:)
Reply

#3
That is very odd. All it requires is map Piece #0005, and Barrel (1) Object.
You might try deleting the som_db.ini in the project folder; it might have some setting that's not compatible with your PC.
But that shouldn't cause SOM_MAIN.EXE to crash. If that doesn't help, I'll just type in the directions manually here- let me know.

Can someone else please test the attached project and see if it causes a crash?


Reply

#4
Sorry my friend no dice:( I deleted the Ini and it still won't load. However, and the bright side I got the sound loop to work after all:) so all is well there , could you still explain a little about the IF command and IF message and otherwise they still confuse me :) thanks John your directions are sound:)
Reply

#5
Added the typed looping event to the first post in this thread and added some 'IF' info here:
https://www.swordofmoonlight.com/bbs/ind...ml#msg2852
Reply





Users browsing this thread:
1 Guest(s)