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
cme4pain [Searc]
47riley [Forum]

2 Members and 18 Guests
Chat MODSonline
0 People Now Chatting
MODSOnline TeamSpeak

download TeamSpeak

In-The-News
Wednesday, Aug. 27th
Details revealed
Sunday, Aug. 24th
Mappers Guild AKA Help Desk
Sunday, Aug. 24th
MODSonair 142 LIVE
Friday, Aug. 22nd
MODSonair Episode 141
Thursday, Aug. 21st
New Gameplay Footage
Latest Poll
Want a MODSonline Wiki for various games?
I think a Wiki would be a great addition to MODSonline. 77.89%
I could see a benefit of a Wiki. 3.68%
I think it would take away from the community. 5.26%
Wiki sites are never good. 3.16%
Wiki... isn't that Buck Roger's robot slave? 10%
Read More...
13 comments

Newsletter
Name:
Email:
Newsletter Archives
Your Membership
User Name:
Password:
Register.
In The Forums
More fun error questions...
CoD 4 Level Desi.. Posts: (6) Views: (34) by 47riley
Awfull Silence.... Pls Help
CoD 4 Scripting.. Posts: (3) Views: (43) by pigshyte
script help?
CoD 4 Scripting.. Posts: (3) Views: (24) by FOAMY
Scripting Help Pls
CoD 4 Scripting.. Posts: (24) Views: (164) by Aeneren
Art of War Central 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: Multiple Player Trigger Problems
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. 28, 2008 03:28 am
Hey guys,

Have a trigger_multiple set up in my map. I'm running the script below, and it works, but not with multiple players. If I step in the trigger, with no other players in that same trigger, the sound "building_null" plays (which is correct). Basically the rain sound stops. If another player comes into the trigger, the "building null" plays for him, but for me, the rain sound comes back. It is almost as if the trigger was claimed to me, but then when he comes into the same trigger I'm in, it is now claimed to him.

Can anyone see why this script is allowing that?


Code:


I swear I had this problem solved but it keeps coming back to bite me. The script needs to allow everyone the same rights to the trigger. All players at all times, while in the trigger, either with or without other players, need to hear the "building null" while inside the trigger_multiple". Can anyone help me solve this?
NovemberDobby
General Member
Since: Sep 17, 2006
Posts: 1620
Last: Aug 18, 2008
[view latest posts]
Level 8
Category: CoD 4 Scripting
Posted: Wednesday, May. 28, 2008 06:15 am
Hmm, what sort of shape is the trigger? You might be able to get away with adding a script loop that checks to see if any of the players are in a certain radius of the center, so it works like a trigger.
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. 28, 2008 01:59 pm
Well, the trigger started as one big one, the size of the building. Then I had to slice it at each floor level. So the trigger was cut up into a bunch of smaller squares and rectangles (not that small, they are still huge, sizes of rooms). My reason for slicing it up had to be done for the effect to work, it had to do with the doorways.

Why do you think this is happening when more than one player is in the same trigger? This doesn't happen for other sounds? It must have something to do with using "player" because that is the real difference between the first two scripts I used. It sucks because if I don't use a script using "players" all the other sounds get screwed up and play from the center of my trigger_multiples.

This loop your talking about... I believe Kill3r gave me a script with that loop in it...

You know... I wonder if Kill3rs old script he gave me would work if I started messing with it. Cause the script itself worked, but it only allowed one trigger in the whole map the rights to play "building_null". Which I don't understand why that is happening. No other triggers would work, but one. I may have to start looking at that one because he's got some stuff in it that looks like it would allow more than one person in the trigger at once. It seems to be built for something such as this. Although he gave me two versions of it, This is the second version he gave me, the one he told me to use:

This is the Second Version Below

Code:



Here is the first Version Below

Code:


Maybe you can see why his script doesn't allow you to enter more than one trigger in the map... that is the only reason why I never used this script. I would have asked him, but you know the reason why I can't now.
NovemberDobby
General Member
Since: Sep 17, 2006
Posts: 1620
Last: Aug 18, 2008
[view latest posts]
Level 8
Category: CoD 4 Scripting
Posted: Wednesday, May. 28, 2008 04:03 pm
Use the 'second version' but take the wait 0.1; out of the end of it, after self playlocalsound("...
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. 28, 2008 05:16 pm
For some odd reason, those two scripts aren't working anymore... strange.

Well, this is a real disappointment, I may have just lost one of the best things about my map...

I'm pretty sure the problem lies with how the sound is playing.

player PlaySoundToPlayer( "building_null", player);
player playlocalsound("building_null");

What I need to do is have my original script say:

self playlocalsound("building_null");

I need the sound to play only to the player, because what is happening, when another player comes into the trigger, it takes away the current players "building_null". If I can just get this script to say something like this...


Code:


These are the two lines that are the problem I believe.

self waittill("trigger", self);
self playlocalsound("building_null");


I keep getting a runtime error saying my entity (the trigger) is not a player. I'm guessing this is because of the first part of the script using the sound(i) playloopsound("current"); Must have something ONLY to do with a player rather than an individual.

I will keep experimenting otherwise.

Do you know what I mean? Do you know how to edit that existing script above to refer only to "self" but also making sure it "playlocalsound" as well? The key here is getting the two together in the same script. I'm not too good at this, so I have to guess, and test, guess and test... just takes a long time. Any help appreciated.
playername
Preferred Member
Since: Aug 24, 2006
Posts: 687
Last: Aug 16, 2008
[view latest posts]
Level 6
Forum Moderator
Category: CoD 4 Scripting
Posted: Monday, Jun. 16, 2008 03:22 pm
Yes, it deals with the loop. You are not defining when to stop the looping. However, there is no way to stop those loops without stopping the sound for all the other players. What you will have to end up doing is something like this, assuming the sound "current" is the rain sound?

November check me :P


Code:


some of that i am not sure about... like the while in the for?
Few tips for coding.
1. Keep the script as short as possable.
2. Don't use comments unless you HAVE to point something out.
3. Don't over complicate the script, keep it orgainized and easy to read.

These help you find simple errors and makes it easy to make changes.
NovemberDobby
General Member
Since: Sep 17, 2006
Posts: 1620
Last: Aug 18, 2008
[view latest posts]
Level 8
Category: CoD 4 Scripting
Posted: Monday, Jun. 16, 2008 04:08 pm
checked :p

thread trigger_source(); will never happen as it's under a while(1) loop which won't finish. Also, player.playrain needs to be defined as 0 when the player connects and of course wherever else the trigger script is.
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 196
Last: Jul 25, 2008
[view latest posts]
Level 4
Category: CoD 4 Scripting
Posted: Monday, Jun. 16, 2008 10:34 pm
With that said Dobby, any possibility you could do a quick fix on this script so I can do a test?

[wave]

I gave up as of now, but if there is new information I'm willing to give it a go again...
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.
Intergi
Partners
The Firing Box
XoXide
Call of Duty Headquarters
Frag Universe
Battle for Europe COD2
modbase.be
Ask About
Advertising
Friends
Canada Kicks Ass Clan
SOF2 Files and Downloads
After Life Gaming
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 141
MODSonair Episode 140
MODSonair Episode 139
MODSonair Episode 138
MODSonair Episode 137
Next Show
The next MODSonair show will air LIVE on:
08/31/2008 11:00 EDT

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