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 Product Chat / [HELP] Two BIG issues with FPSC Classic

Author
Message
KingMassen
2
Years of Service
User Offline
Joined: 23rd Dec 2016
Location:
Posted: 26th Dec 2016 04:03
1) How to make 3D sound whose volume decreases as the player is moving away from the entity? I use the "sound=x" instruction but it doesn't work and the sound keeps playing with constant volume like background music. I tried to use "3dsound=x" but this time no sound plays at all. If a 'game engine' doesn't have a 3d sound feature in it then how come it is a 'game engine'? LOL

2) When I put an entity in the level and set the STATIC MODE property to YES the entity disappears when I test the level

I use FPS Creator Classic version 1.20.018
ncmako
7
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 26th Dec 2016 12:38 Edited at: 26th Dec 2016 13:04
KingMassen
Quote: " How to make 3D sound whose volume decreases as the player is moving away from the entity"

I see the FPSC manual says this about it..

But it's not listed in the Syntax list? The entity has to be Dynamic & which script did you use
in it's "main ai" to run the sound? Here is a simple sound script that adjusts to player distance.
Make a simple large room at least 6 segments long, place a table, a radio like from ww2 pack
make radio dynamic, set to "is immobile" attach script to "main ai" Attach a music .wav file
to "sound0" slot, not to the "sound1" slot.




Quote: " STATIC MODE property to YES the entity disappears when I test the level"

Was it a "stock" item or a custom one with a custom script? Also, did you set it to "immobile"
under property settings? Changing a Static entity to Dynamic tends to make them "fly away"
without proper scripts.
Look in your "Docs" folder and you'll see a pdf "ocfpscguide" -Official Community Guide-
It has a lot of valuable info for FPSC.

Edit: forgot to mention, for a 3d sound effect, take a large "prefab" like the "science lab"
place player marker at one end, place the scifi Terminal-D at other end, you'll notice
"repeatsound.fpi" script in it's "Start AI", test run. Sound increases as player gets closer.
My games never have bugs. They just develop random features..
Lots and lots of random features...
KingMassen
2
Years of Service
User Offline
Joined: 23rd Dec 2016
Location:
Posted: 26th Dec 2016 16:52 Edited at: 26th Dec 2016 21:06
1) Doesn't work And I did exactly what you said ,put the Terminal D entity in the science lab and tested the level but still the sound plays as if it is background music ,constant high volume whatever the distance to the player from the entity is

The weird thing is that why the manual is talking about 3DSOUND action which actually does nothing at all? My code is pretty simple:



And I tried replacing $0 with an actual file path like "audiobank\mytestsound.wav" but still doesn't work

I have FPSCC that is in the GitHub Repository here

2) I really don't understand what you are saying. I am using a crater entity that came with FPSCC not an external one. It is actually Dynamic and works pretty well when it is Dynamic (Physics is pretty good actually LOL) Now I want this crater to become static and here comes the problem, the entity simply disappears

EDIT: Obviously, the entity disappears because of using the 'sound' instruction with it LOL However what if I want an entity to be fixed (not affected by pushing for example) and play sounds at the same time? Should I disable the physics?
ncmako
7
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 26th Dec 2016 22:55 Edited at: 26th Dec 2016 22:59
KingMassen
Quote: "Doesn't work And I did exactly what you said"

I added a simple all stock test map below. I made a longer room with player at one
end and Terminal-D at other end. Walk toward Terminal and each door you go thru
volume gets louder. Just download the test map, place in your "mapbank" folder
and open in fpsc.
Quote: " but still the sound plays as if it is background music"

Well, the music command I used is for "background music".
Like I said, look in the Syntax list and all commands are explained.
Music commands are for background music, "sound" commands are for sounds coming
from an "entity", and "plrsound" are from the player.
Your script says basically "have the entity play this sound - $0"
That's simple enough, but there's no volume to changing with player distance.
You can do that same for "sound" commands as for "music" only
sound uses "soundscale" for volume instead of "volume" like "musicvolume" does.

Noticed I used a sound loop command, sounds only play once
unless looped.

I really don't know why 3DSOUND is in the manual but not in Syntax list.
Quote: "t is actually Dynamic and works pretty well when it is Dynamic "

So it is Dynamic.
Quote: " Now I want this crater to become static "

Yes, you can do that.
Quote: "Obviously, the entity disappears because of using the 'sound' instruction with it"

No, you CAN'T do that. Static entities can not run scripts. They are just static. ONLY dynamic entities
can run scripts.
Quote: "what if I want an entity to be fixed....Should I disable the physics?"

No, remember what I said before. Keep it dynamic, right click open property setting, go down until
you see "Is Immobile" set to "YES" now it wont move and can still run scripts

Also: here is a super tool for you to use if your doing a lot of scripts changes.
You should always clean out the ".bin & .dbo" files between script changes or
else changes wont take effect. Just drop the .exe in your main directory and
run once between tests. Makes life a lot easier.
http://forumfiles.thegamecreators.com/thread/196309
My games never have bugs. They just develop random features..
Lots and lots of random features...

Attachments

Login to view attachments
KingMassen
2
Years of Service
User Offline
Joined: 23rd Dec 2016
Location:
Posted: 27th Dec 2016 01:08
So I have to code it by myself as it is not really implemented in FPSCC? I tried your level and the sound volume didn't change or anything
ncmako
7
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 27th Dec 2016 22:24
KingMassen
Quote: "So I have to code it by myself as it is not really implemented "

Code what? The scripts provided in the scriptbank are for getting one started. After that any
custom scripts one would of course have to do themselves. It's not too hard when you get
the jest of it. Are you talking about the "3dsound" ? After doing a little searching I found
out it was only implemented in the early versions of fpsc. Since most users don't record in
stereo sound, so it wasn't needed anymore.
Quote: "the sound volume didn't change or anything "

Funny, it works perfect on mine. Are you running the cleaner between tests?

There are a few things to ask you. I'll do it through a PM since this thread is getting
dragged out.
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
14
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 28th Dec 2016 15:20 Edited at: 28th Dec 2016 16:31
You have to add musicoverride to ncmakos script: Now it shourld work fine... (Have to be a dynamic object)
Here is the working script...

;Artificial Intelligence Script
;Header
desc = sound scale distance

;Triggers
:state=0:state=1
:state=1,plrdistwithin=449:musicoverride=$0,musicvolume=20,state=2

:state=2,plrdistfurther=500:musicoverride=$1,state=0
:state=2,plrdistwithin=399:musicvolume=30
:state=2,plrdistwithin=349:musicvolume=40
:state=2,plrdistwithin=299:musicvolume=50
:state=2,plrdistwithin=249:musicvolume=60
:state=2,plrdistwithin=199:musicvolume=70
:state=2,plrdistwithin=149:musicvolume=80
:state=2,plrdistwithin=99:musicvolume=90
;End of Script
KingMassen
2
Years of Service
User Offline
Joined: 23rd Dec 2016
Location:
Posted: 28th Dec 2016 21:38 Edited at: 28th Dec 2016 21:39
But it will be sharp ... can I use something like this idea:

Sound volume = (1 - (player_distance/sound_range))*100

It is not a script ,just an idea ... can it be done on with FPI script?

And the problem is that ncmako says it works fine on his PC without scripting it ... this means I am lacking a feature here and who knows what else could be not working
Mr Love
14
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 28th Dec 2016 22:40
Quote: "But it will be sharp ..."


What do You mean with that? You can change music volume and distance...
KingMassen
2
Years of Service
User Offline
Joined: 23rd Dec 2016
Location:
Posted: 29th Dec 2016 00:15 Edited at: 29th Dec 2016 01:57
Deleted
KingMassen
2
Years of Service
User Offline
Joined: 23rd Dec 2016
Location:
Posted: 29th Dec 2016 00:18 Edited at: 29th Dec 2016 01:56
DELETED BY POSTER

Login to post a reply

Server time is: 2019-07-21 02:13:05
Your offset time is: 2019-07-21 02:13:05