Welcome New User
Home
|
Forums
|
Register
|
Login
|
Larger Font
Main-Menu
Home
Login
Register
Add Download
Add News
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
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
gggggg
[Forum]
the_mercen...
[Forum]
anoosMonkey
[Today]
foyleman
[Searc]
Bens
[Tutor]
NoOd3lS
[Downl]
6 Members and 17 Guests
Chat MODSonline
Join Chat
0 People Now Chatting
MODSOnline TeamSpeak
download TeamSpeak
In-The-News
Friday, May. 16th
Video games 'do not' encourage violence
Friday, May. 16th
Site update
Friday, May. 16th
MODSonair Episode 127
Tuesday, May. 13th
Web hosting, you need?
Sunday, May. 11th
MODSonair 127 Live
Latest Poll
Would you subscribe for a maps/projects backup utility and service?
I'd pay just about anything for that.
2.06%
If it was cheap enough I would.
4.12%
Only if it came with my MODSonline subscription.
6.19%
I can backup my own files.
82.47%
Why would I backup my files?
5.15%
Read More...
8 comments
Newsletter
Name:
Email:
Newsletter Archives
Your Membership
User Name:
Password:
Register
.
In The Forums
just another question
DOOM III Level D..
Posts:
(3)
Views:
(12)
by the_mercenary
Kill3r's K3 MOD is DANGEROUS TO YOU AND YOUR S...
CoD4 General Gam..
Posts:
(20)
Views:
(266)
by foyleman
Anyone up for a new project?
CoD 4 Level Desi..
Posts:
(2)
Views:
(18)
by chaotica
Indoor = (null) Outdoor = (ambience) SOLVED!
CoD 4 Level Desi..
Posts:
(1)
Views:
(5)
by DeekCiti
Buy geek and gamer themed T-Shirts and Hats @ SplitReason.com!
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.
Jump To:
Select Forum Category
Soldier of Fortune
- SoF Editing, Gaming, and Design
- SoFII Editing, Gaming, and Design
- SoFI & II Custom Map Releases
- SoFII Coding
- SoFI General Gaming
- SoFII General Gaming
- SoFII Server Support
Call of Duty
- CoD Level Design
- CoDUO Level Design
- CoD General Gaming
- CoD and CoDUO Custom Map Releases
- Offsite Links and Information
Call of Duty 2
- CoD 2 Level Design
- CoD 2 Single Player
- CoD2 General Gaming
- CoD2 Custom Map Releases
- CoD2 Scripting
- Offsite Links and Information
Call of Duty 4
- CoD 4 Level Design
- CoD 4 Single Player
- CoD4 General Gaming
- Offsite Links and Information
- CoD 4 Scripting
- CoD4 Custom Map Releases
- MODSCON - ALL
Crysis
- General Crysis
- Crysis Level Design
- Crysis Custom Releases
- Offsite Links and Info
DOOM III
- DOOM III Level Design
- DOOM III General Gaming
- DOOM III Custom Map Releases
Quake 4
- Q4 Level Design
- Q4 General Gaming
- Q4 Scripting
- Q4 Custom Map Releases
- Offsite Links and Information
Quake I, II, III
- Quake 1-3 Level Design
- Quake General Gaming
- Quake Scripting
- Quake Custom Map Releases
- Offsite Links and Information
Half Life 2
- HL2 Level Design
- HL2 General Gaming
- HL2 Custom Map Releases
- Garry's Mod
- Offsite Links and Information
Battlefield
- BF2 General Gaming
- Battlefield 2142 General Gaming
- BF2 Level Design
Unreal Tournament 2003
- UT2K3 General Gaming
- UT2K3 Level Design
- UT2K3 Custom Map Releases
General Gaming Topics
- General Gaming
- General Machinima
- General Level Editing
- General Modeling
- Classic Raven Games
- Offsite Links and Information
MODSonline
- MODSonline
- In The News
- News Around the Web
- General
- MODSon-air
- Teamspeak Servers
- MODSCON 06
Jedi Knight
- Jedi Knight - Jedi Academy
- Jedi Knight II: Jedi Outcast
- Jedi Knight II: Jedi Outcast MOD Support
Star Trek Voyager: Elite Force
- Star Trek Voyager: Elite Force MOD Support
- Star Trek Voyager: Elite Force General
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
1
2
Author
Topic: Script not getting triggered
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 138
Last: May 17, 2008
[
view latest posts
]
Category: CoD 4 Scripting
Posted: Thursday, May. 8, 2008 05:03 pm
Hey guys, I'm having trouble here getting this script to trigger. Everything seems to be working except the trigger itself. I created a script_origin to play my rain sound. The sound plays. In my alias, I have my rain sound set to play as an ambience. I have a secondary alias playing off this main rain sound, with an alias of
building_null
. This secondary alias is playing at a volume of 0. Both play at the same time and when I step into the trigger, it is supposed to play my secondary alias of
building_null
, but it doesn't.
I think the line:
thread player_no_rain_sound();
is missing in the ladder half of the script because I have Iprints set up to debug. Shouldn't it be defined again somewhere in the if and else statements? The
iprintlnbold("touching triggers");
constantly loops, which should be correct, but when I step into my trigger it should Print
play buildingNull
but it doesn't. My trigger has a targetname of
no_rain_sound
. Can anyone see why this is happening?
Here is the script:
Code:
main() { thread rainsound(); } rainsound() { noraintriggers = getentarray("no_rain_sound", "targetname"); if(noraintriggers.size <= 0) return; while(1) { players = getentarray("player", "classname"); for(i=0;i
edited on May. 8, 2008 05:06 pm by DeekCiti
The_Caretaker
Preferred Member
Since: Jun 8, 2004
Posts: 10619
Last: May 17, 2008
[
view latest posts
]
Category: CoD 4 Scripting
Posted: Thursday, May. 8, 2008 05:49 pm
My guess is, it has something to do with the player[i ].outside variable not being carried over between functions.
edited on May. 8, 2008 05:50 pm by The_Caretaker
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 138
Last: May 17, 2008
[
view latest posts
]
Category: CoD 4 Scripting
Posted: Thursday, May. 8, 2008 05:55 pm
ok, do you know how to fix that?
I think it has to say self.outside because it only pertains to One player...
edited on May. 8, 2008 06:03 pm by DeekCiti
.KiLL3R.
Preferred PLUS Member
Since: Oct 26, 2006
Posts: 970
Last: May 16, 2008
[
view latest posts
]
Category: CoD 4 Scripting
Posted: Thursday, May. 8, 2008 06:46 pm
Code:
players[i]
is a single player
self is... well... isnt defined
Code:
main() { thread rainsound(); } rainsound() { noraintriggers = getentarray("no_rain_sound", "targetname"); if(!noraintriggers.size) return; while(1) { players = getentarray("player", "classname"); for(i=0;i
edited on May. 8, 2008 06:47 pm by .KiLL3R.
gotta change sig to a cod4 one :p
KiLL3R
My website
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 138
Last: May 17, 2008
[
view latest posts
]
Category: CoD 4 Scripting
Posted: Thursday, May. 8, 2008 07:19 pm
Using the script you posted above, it seems as though the trigger still doesn't hit.
Getting the loop of IPrint
touching triggers
but when stepping into my trigger_multiple, I get no IPrint of
play buildingNull
Like I mentioned earlier, my trigger_multiple has a targetname of "no_rain_sound", I'm certain that it is correctly set up.
Not sure what I'm missing, but it seems its not hitting that last Thread of:
player_no_rain_sound()
Does the Trigger NEED to be linked or (W) to something in order for it to be valid? Because right now it is not linked to anything. It's just a loose trigger, with a targetname.
.KiLL3R.
Preferred PLUS Member
Since: Oct 26, 2006
Posts: 970
Last: May 16, 2008
[
view latest posts
]
Category: CoD 4 Scripting
Posted: Friday, May. 9, 2008 01:58 am
the trigger doesnt need to be linked
you might not be giving it time to loop
"play buildingNull" will always show unless there are no triggers, same with "touching triggers"
Code:
player_no_rain_sound() { self endon("disconnect"); self.outside = true; wait 0.05; while(1) { if(!self.outside) self playLocalSound("building_null"); iprintlnbold("play buildingNull"); wait 1; } }
edited on May. 9, 2008 02:00 am by .KiLL3R.
gotta change sig to a cod4 one :p
KiLL3R
My website
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 138
Last: May 17, 2008
[
view latest posts
]
Category: CoD 4 Scripting
Posted: Friday, May. 9, 2008 02:26 am
ok, I commented out the first IPrint, and then tested it with the updated portion of the script and it does infact Print
play buildingNull
. So the script is working.
Although, since you changed the wait time to 1, instead of 25 could have been the reason why I didn't see it coming up in the IPrint. So yes, both IPrints do show.
Why it isn't working on the trigger, I don't know, but I do want to tell you that when I go near one of my script_origins, the building_null goes into effect. They are high enough that it wouldn't happen in my map, cause this is just a test map and the origins are near the ceiling. This is strange that the script_origin has a radius and actually plays the building_null. But since my buildings are square, it won't work as a radius, otherwise I'd have gone that route.
Remember how I set up my alias?
Code:
crickets,,amb_elements/amb_cricket_loud.wav,0.5,,ambience,,,,,ambient,,,looping,0.00001,all_mp,,,building_null,,,amb_front,nowetlevel fulldrylevel, building_null,,amb_elements/amb_cricket_loud.wav,0,0,element,,,7,100,auto,,,looping,master,all_mp,,,,,,amb_front,,
I'm simply testing it with a cricket sound, but overall, its the same thing as rain. I just need a longer sound to test it with.
So the script is working then, but for some reason the trigger is not. I'm this close to getting this working with the trigger... arrrgh
.KiLL3R.
Preferred PLUS Member
Since: Oct 26, 2006
Posts: 970
Last: May 16, 2008
[
view latest posts
]
Category: CoD 4 Scripting
Posted: Friday, May. 9, 2008 02:38 am
you using a cricket sound for the null, and theres a few other errors
Code:
crickets,,amb_elements/amb_cricket_loud.wav,0.5,0.5,ambience,1,1,300,120,ambient,,,looping,0.00001,,,,,,,amb_front,nowetlevel fulldrylevel building_null,,null.wav,0.01,0.01,max,1,1,10000,100000,auto,,,,master,,,,,,,amb_front,
gotta change sig to a cod4 one :p
KiLL3R
My website
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 138
Last: May 17, 2008
[
view latest posts
]
Category: CoD 4 Scripting
Posted: Friday, May. 9, 2008 03:03 am
Well, I was using the cricket sound for the null, but it was playing an 0 volume, so its the same thing as a null.
Alright, I've entered the information you have here into my alias. I believe you missed the "all_mp" on both lines, and also your min and max dist were switched, so I swapped them. No problem.
added the following to my zone file:
rawfile,sound/null.wav
Still the trigger isn't playing the null.
Just out of curiosity, why does the script want the building_null to constantly play? Shouldn't it only execute that portion of the script only when I hit the trigger?
.KiLL3R.
Preferred PLUS Member
Since: Oct 26, 2006
Posts: 970
Last: May 16, 2008
[
view latest posts
]
Category: CoD 4 Scripting
Posted: Friday, May. 9, 2008 03:40 am
no no, you dont need the all_mp
you dont add sounds with rawfile,blah
add
sound,csvname,,,
to your maps csv
the script only plays building_null when self.outside is false
gotta change sig to a cod4 one :p
KiLL3R
My website
1
2
MODSonline.com Forums
: Call of Duty 4 :
CoD 4 Scripting
Mortgages
|
Download Hindi movies
|
Mortgages
|
Download DVD movies
|
Flights
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.com can be found
News.php
.
Partners
Ask About
Advertising
Friends
Ask About
Advertising
Link to Us
468 x 60
468 x 60
468 x 60
150 x 400
140 x 40
Advertise
With Us
MODSonair
Please help us to raise in the ranks of podcasting and subscribe to our itunes feed using the link above.
MODSonair Releases
•
MODSonair Episode 127
•
MODSonair Episode 126
•
MODSonair Episode 125
•
MODSonair Episode 124
•
MODSonair Episode 123
Copyright
©
2008 MODSonline
Tresware Content Management System Copyright © 2008 Tresware
Website Designed and Hosted