Jump to content

Detection methods


shiholude

Recommended Posts

Let get right to it:

 

Expanding off a couple other mods, I want to make use of scripting to follow a multitude of events in game, and then play reactive sounds based on those events.

 

This idea stems from the PipButler and TalkingUserInterface mods, but I want it to function differently. There are things I dont want to track in the PipButler mod, and I want more versitility than the TUI offers.

 

Things that I want to detect, but dont know how:

- chems are taken and wear off

- sucessfully chosing a correct password while hacking (or fail)

- leveling up

- piplight is turned on / off

- quest changes (updates, additions, completions)

- radio signals

- radiation exposure (3 levels of severity)

 

Now, I realize that I could simply thorw new sounds into the sound folders - but this goes beyond that simple functionality. First, I want these additional sounds to be toggle-able via menus, so that when I release it, they are modular to the users preference (and mine - as my own preferences sometimes change during game). Secondly, I have multiple messages that will play at random for many events (i didnt list them all above since some of them I have figured out already), so I need some scripting and quest association to help chose a random event. Lastly, I want to limit looping of sounds, as well as how often they play - some of this can be achieved though sound file manipulations, but that only gets me part way there.

 

The problem is that I dont comprehend how to "listen" for the 'chems' effect being applied to (or removed from) the player. Likewise, I dont know how to detect the rest of those events above.

 

-Shiholude

Link to comment
Share on other sites

OK, there are only a few things I know here:

 

Most of the sound files are already in the appropriate sound folders, so you'll need to locate them and replace those sounds.

Many of those sound files are played via the engines (ie. the Hacking Sound), so you can't mute it unless you can find a way to edit entries in-game.

Limiting the looping of sound's a bit tricky, but do-able. I can write down a script here, but be warned, it might be a bit sketchy...

 

scn (title)

 

short Played

float Timer

 

if Played < (number of times you want to play)

if Timer == 0

PlaySound (sound ID)

set Timer to Timer - (length of sound)

set Played to Played + 1

 

endif

endif

end

Link to comment
Share on other sites

Thanks for the reply dazzerfrog. That'll help me after I learn how to detect them in the first place.

 

I'm wanting to moreso understand the following (rough psuedocode):

 

-Game Running

- if hacking (Listen for Hacking attempt at computer) <---dont know how

- if selection is correct

-play random success hack sound

- else

-play random fail hack sound

 

- elseif chem addiction (Listen for player taking chems) <---dont know how

- play random chem sound

 

- elseif chems wear off (Listen for chems fading) <---dont know how

- play random chem wearing off sound

 

- elseif player levelup (Level up Event) <---dont know how

- play random level up sound

 

...etc

 

Most of these "sounds" are actually spoken phrases using recording software that I have. So I wouldn't want to mute the original sounds per se, rather have those sounds play and my customized phrases spoken alongside / overtop / inconjunction with the base sounds. Also, I want all these things toggleable - but all this is a waste of time if I cannot learn how to dtect the events (or sounds) when they trigger.

 

-Shiholude

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...