MODSonline
  Welcome Guest to MODSonline Home | Forums | Register | Login
Main-Menu
Home
Login
Register
Add Download
Add News
Add Tutorial *
Forums

Advertise
Affiliate Store US *
Affiliate Store UK *
Affiliate Store CA *
Angry Letter Generator
Avatar Upload
Calendar of Games
Contact
Downloads
FAQs
Forums
Member List
Member Projects
News
News Grabber *
Policy
Polls
Private Messages
Reviews
Screenshot Gallery
Search
Servers - Game
Store - Shirts *
Subscribe
Topics
Tutorials
Weblinks
Wiki *
Tutorials
CoD Mapping
CoDUO Mapping
CoD2 Mapping
CoD4 Mapping
CoD FAQs
HL2 Mapping
HL2 FAQs
SOF1 Mapping
Crysis Mapping
Q4 Mapping
Doom 3 Mapping
Doom 3 FAQs
UT2K3 Mapping
SOF2 Mapping
SOF2 FAQs

Lightray Modeling
General Modeling
General Modding
Adobe Photoshop
Common Mapping Errors

Readme.txt Generator
Members-Online
{=EM=}Carc... [Forum]
codmp [News]
Sevenz [Searc]
cme4pain [Forum]
Rikoe [Tutor]
guizaobujin [Downl]
MonKeYPaWs [Tutor]

7 Members and 13 Guests
Chat MODSonline
0 People Now Chatting
MODSOnline TeamSpeak

download TeamSpeak

In-The-News
Friday, Sep. 5th
W.@W. Beta in October!
Friday, Sep. 5th
MODSonair Episode 143
Thursday, Sep. 4th
SnA The Game!
Wednesday, Sep. 3rd
Battlefield Heroes - Victory Village Trailer
Sunday, Aug. 31st
MODSonair 143 LIVE
Latest Poll
Want a MODSonline Wiki for various games?
I think a Wiki would be a great addition to MODSonline. 77.94%
I could see a benefit of a Wiki. 3.43%
I think it would take away from the community. 4.9%
Wiki sites are never good. 3.43%
Wiki... isn't that Buck Roger's robot slave? 10.29%
Read More...
13 comments

Newsletter
Name:
Email:
Newsletter Archives
Your Membership
User Name:
Password:
Register.
In The Forums
help with fx
CoD 4 Level Desi.. Posts: (2) Views: (17) by xcp_naruto005
ambient sound ?
CoD 2 Level Desi.. Posts: (3) Views: (18) by liquidpredata
Destructible TV's
CoD 4 Level Desi.. Posts: (12) Views: (133) by MastaKwaa
EXPLODING TRUCK HELP
CoDUO Level Desi.. Posts: (10) Views: (75) by morgawr
Google 468 Banner Quake 4 Mods for Dummies
Typhoon Servers
Forums
MODSonline.com Forums

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD 4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, rEdrUmMDK, Foxhound, Rasta, StrYdeR, The_Caretaker, batistablr, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Restricted Access subscribe
Author Topic: Scripted Sound Problem
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 196
Last: Jul 25, 2008
[view latest posts]
Level 4
Category: CoD 4 Scripting
Posted: Tuesday, May. 20, 2008 03:24 am
I couldn't find any other information on this issue so I'll post it.

The problem is this... Only sounds that are playing from a script, whether it be a door sound that plays when you open it, or something that moves when its triggered by a player... for some reason, stop playing from their original origin, and take over the nearest Origin or Trigger half way through the sound playing.

An example:

I walk up to my door. The door is made up of a Trigger_Use_Touch. The door is a Script_Brushmodel, and the door has an Origin texture for its hinge. I press use to open the door. The door sound is about 2 seconds long. The first (second) plays from the doors Hinge/Origin, but the second (second) plays from the Center of the Trigger_Multiple, that I'm standing in, and this Trigger_Multiple exists because it is playing an Ambient (Room) Track, for the room I'm standing in. The same thing happens for another script_brushmodels (origin).

Its almost like if the sound is longer than a second, and is defined to have a max_dist in the soundalias, that is able to reach other Triggers or Origins... it seeks out the closest one, and finishes playing the sound there, instead of its Birth Origin.

I just don't understand why the sound quits at its original Origin, and then moves over to this other Trigger, or Origin that its near. All my Scripted Sounds are doing this. Just as a note, all my scripts are Unique, nothing containing the same array names or thread names. This is driving me nuts... Anyone know why this is happening? Or a way to stop it?

I'm wondering if there is something in the soundalias that can stop this. Since the soundalias controls everything soundlike, it would make sense the answer is in there.
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 196
Last: Jul 25, 2008
[view latest posts]
Level 4
Category: CoD 4 Scripting
Posted: Tuesday, May. 20, 2008 05:40 pm
ok, I've got an Update on this one. I found what's causing it, but no idea how to fix it. If I can get the second script to work correctly, this problem is solved.

The First script I'm posting is what is returning the problems in post 1. This script does collect the "array" or triggers around the map.

Script 1

Code:



The Second script does not return the problem in post 1, BUT it only allows the first Trigger you walk in to be active. Its almost like it is not collecting the "array" of triggers around the map. Basically, the first trigger you step in Works, but any following triggers a player steps in, it does not work.

Script 2

Code:



So my question is now, why isn't the Second script, collecting the Array of triggers placed around my map. Why does it only allow the first trigger you hit to work, and all others it ignores?

My guess is because of the .size being collected in these areas in this code snippet:


Code:
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 196
Last: Jul 25, 2008
[view latest posts]
Level 4
Category: CoD 4 Scripting
Posted: Wednesday, May. 21, 2008 03:13 pm
Comparing the two scripts, my hunch was it had something to do with:


self playSound("building_null");
self playLocalSound("building_null");

Because, these are really the only Difference between the two scripts.
So the answer is simply this:

self playLocalSound("building_null");


I find this really strange that, if a player is standing in a trigger_multiple, and that trigger_multiple is already playing a sound while the player is standing in it... if the player hits another trigger_use or trigger_use_touch, and the sound of this trigger_use is longer than one second, it will take over the center of the trigger_multiple that you happen to be in as the sound continues to play, UNLESS "playlocalsound" is used in the trigger_multiple's script.

playlocalsound = Plays a sound locally to the player.

playsound = Play the sound alias as if coming from the entity.


Quote:

Only thing here is, if you try and add playlocalsound to the first script, it will return an error saying "entity # is not player". I'm sure the fix is simple, but I'm not a scripter...So after testing that enough and not getting that script to work I found one that will.


This makes 100% sense, but then I just had to find a script to run it. Using the following script will run it, and work perfect. Thanks everyone for the help! LOL [wave]


Code:
Restricted Access Restricted Access subscribe
MODSonline.com Forums : Call of Duty 4 : CoD 4 Scripting
All logos and trademarks and information in this site are property of MODSonline LLC © 2008.
The comments are property of their posters.
RSS news feeds for MODSonline can be found News.php.
Art of War Central
Partners
Frag Universe
Call of Duty Headquarters
The Firing Box
modbase.be
XoXide
Battle for Europe COD2
Ask About
Advertising
Friends
Canada Kicks Ass Clan
After Life Gaming
ModTheater
Ask About
Advertising
Link to Us
MODSonair
View in iTunes
Please help us to raise in the ranks of podcasting and subscribe to our itunes feed using the link above.
MODSonair Releases
MODSonair Episode 143
MODSonair Episode 142
MODSonair Episode 141
MODSonair Episode 140
MODSonair Episode 139
Next Show
The next MODSonair show will air LIVE on:
09/07/2008 11:00 EDT

Time remaining:
Copyright © 2008 MODSonline
Tresware Content Management System Copyright © 2008 Tresware
Website Designed and Hosted   Tresware