Architheutis
Member
Hi developers.
I recently solved the problem with playing sounds, coming from enemies = sound direction,
where and how distant the enemy is from the player. Now I want the same effect with moving
enemies.
For example:
I created a patrolling knight with rusty amour. That makes sounds with every step he does.
To "taking the sound with him" (the closer he comes to the player, the louder the noise can be
heard). The sound must move with the x- and y position of the enemy.
I`ve found out, yet, that can be solved by the emitter.
I`ve set in the creation code of the player idle a global emitter ("fxEmitter").
And I`ve put that code to the step of the rusty knight:
As you can see, I wrote a remark line above the emitter activation.
When I play that example, I can hear the sound come and go, depending from
enemies position, if he comes or if he goes away.
But the problem is:
The rusty sound is started 60 times per seconds, a rapidfire of that sound.
:-(
How can I tell gml, just restart playing the audio, after it is ready with playing that sound (1 Second)?
I hope I could explain myself as good as possible!?
Thankful for every hint of you.
Archie.
I recently solved the problem with playing sounds, coming from enemies = sound direction,
where and how distant the enemy is from the player. Now I want the same effect with moving
enemies.
For example:
I created a patrolling knight with rusty amour. That makes sounds with every step he does.
To "taking the sound with him" (the closer he comes to the player, the louder the noise can be
heard). The sound must move with the x- and y position of the enemy.
I`ve found out, yet, that can be solved by the emitter.
I`ve set in the creation code of the player idle a global emitter ("fxEmitter").
And I`ve put that code to the step of the rusty knight:
Code:
// Here is the site, where the part has to come, to control the FX-emitter
audio_play_sound_on(effectEmitter,au_WarriorWalk01,false,2)
audio_emitter_position(effectEmitter,x,y,0)
When I play that example, I can hear the sound come and go, depending from
enemies position, if he comes or if he goes away.
But the problem is:
The rusty sound is started 60 times per seconds, a rapidfire of that sound.
:-(
How can I tell gml, just restart playing the audio, after it is ready with playing that sound (1 Second)?
I hope I could explain myself as good as possible!?
Thankful for every hint of you.
Archie.