ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
Need help with scripting ideas for audio!

« Previous 10 events | 1 2 3 4 | Next 10 events »| All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  10:15:17  20 October 2012
profilee-mailreply Message URLTo the Top
SetaKat
Ex modder, Zones only ferret and will someday release a game
(Resident)

 

 
On forum: 02/20/2010
Messages: 6342
NatVac means code like this:
if type ~= "NIL" then
    printf("SND *%s* dist: %d [%f], %s -> %s", type, self:position():distance_to(who:position()), sound_power, who:name(), self:name())
end

Also, I can't recall 100%, but I'm sure that error_log(...) works in SoC, so adding error_log(...) calls throughout the function with different parameters (I use numbers and letters ascending) and testing ingame, then checking the log afterwards to help trace the execution flow, and figure out what parts are/aren't working while I'm developing the code.
  11:05:43  20 October 2012
profilee-mailreply Message URLTo the Top
Daemonion
All About Audio
(Resident)

 

 
On forum: 09/27/2011
Messages: 567
Ok, I tried to greatly simplify the code: http://pastebin.com/nzUenLbd

For the most part, it now looks like this

if bit_and(sound_type, snd_type.weapon_shoot) == snd_type.weapon_shoot then
	if who:id() == db.actor:id() then
		type = "WPN_shoot_actor"
	else
		type = "WPN_shoot"
	end

  11:31:57  20 October 2012
profilee-mailreply Message URLTo the Top
NatVac
Senior Resident
 

 
On forum: 06/15/2007
 

Message edited by:
NatVac
10/20/2012 11:56:59
Messages: 4302
It's probably working as designed, doing nothing but set "type" to the type of sound the NPC heard.

You need to do something with it. If SetaKat's error_log() function doesn't do anything in SoC*, you can replace the "printf" part of the printf(stuff) statement with "dbglog" so that it shows dbglog(stuff). That will put info into the console and log.

Edit: I just realized that Nuor referenced Borovos91's function with the same callback info that I did. I guess I misunderstood his statement that he didn't see it used (true; it's not used in vanilla) because it didn't mention that the set_callback() was commented out.

*Maybe there's a special syntax to the command. It's there, but it seems to be acting like printf() for me.
  11:52:09  20 October 2012
profilee-mailreply Message URLTo the Top
LoNer1
Настоящий Cталкер, Русская Версия
(Resident)

 

 
On forum: 10/23/2009
Messages: 1890
Daem,

You can also try something i am doing as well. Giving different NPC and Mutants different impact sounds I am busy with this for MISERY, as hearing a bullet impact on a metal plate when shooting a guy in an exo is more likely than flesh, AND you can assign new particles. I assigned the on_metal_hit particles, so if you shoot him in the chest, you get the metal particle + sounds.

Increases immersion, a lot! I haven't tested it, but in theory, it should work just fine if you assign the NPC a new material in its config file (gamedata\config\creatures\stalker_xxx.ltx)

the code is simple:

material = your-new-mat.-here



Would be awesome for LURK!

Cheers!
  12:08:44  20 October 2012
profilee-mailreply Message URLTo the Top
Muad'Dib
Senior Resident
 

 
On forum: 01/24/2011
Messages: 421
Hello,

As i said, i'm not scripter. So, i hope that you could run this script and use it to make your player and npc weapon sounds. With help of real scripter (like Natvac)

About the russian mod, i send you a mail with the russian extractor.
I found too the script for frost. I make a little archive with important files.

Scripts files:
bind_stalker.script => call the getwind function

temperature.script => control the temperature according the weather

holod_outfit and holod_wpn script files => define the decrease of health or weapon condition in function of temperature

heat_zone => spawn zone where the health increase (space restrictor)

config/gameplay:
A dialog and infoportion call the heat zone spawn

config/ui
define the temperature on the hud

config/weather

Maybe could you replace the heat zone by your indoor space restrictor, use the temperature.script to control the presence of the rain, and use the holod script to start your sound.

It's idea.

Good luck
  20:20:03  20 October 2012
profilee-mailreply Message URLTo the Top
Nuor
Senior Resident
 

 
On forum: 03/10/2009
 

Message edited by:
Nuor
10/20/2012 22:44:39
Messages: 735
As best I can tell the callback seems to work


! Unknown command:  :SND *MST_step* dist: 2 [0.156828], bar_zastava_guard_2 -> bar_zastava_commander_1
! Unknown command:  :SND *MST_step* dist: 2 [0.158554], bar_zastava_guard_2 -> bar_zastava_commander_1
! Unknown command:  :SND *MST_step* dist: 2 [0.158096], bar_zastava_guard_2 -> bar_zastava_commander_1
! Unknown command:  :SND *MST_step* dist: 2 [0.156568], bar_zastava_guard_2 -> bar_zastava_commander_1
! Unknown command:  :SND *MST_step* dist: 2 [0.151150], bar_zastava_guard_2 -> bar_zastava_commander_1
! Unknown command:  :SND *MST_step* dist: 3 [0.141007], bar_zastava_guard_2 -> bar_zastava_commander_1



edit:

As for your particular problem; the solution that immediately comes to mind is to have a clone of each weapon with a different sound set. When the actor picks up the a weapon it is exchanged for the cloned version with the actor focused sound set.

ex.

[wpn_pm_actor]:wpn_pm
snd_draw      = darius\generic_draw, 0.1
...



just have a update that checks actor inventory and exchanges out weapons and does something similar to switch it back on drop or trade etc.
  09:25:17  21 October 2012
profilee-mailreply Message URLTo the Top
Daemonion
All About Audio
(Resident)

 

 
On forum: 09/27/2011
 

Message edited by:
Daemonion
10/21/2012 11:24:17
Messages: 567
Unfortunately, I don't really know how to read that debug stuff. Shoot.

Well, if I can get stereo audio working, I can get this to work ...



---QUOTATION---

As for your particular problem; the solution that immediately comes to mind is to have a clone of each weapon with a different sound set. When the actor picks up the a weapon it is exchanged for the cloned version with the actor focused sound set.

ex.

[wpn_pm_actor]:wpn_pm
snd_draw      = darius\generic_draw, 0.1
...



just have a update that checks actor inventory and exchanges out weapons and does something similar to switch it back on drop or trade etc.
---END QUOTATION---


Thanks, but that is starting to sound too complicated.
  11:36:45  21 October 2012
profilee-mailreply Message URLTo the Top
Daemonion
All About Audio
(Resident)

 

 
On forum: 09/27/2011
 

Message edited by:
Daemonion
10/21/2012 13:24:17
Messages: 567
I think a good first step would be to see if I can change the game from wanting to call snd_shoot for audio in the w_xxx.ltx files to something else I make up - like, say, snd_shoot_actor.

By the way, I found this in lua_help. Think it provides any clues?

C++ class snd_type {
    const ambient = 128;
    const anomaly = 268435456;
    const anomaly_idle = 268437504;
    const attack = 8192;
    const bullet_hit = 524288;
    const die = 131072;
    const drop = 33554432;
    const eat = 4096;
    const empty = 1048576;
    const hide = 16777216;
    const idle = 2048;
    const injure = 65536;
    const item = 1073741824;
    const item_drop = 1107296256;
    const item_hide = 1090519040;
    const item_pick_up = 1140850688;
    const item_take = 1082130432;
    const item_use = 1077936128;
    const monster = 536870912;
    const monster_attack = 536879104;
    const monster_die = 537001984;
    const monster_eat = 536875008;
    const monster_injure = 536936448;
    const monster_step = 536903680;
    const monster_talk = 536887296;
    const no_sound = 0;
    const object_break = 1024;
    const object_collide = 512;
    const object_explode = 256;
    const pick_up = 67108864;
    const reload = 262144;
    const shoot = 2097152;
    const step = 32768;
    const take = 8388608;
    const talk = 16384;
    const use = 4194304;
    const weapon = -2147483648;
    const weapon_bullet_hit = -2146959360;
    const weapon_empty = -2146435072;
    const weapon_reload = -2147221504;
    const weapon_shoot = -2145386496;
    const world = 134217728;
    const world_ambient = 134217856;
    const world_object_break = 134218752;
    const world_object_collide = 134218240;
    const world_object_explode = 134217984;

};



I also found the equivalent code in CoP called xr_hear.script
http://pastebin.com/WLyrmYsf

It appears to be a bit more sophisticated.
  20:36:52  21 October 2012
profilee-mailreply Message URLTo the Top
Nuor
Senior Resident
 

 
On forum: 03/10/2009
Messages: 735
I'm afraid it may not work as you hope. I think that just reads an ltx that has trigger sounds and instructions in response to them.

I think the actual sound is generated by the engine. Unless it can be intercepted (in netpacket ?), and altered in route, you will probably have to use a method like I mentioned above. Basically you store the weapon data for you old weapon and transfer that data to a newly spawned version with alternate sounds. it isn't difficult in principle but ,as always, the details of execution may have unforeseen problems.

I hope my casual glance is wrong and someone will see a simple solution.
  22:11:30  21 October 2012
profilee-mailreply Message URLTo the Top
Daemonion
All About Audio
(Resident)

 

 
On forum: 09/27/2011
Messages: 567
I got this (translated) response back from the AMK forums:

"Deamonion,
1. The callback hear_callback is deactivated in binder of stalkers and requires appropriate editing (set_callback).

2. Activated callback is pretty buggy (this was the reason for its cut-off by developers apparently) and requires special attention and debugging...

The variant of code with activated and working callback hear_callback you can see in CoP version of the game or in SIMBION:SHoCv3.0 rc12 mod.

Note: Sounds of gunshots will not be "separate" for actor and NPC, but with aid of separate flags (WPN_shoot_actor and WPN_shoot) you can bifurcate the algorithm in callback handler itself."
 
Each word should be at least 3 characters long.
Search:    
Search conditions:    - spaces as AND    - spaces as OR   
 
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
 

All short dates are in Month-Day-Year format.


 

Copyright © 1995-2021 GSC Game World. All rights reserved.
This site is best viewed in Internet Explorer 4.xx and up and Javascript enabled. Webmaster.
Opera Software products are not supported.
If any problem concerning the site functioning under Opera Software appears apply
to Opera Software technical support service.