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
CoDWW 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
gt-eins [Today]
dBKapsel [Today]
juul [Forum]
cod9499 [Downl]
Rainbowsix [Forum]
phykill [Today]
V.I.O [Forum]
soulja_boy [Downl]
petecz [Forum]
ricardos [Forum]

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

download TeamSpeak

In-The-News
Saturday, Nov. 22nd
CoD:WW Video Tutorial is up!
Friday, Nov. 21st
MODSonair Episode 154
Thursday, Nov. 20th
Call Of Duty World At War - Mod Tools
Wednesday, Nov. 19th
Half-Life 1 $0.98
Sunday, Nov. 16th
MODSonair 154 Live
Latest Poll
Single or Multiplayer maps for World at War?
Single-Player 36.36%
Multiplayer 54.55%
WHAT!? The tools are out? 9.09%
Read More...
4 comments

Newsletter
Name:
Email:
Newsletter Archives
Your Membership
User Name:
Password:
Register.
In The Forums
Zombies - Last Christmas
CoD:WW Custom Ma.. Posts: (5) Views: (67) by ricardos
CoD5 Nazi Zombie RECORDS!
CoD:WW Level Des.. Posts: (25) Views: (330) by Rainbowsix
Too weird...
CoD:WW Level Des.. Posts: (2) Views: (37) by Sevenz
No sound
CoD:WW Level Des.. Posts: (8) Views: (132) by foyleman
Art of War Central Half-Life 2 Mods for Dummies
CoDWW Download
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, Welshy
Latest Posts
Subscribed Posts
Search
Restricted Access Restricted Access
Page
Next Page
subscribe
Author Topic: Help With Triggers
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 208
Last: Nov 2, 2008
[view latest posts]
Level 4
Category: CoD 4 Scripting
Posted: Sunday, Mar. 30, 2008 03:15 am
I haven't found much, if anything on how to use a trigger properly. What I want to do is try and find a shortcut to call my ambient rain mp3. So what I did was right click the 2d window and create a Trigger Multiple. I filled my entire map with the Trigger Brush, so how would I go about calling my file "amb_rain.mp3" from my Soundalias? What would be the targetname? The alias, or the mp3? The alias is "rain". And are there other things I need to add scripting wise... ?
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 208
Last: Nov 2, 2008
[view latest posts]
Level 4
Category: CoD 4 Scripting
Posted: Monday, Mar. 31, 2008 12:23 am
Would someone be kind enough to give me some simple steps on how to set up a trigger in Radiant, and how to call that trigger from script... I want to trigger sounds. It can be Any example, I just need an outline to start with... please.
UB_Dragon
General Member
Since: May 18, 2006
Posts: 148
Last: Jul 13, 2008
[view latest posts]
Level 4
Category: CoD 4 Scripting
Posted: Monday, Mar. 31, 2008 08:15 am
DeekCiti writes...
Quote:
Would someone be kind enough to give me some simple steps on how to set up a trigger in Radiant, and how to call that trigger from script... I want to trigger sounds. It can be Any example, I just need an outline to start with... please.


Here ya go, this worked for me,

i made a dog house and wanted a dog to bark when you get close to it, also i use an owl "hoot" near certain trees.


http://www.modsonline.com/Forums-top-75265.html

good luck
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 208
Last: Nov 2, 2008
[view latest posts]
Level 4
Category: CoD 4 Scripting
Posted: Wednesday, Apr. 2, 2008 07:49 am
Could someone please explain in a simple, detailed, way of setting up a trigger, in particular a sound trigger in radiant... "This includes the brush used, does an origin brush HAVE to be placed inside, stuff like that". Every post I read is completely vague and very frustrating. I just can't seem to make it work even in my test map. Any help would be appreciated.

edited on Apr. 2, 2008 07:52 am by DeekCiti
Sevenz
General Member
Since: Apr 24, 2006
Posts: 1132
Last: Nov 23, 2008
[view latest posts]
Level 8
Category: CoD 4 Scripting
Posted: Wednesday, Apr. 2, 2008 10:11 am
i don't think that trigger_multiple is a good idea for the ambient sound. anyway, this might help you:

http://www.modsonline.com/Forums-top-77288-0.html#619394

what i did in radiant:
made a new brush, right-click trigger -> multiple. Entity editor, targetname ammo_trig. (you may add a wait value too.)
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 208
Last: Nov 2, 2008
[view latest posts]
Level 4
Category: CoD 4 Scripting
Posted: Wednesday, Apr. 2, 2008 11:38 am
Thanks for the reply Sevenz...

What I'm trying to do with it though should work. You remember my post about the indoor/outdoor ambience? Well, I'm still working on it. I got it to work with using (x,y,z) coordinates but the problem with that is (x,y,z) coordinates are little bubbles, depending on how big you make the radius for that sound in your sound alias. In this case my radius was 400 for my null. Here is my Sound alias I'm using for this.

Code:


Then I would have these lines in my _fx.gsc

Code:


So you see, working with a radius bubble on a square building won't really work because some of the bubble will land outside the house and the rest inside. So if I was standing on the edge of the house "outside" I would hear the null of no rain, which isn't what I want. So it worked, but not 100%.

So what I'm thinking is this... If I use the same Idea but call these Sound alias's by using triggers, or simply the Null by using a trigger then at least I can shape that null to the exact shape of my house with no Bubble runoff. So if I use these Alias's:

Code:


With this Script that "Killer" gave me


Code:


It should work this way. My problem being I need help on how to set up the triggers because I don't know how to set them up correctly. Maybe you can help me now that you know what I'm trying to do. I hope my post makes sense.

edited on Apr. 2, 2008 11:39 am by DeekCiti
Sevenz
General Member
Since: Apr 24, 2006
Posts: 1132
Last: Nov 23, 2008
[view latest posts]
Level 8
Category: CoD 4 Scripting
Posted: Wednesday, Apr. 2, 2008 12:12 pm
Killer's script doesn't need a real trigger does it?

make a few brushes to "fill" the inside of a building, select all brushes, give them a non-colliding, non-visible texture (eg. tools\trigger), right-click script -> script_brushmodel. Do not deselect the brushes! Press N key to bring up the entity editor. Type "targetname" into the key field and "no_rain_sound" in the value field (without the quote marks ""). Hit enter, close entitiy editor by pressing N again. Deselect the brushes (escape key) and make a new brush group for next building. Save, compile, rebuild ff and give it a try.
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 208
Last: Nov 2, 2008
[view latest posts]
Level 4
Category: CoD 4 Scripting
Posted: Friday, Apr. 4, 2008 01:33 am
I draw two brushes, with the Trigger Brush.

Select them both.. Right Click the 2d window, and say "make non-Colliding"

Right Click 2d window again, and say "script > brushmodel"

Hit "N" and notice these two Brushes have a classname of "script_brushmodel" now

I then type a key of "targetname" and value of "building_null" because this is my soundalias for no rain sound.

I then deselect and save. Recompile, and build fast file. Then Run selected map. Loading bar goes all the way, then game crashes.


-------


Quote:

IF, I DO NOT make that brushmodel "non-colliding" the game loads, and within the first two seconds of spawning the rain goes null for a second, then back on for a second, then null again for a second, and then stays on permentantly, (which is nowhere near the trigger brushes) but if I try to walk through my trigger brushes, they are invisible walls, that stop me. So I understand that you have to make them non-colliding, but when I do make them non-colliding it either crashes my game on loadscreen or when I'm doing the "Compile Reflections".


What is the reason I'm making them a "script_brushmodel" ?

Why would making them "non-colliding" crash my game on load and or while compiling reflections?

Why not make them a "trigger_multiple"?

I'm confused and not understanding why its crashing, and don't know why they need to be a script_brushmodel". Grrr!

I had no idea it would be this difficult to make a simple trigger that triggers a sound, then again, maybe I'm just an idiot...
Sevenz
General Member
Since: Apr 24, 2006
Posts: 1132
Last: Nov 23, 2008
[view latest posts]
Level 8
Category: CoD 4 Scripting
Posted: Friday, Apr. 4, 2008 04:17 am

Quote:
Anything that moves is a script_whatever (script_model for a model, script_brushmodel for a brush)

Turning something to script_whatever makes it an entity. Only entities can be accessed via script. Turning a brush to trigger_whatever creates an entity too. If you just place models and brushes in Radiant, you can't use them for scripting at all.

Getting Started in Scripting (Moving Things)


I guess the trigger texture isn't non-colliding, if you don't turn it into a trigger (just texturing the brush). Try using nodraw_notsolid instead. Non-colliding seems to not work for tool textures / transparent textures.


trigger_multiple fires the trigger-event as long as a player is touching the brush. Without setting the "wait" key/value pair, it will trigger 20 times per second. I find that very inefficent. What we need is a "trigger_touch". It should fire the trigger event only, when players enter or leave the trigger brush (whenever isTouching changes). Example (how it should be, theoretical code, not working!):


Code:


trigger_multiple and the TrigOn / TrigOff function would work, but not for your purpose (turning the trigger off would turn it off for all players, but it has to be turned off for the current player only -> impossible by using that two function, 'cause they just move the whole trigger brush out of the playable area).
Sevenz
General Member
Since: Apr 24, 2006
Posts: 1132
Last: Nov 23, 2008
[view latest posts]
Level 8
Category: CoD 4 Scripting
Posted: Friday, Apr. 4, 2008 04:40 am
Actually, the trigger_use_touch should work. But i'm confused about the linking...


Quote:
when the player is touching and activated, the trigger will use its target


what does that mean? Do we have to link a script_model / script_brushmodel to the trigger? But we don't have/want a model or brush, only the trigger event whenever a player touches the trigger brush (and leaves!). Instead of an entity, would Info -> Null work too? Or how do we have to link it? Does it matter, to what we link?

Or what about placing trigger_use_touch brushes only where the player can enter a building (windows, door frames, ...)? That would trigger an event each time a player enters or leaves a building. To check whether player is inside or outside --> isTouching against an invisible script_brushmodel (non_colliding).
Restricted Access Restricted Access
Page
Next Page
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.
MODSonline Subscriptions
Partners
modbase.be
CODAddicts - Call of Duty News & Downloads
XoXide
Frag Universe
Battle for Europe COD2
The Firing Box
Call of Duty Headquarters
Ask About
Advertising
Friends
MODS Reloaded
Canada Kicks Ass Clan
Great Gamer
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 154
MODSonair Episode 153
MODSonair Episode 152
MODSonair Episode 151
Video server move
Next Show
The next MODSonair show will air LIVE on:
11/23/2008 12:00 EST

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