Page 1 of 1

Create beam and play sound around player

Posted: Thu Jun 02, 2016 5:09 pm
by decompile
Hey,

How Can I create a beam around the player, which moves from the player to around 400 units around him, sort of a "scan" arround the player him self and play a sound which is the loudest for the player itself, but the more far away the player is the less noise it makes.

found

from effects import beam

but dunno how to define the keyword "end".

The other is probably something with emit sound

Re: Create beam and play sound around player

Posted: Thu Jun 02, 2016 5:15 pm
by Ayuto
Use engines.sound.Sound for the sound and pass the "index" parameter to emit the sound from a specific entity.

A beam always has a start and an end. See the documentation for more info:
http://builds.sourcepython.com/job/Sour ... fects.beam

Re: Create beam and play sound around player

Posted: Thu Jun 02, 2016 5:24 pm
by iPlayer
For the beam, you can either use temp entities (through the effects.beam wrapper) or create env_beam if you want to be able to track the entities that touch your beam. Second approach is a little tricky as you need to create another entity to set one of the end points for env_beam.

Second method is implemented here

If you don't need tracking touching entities, just go with effects.beam.

Re: Create beam and play sound around player

Posted: Thu Jun 02, 2016 9:06 pm
by decompile
Thanks to iPlayer

Syntax: Select all

Sound(sound_name, index=player_index, attenuation=Attenuation.STATIC).play()
temp_entities.beam_ring_point(..)