Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 6 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

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: CoD4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Previous Page
subscribe
Author Topic: I would like to put a touch activated mp3 into my map.
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD4 Scripting
Posted: Monday, Mar. 5, 2012 09:59 am
now that's something different...

Code:
main()
{
	thread radio();
	thread generator();
}

radio()
{
	radio = getent("radio", "targetname");
	trig = getent("radiotrig", "targetname");
	trig thread playsound_thread(radio, "talk_01", 36);
}

generator()
{
	generator = getent("generator", "targetname");
	trig = getent("generatortrig", "targetname");
	trig thread playsound_thread(generator, "run_01", 3);
}

playsound_thread(entity, soundalias, waittime)
{
	while (1)
	{
		self waittill("trigger");

		if (isdefined(entity.soundtrig_wait) && entity.soundtrig_wait)
		{
			wait (0.05);
			continue;
		} else {
			entity thread playsound_wait(soundalias, waittime);
			wait (0.05);
		}
	}
}

playsound_wait(soundalias, waittime)
{
	// might need to add this:
	// self = spawnstruct();
	self.soundtrig_wait = 1;
	self playsound(soundalias);
	wait (waittime);
	self.soundtrig_wait = 0;
}
Share |
Harpattack
General Member
Since: Aug 14, 2007
Posts: 32
Last: Mar 24, 2012
[view latest posts]
Level 2
Category: CoD4 Scripting
Posted: Tuesday, Mar. 6, 2012 04:42 am
Nothing works, I have tried script origins, script brush models multiple triggers Nothing works. I am not a scripter but a map maker Man is this stuff Hard. I will please start over. I have a juke box hanging on the wall when a player passes it the use hand comes up, the player presses it and the .wav starts. Is that possible? If their is a tutorial for this Please Help! Or I can send you my map if its easier. I would prefer the First option so I can do it again. Thanks so Much.

edited on Mar. 5, 2012 10:01 pm by Harpattack

I also tried to use misc_model_com_transister_radio and it wouldnt let me make it a script model.
Share |
Harpattack
General Member
Since: Aug 14, 2007
Posts: 32
Last: Mar 24, 2012
[view latest posts]
Level 2
Category: CoD4 Scripting
Posted: Wednesday, Mar. 7, 2012 12:53 pm
Thanks Sevenz I sent you a PM with a link to download the map and the prefabs and stuff.
Share |
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD4 Scripting
Posted: Wednesday, Mar. 7, 2012 07:04 pm
this is what i got:

http://de.xfire.com/video/552e21/

it uses dist_min and dist_max. It's pretty much limited to the room, but also hearable on the 2nd floor (see video)
Share |
Harpattack
General Member
Since: Aug 14, 2007
Posts: 32
Last: Mar 24, 2012
[view latest posts]
Level 2
Category: CoD4 Scripting
Posted: Wednesday, Mar. 7, 2012 08:11 pm
How the hell did you jump through walls!
Take that .iwd file and place it into programfiles/activision/cod4mw/main
I also make a folder in my usermaps
mp_boomboomboom and place the .ff files from programfiles/activision/cod4mw/zone/english and .iwd I sent you into their and run the maps no problem.

If I want to test with a mod I open up the folder from the main cod4mw folder and place a copy from my usermaps.
Share |
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD4 Scripting
Posted: Wednesday, Mar. 7, 2012 09:03 pm
Harpattack writes...
Quote:
How the hell did you jump through walls!

/ufo
or
/noclip

ufo will move along world axis, noclip depends on your view direction

works in dev mode only, otherwise cheat-protected

usermaps dir sounds like a proper solution
Share |
Restricted Access Topic is Locked
Page
Previous Page
subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»