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

Members Online

»
0 Active | 10 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 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
Page
Next Page
subscribe
Author Topic: hiding a trigger error
ukdjaj
General Member
Since: Jun 1, 2008
Posts: 2726
Last: Nov 15, 2020
[view latest posts]
Level 9
Category: CoD2 Scripting
Posted: Saturday, Aug. 14, 2010 02:09 pm
right i have this script, works fine but i tell the trigger to hide but it doesn't? any ideas why it isnt working?
Code:
main()
{
	thread part1();
	thread part2();
	thread part3();
	thread part4();
}

part1()
{
	plank1 = getent("plank1","targetname");
	trig1 = getent("trig_p1_d","targetname");
	trig = getent("trig_use","targetname");	
	trig hide();
	while(1)
	{
		trig1 waittill ("trigger");
		plank1 hide();
		plank1 notsolid();
		wait 10;
		trig show();
		trig waittill ("trigger");
		plank1 solid();
		plank1 show();
		trig hide();
	}
}
part2()
{
	plank2 = getent("plank2","targetname");
	trig2 = getent("trig_p2_d","targetname");
	trig = getent("trig_use","targetname");	
	trig hide();
	while(1)
	{
		trig2 waittill ("trigger");
		plank2 hide();
		plank2 notsolid();
		wait 10;
		trig show();
		trig waittill ("trigger");
		plank2 solid();
		plank2 show();
		trig hide();
	}
}

part3()
{
	plank3 = getent("plank3","targetname");
	trig3 = getent("trig_p3_d","targetname");
	trig = getent("trig_use","targetname");	
	trig hide();
	while(1)
	{
		trig3 waittill ("trigger");
		plank3 hide();
		plank3 notsolid();
		wait 10;
		trig show();
		trig waittill ("trigger");
		plank3 solid();
		plank3 show();
		trig hide();
	}
}

part4()
{
	plank4 = getent("plank4","targetname");
	trig4 = getent("trig_p4_d","targetname");
	trig = getent("trig_use","targetname");	
	trig hide();
	while(1)
	{
		trig4 waittill ("trigger");
		plank4 hide();
		plank4 notsolid();
		wait 10;
		trig show();
		trig waittill ("trigger");
		plank4 solid();
		plank4 show();
		trig hide();
		thread part1();
	}
}
Share |
Tristan4592
General Member
Since: Apr 26, 2007
Posts: 235
Last: Nov 11, 2010
[view latest posts]
Level 4
MODSCON
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Saturday, Aug. 14, 2010 03:05 pm
Does hide actually work with triggers? I never tried that. Maybe see if there are functions to enable / disable a trigger?
Share |
-CoDMapper
General Member
Since: Nov 29, 2009
Posts: 83
Last: Oct 23, 2011
[view latest posts]
Level 3
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Saturday, Aug. 14, 2010 03:23 pm
For triggers use

disable_trigger();

instead of

hide();

and

enable_trigger();

instead of

show();

Share |
ukdjaj
General Member
Since: Jun 1, 2008
Posts: 2726
Last: Nov 15, 2020
[view latest posts]
Level 9
Category: CoD2 Scripting
Posted: Saturday, Aug. 14, 2010 03:50 pm
ok tyvm will try now =)
Share |
ukdjaj
General Member
Since: Jun 1, 2008
Posts: 2726
Last: Nov 15, 2020
[view latest posts]
Level 9
Category: CoD2 Scripting
Posted: Saturday, Aug. 14, 2010 03:57 pm
Um.. i put "disable_trigger" and "enable_trigger", it didn't work. so i thought ah.. its because i haven't defined "trigger" so i replaced it with "trig" and i still get a unknown function error, anyone?

Code:
main()
{
	thread part1();
	thread part2();
	thread part3();
	thread part4();
}

part1()
{
	plank1 = getent("plank1","targetname");
	trig1 = getent("trig_p1_d","targetname");
	trig = getent("trig_use","targetname");	
	disable_trig();
	while(1)
	{
		trig1 waittill ("trigger");
		plank1 hide();
		plank1 notsolid();
		wait 10;
		enable_trig();
		trig waittill ("trigger");
		plank1 solid();
		plank1 show();
		disable_trig();
	}
}
part2()
{
	plank2 = getent("plank2","targetname");
	trig2 = getent("trig_p2_d","targetname");
	trig = getent("trig_use","targetname");	
	disable_trig();
	while(1)
	{
		trig2 waittill ("trigger");
		plank2 hide();
		plank2 notsolid();
		wait 10;
		enable_trig();
		trig waittill ("trigger");
		plank2 solid();
		plank2 show();
		disable_trig();
	}
}

part3()
{
	plank3 = getent("plank3","targetname");
	trig3 = getent("trig_p3_d","targetname");
	trig = getent("trig_use","targetname");	
	disable_trig();
	while(1)
	{
		trig3 waittill ("trigger");
		plank3 hide();
		plank3 notsolid();
		wait 10;
		enable_trig();
		trig waittill ("trigger");
		plank3 solid();
		plank3 show();
		disable_trig();
	}
}

part4()
{
	plank4 = getent("plank4","targetname");
	trig4 = getent("trig_p4_d","targetname");
	trig = getent("trig_use","targetname");	
	disable_trig();
	while(1)
	{
		trig4 waittill ("trigger");
		plank4 hide();
		plank4 notsolid();
		wait 10;
		enable_trig();
		trig waittill ("trigger");
		plank4 solid();
		plank4 show();
		disable_trig();
		thread part1();
	}
}
Share |
-CoDMapper
General Member
Since: Nov 29, 2009
Posts: 83
Last: Oct 23, 2011
[view latest posts]
Level 3
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Saturday, Aug. 14, 2010 05:14 pm
You just put disable_trigger(); you need to define what trigger you are disabling

trig disable_trigger();
Share |
ukdjaj
General Member
Since: Jun 1, 2008
Posts: 2726
Last: Nov 15, 2020
[view latest posts]
Level 9
Category: CoD2 Scripting
Posted: Saturday, Aug. 14, 2010 05:16 pm
lol thanks will try now, i have been going htrough about a hour fo doing

trig disable ();
disable trig();
trigger disable();
ect.. lol =)
Share |
ukdjaj
General Member
Since: Jun 1, 2008
Posts: 2726
Last: Nov 15, 2020
[view latest posts]
Level 9
Category: CoD2 Scripting
Posted: Saturday, Aug. 14, 2010 05:19 pm
no still comes up with unknown function error i only used it once so i know it wasnt anything else, are you sure this is a cod2 command?

edited on Aug. 14, 2010 01:20 pm by ukdjaj
Code:

main()
{
	thread part1();
	thread part2();
	thread part3();
	thread part4();
}

part1()
{
	plank1 = getent("plank1","targetname");
	trig1 = getent("trig_p1_d","targetname");
	trig = getent("trig_use","targetname");	
	trig disable_trigger();
	while(1)
	{
		trig1 waittill ("trigger");
		plank1 hide();
		plank1 notsolid();
		wait 10;
		trig waittill ("trigger");
		plank1 solid();
		plank1 show();
	}
}
part2()
{
	plank2 = getent("plank2","targetname");
	trig2 = getent("trig_p2_d","targetname");
	trig = getent("trig_use","targetname");	
	while(1)
	{
		trig2 waittill ("trigger");
		plank2 hide();
		plank2 notsolid();
		wait 10;
		trig waittill ("trigger");
		plank2 solid();
		plank2 show();
	}
}

part3()
{
	plank3 = getent("plank3","targetname");
	trig3 = getent("trig_p3_d","targetname");
	trig = getent("trig_use","targetname");	
	while(1)
	{
		trig3 waittill ("trigger");
		plank3 hide();
		plank3 notsolid();
		wait 10;
		trig waittill ("trigger");
		plank3 solid();
		plank3 show();
	}
}

part4()
{
	plank4 = getent("plank4","targetname");
	trig4 = getent("trig_p4_d","targetname");
	trig = getent("trig_use","targetname");	
	while(1)
	{
		trig4 waittill ("trigger");
		plank4 hide();
		plank4 notsolid();
		wait 10;
		trig waittill ("trigger");
		plank4 solid();
		plank4 show();
		thread part1();
	}
}
Share |
3st0nian
General Member
Since: Jan 14, 2008
Posts: 291
Last: Dec 4, 2017
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Saturday, Aug. 14, 2010 08:06 pm
Try
trig triggerOff();
and
trig triggerOn();
Share |
ukdjaj
General Member
Since: Jun 1, 2008
Posts: 2726
Last: Nov 15, 2020
[view latest posts]
Level 9
Category: CoD2 Scripting
Posted: Saturday, Aug. 14, 2010 09:50 pm
will try now =)
Share |
Restricted Access Topic is Locked
Page
Next Page
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

»