ID:155305
 
okay im thinking of makeing something along the lines of this script but it actualy works
mob
on_step
new()
..()
sound() = pick("sound1","sound2")
You want to modify it a bit. Also you're trying to set a procedure equal to a value. Pretty sure that doesn't work.

I make the assumption that on_step() is a special procedure that you created

mob
Move()
..() // This is necessary so that the default procedure is still called
src.on_step() // Calls on_step proc.

mob
proc
on_step()
var/sound/S = pick('sound1.mid','sound2.mid')
src << sound(S) // Output sound


Note: Any time a mob moves, this will be called. Player or NPC.
In response to Lugia319
Lugia319 wrote:
You want to modify it a bit. Also you're trying to set a procedure equal to a value. Pretty sure that doesn't work.

I make the assumption that on_step() is a special procedure that you created

> mob
> Move()
> ..() // This is necessary so that the default procedure is still called
> src.on_step() // Calls on_step proc.
>
> mob
> proc
> on_step()
> var/sound/S = pick('sound1.mid','sound2.mid')
> src << sound(S) // Output sound
>

Note: Any time a mob moves, this will be called. Player or NPC.

You would want to note, if you called mob.Move() to relocate the player, this would call the sounds to play. (i.e moving to a new map or teleporting) To get around this, you would want to have an argument set i.e Sound=1, and set it to 0 on calls to this that you do not want to make a sound.
In response to Pirion
Pirion wrote:
Lugia319 wrote:
You want to modify it a bit. Also you're trying to set a procedure equal to a value. Pretty sure that doesn't work.

I make the assumption that on_step() is a special procedure that you created

> > mob
> > Move()
> > ..() // This is necessary so that the default procedure is still called
> > src.on_step() // Calls on_step proc.
> >
> > mob
> > proc
> > on_step()
> > var/sound/S = pick('sound1.mid','sound2.mid')
> > src << sound(S) // Output sound
> >

Note: Any time a mob moves, this will be called. Player or NPC.

You would want to note, if you called mob.Move() to relocate the player, this would call the sounds to play. (i.e moving to a new map or teleporting) To get around this, you would want to have an argument set i.e Sound=1, and set it to 0 on calls to this that you do not want to make a sound.

k thx guys