Ket wrote:I'd like to have a specific music track play as the scripted event is executed. What I'm wondering is where and how could I insert the code?
Firstly, I recommend creating your own sound script file: (I don't have SoC installed currently but IIRC the workings are very similar)
Open "script_sound" and add your own file:
#include "script_sound_yours.ltx". Then add your list to
[list]:
"list_yours"Now create that file:
"script_sound_yours.ltx" and enter your sounds:
[list_yours]
assistant_help
[assistant_help]
type = 3d
path = monsters\bloodsucker\forest_hidden_
shuffle = rnd
idle = 10,20,100Then you have 3 (maybe 4) options:
Play via dialog action*:
<action>your_script.play_assistant_help</action>*I have no idea on how to script so I've learned to mod STALKER without relying on it. Hindsight dictates that choosing not to learn LUA probably wasn't a smart decision at all but I've still managed to have a lot of fun modding the 2 STALKER games.
Play via dialog info portion linked to script:
<give_info>play_assistant_help</give_info> -
[logic]
active = walker
[walker]
path_walk =
path_look =
on_info = {+play_assistant_help} walker@start %=play_sound(assistant_help)%Play via space restrictor:
[xxxxx]
section_name = space_restrictor
name = your_sound_zone
position = -288.881866455078,0.149632185697556,-41.0058364868164
custom_data = <<END
[logic]
cfg = scripts\marsh\your_sound_zone.ltx
END
shape0:radius = 10.300199508667And in
"your_sound_zone.ltx":
[logic]
active = sr_idle
[sr_idle]
on_info = {+play_assistant_help} sr_idle@wait
on_game_timer = 0 | sr_idle@2
on_actor_dist_le_nvis = 10 | {-play_assistant_help} sr_idle@play_sound
[sr_idle@2]
on_info = {+play_assistant_help} sr_idle@wait
on_game_timer = 0 | sr_idle@3
on_actor_dist_le_nvis = 10 | {-play_assistant_help} sr_idle@play_sound2
[sr_idle@3]
on_info = {+play_assistant_help} sr_idle@wait
on_game_timer = 0 | sr_idle
on_actor_dist_le_nvis = 10 | {-play_assistant_help} sr_idle@play_sound3
[sr_idle@play_sound]
on_info = {+play_assistant_help} sr_idle@wait
on_game_timer = 11 | {-play_assistant_help} %=play_sound(assistant_help)% sr_idle@2To cue multiple sounds, or to automate things you can eliminate interaction and simply use the space restrictor itself as the trigger:
[logic]
active = walker@walk
[walker@walk]
path_walk =
path_look =
on_info = {=actor_in_zone(your_sound_zone)} walker@camp %=play_sound(assistant_help)%walker@camp can be used to switch functions again - on_timer, on_signal etc. If you're comfortable with the all.spawn file then I definitely recommend using space restrictors to do the work for you.
EggChen wrote:Also, if your comfortable with the all.spawn check that out. Certain space-restrictors are designed to play a sound.
+1
I've come to feel that Space restrictors are one of the best tools that STALKER has to offer, as they effectively automate gameplay by removing the need for manual interaction. They can be used for everything from setting the player up to be busted for stealing to playing sounds, initiating spawns and most obviously - for keeping NPCs in check - and because it works in a passive fashion, there's a lesser requirement for considering the players actions and an increased chance of creating unexpected events.
EDIT/ Tried to tidy the examples somewhat.