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

Members Online

»
0 Active | 115 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

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 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Triggering a laser grid security system.
zebrahdh
General Member
Since: Apr 18, 2008
Posts: 10
Last: May 15, 2008
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Monday, Apr. 21, 2008 10:48 pm


The image above in my testing map is a quicky of a laser system I am trying to get working in a more realistic way.

Here is the code so far:
Code:
laserbeams()
{
	showbeams = getent("beams", "targetname");
	while(1)
	{
		showbeams hide();
		beamson = getent("beamswitch", "targetname");
		while(1)
		{
		beamson waittill("trigger");
		showbeams show();
		beamson waittill("trigger");
		thread laserbeams();
		}
	}
}


I have a few problems just because of my lack of understanding of the scripting and established functions.

hide() appears to only hide textures and not the actual entity, ideally I would like have the "beams" toggled in and out of the area they cover. The way they are now, on or off, you still can walk right into them. Maybe the is a remove() or something like that? I would need to know the commands for both on and off. That would be a big help.

In my example, I have solid red beams than are surrounded by trigger_hurt, so when you walk into a beam, you die. The current set up allows you to turn on the beams, so you can see them, hence avoid them. So red beams visible or not, you still die if you walk into the trigger_hurt.

I would like to know if there is a way to trigger a trigger. Or I guess toggle a trigger on and off with another trigger. I am getting a bit out of my scripting comfort zone on this concept and I havent come across anything helpful in tutorials around the net.

And finally how can I make the beams so you are able to walk thru them. I assume it has to do with a usage texure but I had no luck on guessing and testing. It's less important than the other issues, but I would rather not have a dead guy laying across what is supposed to be a laser beam.

To recap:
I want a trigger_use to turn on and off a script-brushmodel(not just hide and show).
I want a trigger_use to make a trigger_hurt active and inacvtive.
I want to be able to walk thru the script-brushmodel (even through its going to kill you).

I've been trying alot of different things. I also had some alternative ideas that I have no idea where to begin scripting if its possible:
Resizing a script-brushmodel and trigger_hurt with a trigger_use?
Can I put a visible texture on a trigger_hurt somehow?
Can I link a script-brush and a trigger hurt together?

Any advice would be helpful, redirects to tutorials may not be as helpful considering I've gone through most of them already. But if you think one will help me, please point it out.

Thanks,
lots of bullets (cod2)
Share |
zebrahdh
General Member
Since: Apr 18, 2008
Posts: 10
Last: May 15, 2008
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Tuesday, Apr. 22, 2008 05:45 am
I have not tested it yet but I believe I have found the function I am looking for to make the beams noncolidable.

notsolid();
Share |
zebrahdh
General Member
Since: Apr 18, 2008
Posts: 10
Last: May 15, 2008
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Tuesday, Apr. 22, 2008 08:03 am
I managed to get a decent version of what I wanted.

Video



It will only turn off, and not on again because of the delete() command so to revise my original question... Is there anyway to toggle delete() or use a different command with trigger_hurt here?
Code:
laserbeams()
{
	beams = getent("beam", "targetname"); //script brushmodel
	offswitch = getent("off", "targetname"); //target_use
	lasers = getent("laser", "targetname"); //target_hurt	
	
	beams notsolid();
	while(1)
	{
		offswitch waittill("trigger");
		beams hide();
		wait(.1);
		beams show();
		wait(.1);
		beams hide();
		wait(.1);
		beams show();
		wait(.1);
		beams delete();
		lasers delete();
		offswitch delete();
	}
}

BTW This is for a MP map.

Thanks :)

edited on Apr. 22, 2008 04:04 am by zebrahdh

edited on Apr. 22, 2008 04:05 am by zebrahdh

edited on Apr. 22, 2008 04:07 am by zebrahdh
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 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

»