Putting music to scripted events

Discussions on Modding of S.T.A.L.K.E.R. SoC & Clear Sky

Putting music to scripted events

Postby ket on 15 Sep 2008 13:01

Another part of my TK1.1 mod. I know technically this should be possible but not sure if its actually doable in STALKER. Basically for some scripted events 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? My initial thoughts are I could add the commands into the same script file for the music as the scripted event is in, but I'm not sure.

If thats not very clear let me know and I'll try and explain it better. :D
User avatar
ket
Senior Resident
 
Posts: 1262
Joined: 14 Sep 2008 11:57
Location: The solar system

Re: Putting music to scripted events

Postby Nightwatch on 15 Sep 2008 17:12

ket wrote:Another part of my TK1.1 mod. I know technically this should be possible but not sure if its actually doable in STALKER. Basically for some scripted events 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? My initial thoughts are I could add the commands into the same script file for the music as the scripted event is in, but I'm not sure.

If thats not very clear let me know and I'll try and explain it better. :D


Thanks for the post. :)
Yes it's doable in STALKER.
You can put a "give info" part to the event with which you want to start the music upon the execution of this event. Then you can put the script in one of the related script files and tie it to be conditioned to the release of that specific "info."

You can also walk your way through the XML dialogs (gamedata), enabling the script activation upon the relase of that specific info.

I don't know if current AMK is still using the same event, but there is one such case in NEWSA+SIMBION_tweaked, based on AMK Mod, in which when you answers to the questions of the guard at the Freedom HQ, a pre-set music starts, followed by a multi-helicopter attack.
You can read through that portions for more detailed look. :)
Hope it has provided any help with the question.

edit: quote

edit 2: added the sig with links, if you wish to download and check the scripts.
Last edited by Nightwatch on 15 Sep 2008 22:09, edited 2 times in total.
NEWSA.SIMBION_TWEAK 3.0
Mod Website= Features, Video, Tips & Download Link: NEWSA.SIMBION_Tweak

Watch the Trailer: http://www.youtube.com/watch?v=1Ajw_f8K ... re=channel
Please Do Not download and install any files from links other than those on the Mod's Website
User avatar
Nightwatch
Site Admin
 
Posts: 2676
Joined: 13 Apr 2007 05:42
Location: London, United Kingdom

Postby ket on 15 Sep 2008 18:53

Thanks, I'll give those files a look over :D
User avatar
ket
Senior Resident
 
Posts: 1262
Joined: 14 Sep 2008 11:57
Location: The solar system

Postby EggChen on 15 Sep 2008 21:07

Also, if your comfortable with the all.spawn check that out. Certain space-restrictors are designed to play a sound.

For example, the roar underground in Yantar when you meet the Pseudogiant is triggered by the player entering the space_restrictor. The giant itself does not make the sound :D
User avatar
EggChen
Moderator
 
Posts: 1016
Joined: 13 Sep 2008 00:44
Location: Birmingham, UK

Postby ket on 16 Sep 2008 01:34

Cool I'll look at that too 8) its the "little things" that make the biggest difference I think. People can say I'm fussy or taking too long rolling out TK1.1, but I look at things as quality over quantity :)
User avatar
ket
Senior Resident
 
Posts: 1262
Joined: 14 Sep 2008 11:57
Location: The solar system

Postby Victim on 24 Nov 2008 06:03

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,100


Then 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.300199508667



And 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@2


To 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.
Victim
Senior Resident
 
Posts: 19
Joined: 22 Nov 2008 11:57


Return to Modding Techniques

Who is online

Users browsing this forum: No registered users and 22 guests

cron