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 / Possible to stop a loopsound?

Author
Message
Mr Love
18
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 26th Sep 2016 09:39
I have a trigger that starts a loopsound, now I want to use a trigger to stop the bloody sound, is it possible? I have tried this, but it didnt work out:

:state=0,plrwithinzone=1:state=1,loopsound=$0
:state=1,plrwithinzone=0:state=0,stopsound,destroy

ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 26th Sep 2016 17:03
Mr love
I'm not at my computer at the moment. Looking at your script you have state=1 going back to state=0 before it stops sound. Remove the "state=0" from that line of code.
Keep the rest and test.
My games never have bugs. They just develop random features..
Lots and lots of random features...
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 26th Sep 2016 21:44
Hi guys,

It's been a while since I've scripted and this makes me wonder....
Upon encountering "state=0" on the second line, is there an immediate departure of this line or is it completed first?
In other words, does sequencing make a difference and if so, does it always?
Characters. You build them a world and what do they do? They moonwalk, get stuck in the walls and fall through the floors!
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 27th Sep 2016 00:38
@xplosys Yes, you are correct. After getting home, I took a closer look at the scripts. "state=0" is needed to complete to loop.

Mr Love
Quote: "I want to use a trigger to stop the bloody sound, is it possible?"

Yes, of course.
This is the standard script to LOOP sound when player is ONLY in zone.
This script will reset and play sound again if player enters zone.

This is a script if you only want the sound to LOOP when player is
in the zone, but once player leaves it WONT play sound again...

My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
18
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 27th Sep 2016 15:10
"Someone" is playing with the soundzones right now. Ill take a soundinzone and add a sound to it, works fine so far, when I walk into the soundzone everything is ok but when I walk out and in again there is no sound(!) Ill use the soundzone standard script... Whats wrong???
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 28th Sep 2016 00:11 Edited at: 28th Sep 2016 00:12
Mr Love
Oh, your using a "soundzone" I always use a "triggerzone".
Yes, the standard "soundzone" & script is the "soundinzone.fpi" which will only
play a sound once when player enters zone.

If you need it to play sound again when player enters, use the top script
I posted. Give it your own unique name.
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
18
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 28th Sep 2016 06:36 Edited at: 28th Sep 2016 08:46
Thanks but I already have a working script for that (loopsound etc) this is the problem I have, take a look at this picture: Basic sound (ECG Beep) will be destroyed constant if climb into trigger1

Attachments

Login to view attachments
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 29th Sep 2016 00:45
Mr Love
Ok, let me get this right. Looking at your picture, you want if the player goes into "Triggerzone #1" (the one labeled - activate trigger 1)
ALL looping sounds stop! All from that one trigger, correct?
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
18
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 29th Sep 2016 09:51 Edited at: 29th Sep 2016 16:50
Its ok! The sounds has been fixed... (Now I might need help with Lucy, using that old walkstopping script...)

Mr Love
18
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 29th Sep 2016 21:16
This walkstopping script I use right now is horrible, When I pass Lucy She says Hi Walter (Perfect) but after that she moves (without) animation to an old walkpoint where She just rotates...

;Artificial Intelligence Script

;Header

desc = Follow Waypoints with pause

;Triggers

:waypointstate=0:animate=2,waypointstart,timerstart
:waypointstate=3,timergreater=8000:animate=3,waypointnext,timerstart
:waypointstate=4,timergreater=8000:animate=3,waypointrandom
:waypointstate=5:animate=2,waypointreverse

:state=0:state=1
:state=1,plrdistwithin=100:waypointstop,animate=1,rotatetoplr,lookatplr,etimerstart,state=2
:state=2:fpgcrawtextsize=32,fpgcrawtextfont=Arial,fpgcrawtextr=255,fpgcrawtextg=255,fpgcrawtextb=255,fpgcrawtextx=50,fpgcrawtexty=80
:state=2:fpgcrawtext=Hi Walter
:state=2,etimergreater=5000:fpgcrawtextoff,state=3
:state=3:waypointnext,animate=2
;End of Script

Attachments

Login to view attachments
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 30th Sep 2016 00:59 Edited at: 30th Sep 2016 01:04
Mr Love Glad you got your sound problem sorted out.
As for the "waypoint" problem, I looked at your script and noticed that after Lucy
stops and says "Hi Walter"... look at state=3 line (:state=3:waypointnext,animate=2)
To start a "waypoint again, use "waypointstart"...like this
:state=3:waypointstart,animate=2
This make the character look for the nearest waypoint to go to and resume.
The fpgcrawtext & the timer may be causing a glitch?

I also noticed in your script at the top for "waypointstate" it has animate=2 & animate=3
mixed together?
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
18
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 30th Sep 2016 14:19 Edited at: 30th Sep 2016 15:08
"I also noticed in your script at the top for "waypointstate" it has animate=2 & animate=3
mixed together? "

It dosnt matter what animation I put there. The engine dosnt play them anyways..
..And nope, I tried waypointstart with the same result...
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 1st Oct 2016 18:45 Edited at: 1st Oct 2016 18:48
Mr Love
Ok, I had some time to test out some scripts. I got this one to work very well.
This is using the custom "lucy" model I gave you before. (her animations are different from stock ones)

Tested and works, just place a couple waypoints. Lucy walks along, when player gets close she stops and talks to player.
After 5sec's she resumes waypoints if player is one segment away. Player "within" distance is set to 100 (one segment) Adjust to your needs.
best

Note: also, any further script related questions should be posted in script forums before a mod says something
My games never have bugs. They just develop random features..
Lots and lots of random features...
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 2nd Oct 2016 02:23
Quote: "before a mod says something"


Do mods still come around here?
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
18
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 2nd Oct 2016 18:25
You are a genious ncmako! Thanks alot. And Yes this time it worked out well. You really belong to the credits list now and forever!


"Do mods still come around here?"
Last time I saw a mod here was when ertlov wanted to reopen his post, that was about a month ago(!) TGC dont give a crap about this forum anymore...

Login to post a reply

Server time is: 2024-03-28 19:17:24
Your offset time is: 2024-03-28 19:17:24