Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Restricting ambience in game

Author
Message
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 8th Jan 2017 18:14
I know how to keep ambience at a given level. Since there is no "ambienceless" or "ambiencegreater" ,what is the easiest way to restrict it to something like 2 through 10? I want to allow a little leeway for differences in monitors, but not enough to kill the atmosphere. Probably something to do with vars. I looked, but didn't see what I wanted.

Thanks.
Characters. You build them a world and what do they do? They moonwalk, get stuck in the walls and fall through the floors!
Mr Love
19
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 9th Jan 2017 03:48
Hi xplosys, I found a script that I made a long time ago, so I dont remember if it works. But I think it works just fine...

desc = ambience script

:state=0:ambience=12,ambiencered=11,ambienceblue=10,ambiencegreen=10

Please tell if this script worked or not...
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 9th Jan 2017 04:47
Yes, just looking at it I can see that it would set the ambience to 12.

Quote: "what is the easiest way to restrict it to something like 2 through 10?"
Characters. You build them a world and what do they do? They moonwalk, get stuck in the walls and fall through the floors!
Corno_1
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 9th Jan 2017 13:51
Not possible without modding. You can not read the ambience level. Maybe you can ask normad or s4real
PredicateC - FPSC to GameGuru FPE converter
https://forum.game-guru.com/thread/211068
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 9th Jan 2017 17:10
Thanks for the bad news Corno_1.
Characters. You build them a world and what do they do? They moonwalk, get stuck in the walls and fall through the floors!
Mr Love
19
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 10th Jan 2017 04:24
Corno_1 is wrong about this. I just tried it, and I courld restrict My ambience in a triggerzone. Just use this script, and add the fpi-file to both appear and main script...

:state=0,plrwithinzone=1:state=1,ambience=2


xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 10th Jan 2017 16:22 Edited at: 10th Jan 2017 17:16
Hi Mr Love,

I'm not making myself clear enough. Yes... you can SET the ambience that way but I want to RESTRICT the players ability to change the ambience via the < > keys to a certain range. I want to restrict his ability to increase the ambience above 10. There is no way to read the ambience level from the engine... it does not allow access to that value even though it does allow you to change it. Therefore you cannot tell the engine to stop increasing at 10.

Thanks for your help and I hope that makes it clear.
Characters. You build them a world and what do they do? They moonwalk, get stuck in the walls and fall through the floors!
2S!K
12
Years of Service
User Offline
Joined: 21st Jul 2012
Playing: Working on "This Is Home" an FPSc project
Posted: 10th Jan 2017 19:18
There's no way to read the ambience level but as a long time scripter of FPSC you must find a way around that! In the past I made a day/night cycle script and relized it is similar to what you want, and I have also toyed with the "ambience=2" code. Unfortunately the player is able to hold the < > key down to increase/decrease the ambience by 1 until they release the key. I came up with a code you might like though just put it in a trigger zone and walla!

2S!K Productions
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 11th Jan 2017 00:46
Thanks 2S!K. It works like a charm. Thank you.

Quote: "you must find a way around that"

I forgot our motto. Thanks for reminding me.
Characters. You build them a world and what do they do? They moonwalk, get stuck in the walls and fall through the floors!
2S!K
12
Years of Service
User Offline
Joined: 21st Jul 2012
Playing: Working on "This Is Home" an FPSc project
Posted: 11th Jan 2017 01:19
No problem, I also added a check for key release so that you wouldnt have trouble getting that perfect ambience level. I find fidgeting back and forth to get the right level being pretty pesky.
2S!K Productions
Mr Love
19
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 11th Jan 2017 06:52
Thats a pretty smart script 2S!K.. You dont know a way to create a working 3DSound in FPSC???
2S!K
12
Years of Service
User Offline
Joined: 21st Jul 2012
Playing: Working on "This Is Home" an FPSc project
Posted: 11th Jan 2017 10:27
The stock scripts work to an extent, such as the generator in the scifi pack. The "3dsound=" command no longer seems to be supported as "sound=" does the same function. You can use these scripts on any entity and the will work, however I noticed that some sound files (usually the lengthier ones) do not seem to fade perhaps a difference in the file format??. But even the ones that do work you will find you can still hear across the entire map and do not fade at realistic distances.
I found out 2 ways of doing this:
Go into your setup file and look for something like this ":state=0:music=,musicvolume=50,soundscale=25" and change the soundscale to a lower number. This will tell the engine to fade 3d/dynamic sounds sooner. This method is good to fix how all sounds scale in your game.
or
Set the appear script as the "repeatsound.fpi" script such as with the generator and put this as your main:

Change the soundscale value to your will, creating variations with different values of this script is useful. This lets you give different entities different scaling methods for example: you can here a car engine farther than you would a fly.

I did encounter a problem with the second method..since it is essentially changing the levels soundscale value multiple entities with different scale scripts don't play too well with each other. If you desperately need this let me know and ill look more into it.
2S!K Productions
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 11th Jan 2017 21:55
Great work around 2S!K with the ambience script. This script has
other possibilities for use?
My games never have bugs. They just develop random features..
Lots and lots of random features...
2S!K
12
Years of Service
User Offline
Joined: 21st Jul 2012
Playing: Working on "This Is Home" an FPSc project
Posted: 12th Jan 2017 02:20
Thanks, Ive worked with FPSc for a long time just decided it was time for some contributions. What do you suggest by possibilities for other uses?.. I assume you can come up with some nice environmental sounds but it does have its limitations.
@Mr Love- I have came up with a few more scripts/Ways that I think you would enjoy much more.
1: Since the code essentially tells the engine to override the setup file putting this inside a dynamic entity didn't really make sense to me? You still need a dynamic entity that will play sounds though... Just place an entity with the stock "Sound Emitterloop" script and place trigger zones that change the soundscale. Place this script in the trigger zone changing the soundscale level to your will.

With this method you can place various ones around the map to enhance certain environmental features, ie: in some areas you can place this trigger zone and set "soundscale=.01" (for some reason it does not support 0/maybe because scaling by 0 will be the same?) to mute out the sounds and other areas make it greater.

2: I came up with another script that still uses the old way but now works better with multiple entities (as long as they're script distances don't collide). This method only uses a main script which I guess will be less work but whats the fun in that! (of course your sound0 audio file). I tested it out on a 16 segment long strip with two radios at opposite ends emitting /atmos/electrichum (and others) sounds; it worked great! try it! Place this script on the first entity

and this on the other


Sorry for the long responses I just wish to be as clear as possible to address any concerns and possible problems. You may want to adjust values for playerdistances and soundscale according to entity sounds if you are going to use this.
2S!K Productions
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 12th Jan 2017 11:17
2S!K
Quote: "What do you suggest by possibilities for other uses"

I'm thinking your "ambience" script could be used to manipulate objects, doors,
maybe use in an elevator like situation? I can't think of anything specific right now,
but I'm sure something will come up where this would be useful
My games never have bugs. They just develop random features..
Lots and lots of random features...
2S!K
12
Years of Service
User Offline
Joined: 21st Jul 2012
Playing: Working on "This Is Home" an FPSc project
Posted: 12th Jan 2017 18:21
Hmm I dont see it being used much for doors and other entities but an elevator yes. Maybe your traveling in an elevator and all of a sudden you come to a screetching hault due to power failure. Only back up lights to guide you.
2S!K Productions

Login to post a reply

Server time is: 2024-11-23 08:15:50
Your offset time is: 2024-11-23 08:15:50