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

Members Online

»
0 Active | 52 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: trigger dont work
ukdjaj
General Member
Since: Jun 1, 2008
Posts: 2726
Last: Nov 15, 2020
[view latest posts]
Level 9
Category: CoD2 Scripting
Posted: Sunday, Dec. 13, 2009 07:38 pm
I Have my a map and in the floor there is a botton which u press it raise up 2 little squares then goes across, it does that fine but it is not letting the trigger open it. so when i start the map it already doing that like it isn't listen to the trigger

i have done it as a thread in mymap.gsc but i it works so i think its just somthing to do with the work its being called up?
Code:

main()
{
	maps\mp\_load::main();
        thread traindoor_traindoor(); 
        thread traindoor_traindoor1(); 
		
	game["allies"] = "british";
	game["axis"] = "german";

	game["british_soldiertype"] = "commando";
	game["british_soldiervariation"] = "normal";
	game["german_soldiertype"] = "wehrmacht";
	game["german_soldiervariation"] = "normal";

	game["attackers"] = "allies";
	game["defenders"] = "axis";
}

traindoor_traindoor()
{
door=getent("traindoor","targetname");
wait (20);
trig=getent("trigger_traindoor","targetname");
while(1)
{
trig waittill ("trigger");
door movez (2,1,0.5,0.5);
door waittill ("movedone");
wait (1);
door movex (-36,1,0.5,0.5);
door waittill ("movedone");
wait (5);
door movex (36,1,0.5,0.5);
door waittill ("movedone");
wait (1);
door movez (-2,1,0.5,0.5);
door waittill ("movedone");

}
}


traindoor_traindoor1()
{
door=getent("traindoor1","targetname");
wait (20);
trig=getent("trigger_traindoor","targetname");
while(1)
{
trig waittill ("trigger");
door movez (2,1,0.5,0.5);
door waittill ("movedone");
wait (1);
door movex (36,1,0.5,0.5);
door waittill ("movedone");
wait (5);
door movex (-36,1,0.5,0.5);
door waittill ("movedone");
wait (1);
door movez (-2,1,0.5,0.5);
door waittill ("movedone");

}
}
Share |
COD4GRC
General Member
Since: Aug 12, 2007
Posts: 44
Last: Jan 30, 2010
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Sunday, Dec. 13, 2009 08:15 pm
Your code seems fine.
Could you try to post if this function returns "1" (true)

Code:
iprintlnbold(isdefined(getent("trigger_traindoor","targetname"));


(The function waittill("trigger"); may being skipped if the trigger is not defined)


edited on Dec. 13, 2009 03:15 pm by COD4GRC
Share |
liltc64
General Member
Since: Feb 12, 2007
Posts: 906
Last: Oct 22, 2012
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Sunday, Dec. 13, 2009 08:15 pm
it means u dont have a trigger on ur map so its just gona run no matter what, try checking ur spelling and if ur spelling is fine then delete the current trigger u have and make another just like it and recompile, u can also try this to prove if there is a trigger on the map.

Code:
traindoor_traindoor()
{
door=getent("traindoor","targetname");
wait (20);
trig=getent("trigger_traindoor","targetname");

   if(!isdefined(trig))
   {
      iprintln("^3Cannot Find trig");
   }
   
while(1)
{
trig waittill ("trigger");
door movez (2,1,0.5,0.5);
door waittill ("movedone");
wait (1);
door movex (-36,1,0.5,0.5);
door waittill ("movedone");
wait (5);
door movex (36,1,0.5,0.5);
door waittill ("movedone");
wait (1);
door movez (-2,1,0.5,0.5);
door waittill ("movedone");

}
}


traindoor_traindoor1()
{
door=getent("traindoor1","targetname");
wait (20);
trig=getent("trigger_traindoor","targetname");

   if(!isdefined(trig))
   {
      iprintln("^3Cannot Find trig");
   }
   
while(1)
{
trig waittill ("trigger");
door movez (2,1,0.5,0.5);
door waittill ("movedone");
wait (1);
door movex (36,1,0.5,0.5);
door waittill ("movedone");
wait (5);
door movex (-36,1,0.5,0.5);
door waittill ("movedone");
wait (1);
door movez (-2,1,0.5,0.5);
door waittill ("movedone");

}
}
Share |
COD4GRC
General Member
Since: Aug 12, 2007
Posts: 44
Last: Jan 30, 2010
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Sunday, Dec. 13, 2009 08:17 pm
liltc64 has the same idea, use that one :)
Share |
ellard8
General Member
Since: Aug 25, 2008
Posts: 80
Last: Oct 17, 2016
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Sunday, Dec. 13, 2009 08:20 pm
yeah i thoguht there was somethign wrong with the trigger, but i copied the name on it in radiant to the .gsc file so there caqn not be anything wrong with it thats what i dont get
Share |
ellard8
General Member
Since: Aug 25, 2008
Posts: 80
Last: Oct 17, 2016
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Sunday, Dec. 13, 2009 08:23 pm
btw this my other modsonline acc

i had 2 triggers so i deleted one and just about to compile map to see if that is problem
Share |
COD4GRC
General Member
Since: Aug 12, 2007
Posts: 44
Last: Jan 30, 2010
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Sunday, Dec. 13, 2009 08:23 pm
check if the trigger's classname is a "trigger_multiple" (instead of a classname "trigger_once")
Share |
ellard8
General Member
Since: Aug 25, 2008
Posts: 80
Last: Oct 17, 2016
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Sunday, Dec. 13, 2009 09:24 pm
works now i deleted both triggers, and do a right click and choosen trigger -> once and it works then i must of typed in the classname before thanks guys =)
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

»