Help me with Map Scripting plz

Have questions about CoD4 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
Lawless
CJ Fan
CJ Fan
Posts: 110
Joined: January 25th, 2011, 7:11 pm
Gamertag: x STRAF3Zz v2

Help me with Map Scripting plz

Post by Lawless » March 28th, 2011, 10:55 pm

Ok so I am trying to make a trigger to swing a bounce on an origion out through a wall when I press use.
I have it all set up but my bounce or brush does not swing around its origion please help here is my script

Code: Select all

main()
{
	thread self_closing_doors();
}
self_closing_doors()
{
	doors = getentarray("bounce_trig","targetname");
	for(i=0; i<doors.size; i++)
	{
		doors[i] thread door_think();
	}
}
door_think()
{
	self.doormoving = true;
	self.doormodel = getent(self.target, "targetname");

	while(1)
	{
		self waittill("trigger");
		if(!self.doormoving)
		{	
			self thread door_move();
		}
	}
}
door_move()
{
	self maps\mp\_utility::triggerOff();
	self.doormoving = true;
	self.doormodel rotateyaw(self.count, 2, 0.5, 0.5);
	self.doormodel waittill("rotatedone");
	wait (60);
	self.doormodel rotateyaw((self.count * -1), 2, 0.5, 0.5);
	self.doormodel waittill("rotatedone");
	self maps\mp\_utility::triggerOn();
	self.doormoving = false;
}
I got that script off modsonline.com and didnt edit it.

My script is called _bounce_trig.cfg.
My trigger is calledbounce_trig.
My triggers target is auto1.
My triggers count is 90 just to test the swing.
My origion and brush are called auto1.
My origion and brush are connected by script_brushmodel.
My brush and trigger are connected by w [weld blue line].
Join my server @ 217.163.22.223:28960

megazor
CJ Worshipper
CJ Worshipper
Posts: 414
Joined: July 22nd, 2009, 3:02 am
Location: Russia, Vladivostok

Re: Help me with Map Scripting plz

Post by megazor » March 29th, 2011, 4:14 am

Code: Select all

door_think()
{
   self.doormoving = false; //the only string that wanted editing :-)
   self.doormodel = getent(self.target, "targetname");

   while(1)
   {
      self waittill("trigger");
      if(!self.doormoving)
      {   
         self thread door_move();
      }
   }
}

megazor
CJ Worshipper
CJ Worshipper
Posts: 414
Joined: July 22nd, 2009, 3:02 am
Location: Russia, Vladivostok

Re: Help me with Map Scripting plz

Post by megazor » March 29th, 2011, 4:18 am

My script is called _bounce_trig.cfg
huh, isnt it to be a .gsc file, is it?

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: Help me with Map Scripting plz

Post by Rezil » March 29th, 2011, 5:29 am

This should be in a .gsc, not a .cfg. Also, if you're only using it for one 'door', you don't need to make an array out of all them.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

Lawless
CJ Fan
CJ Fan
Posts: 110
Joined: January 25th, 2011, 7:11 pm
Gamertag: x STRAF3Zz v2

Re: Help me with Map Scripting plz

Post by Lawless » March 29th, 2011, 6:54 pm

Rezil wrote:This should be in a .gsc, not a .cfg. Also, if you're only using it for one 'door', you don't need to make an array out of all them.
Sorry that was a mistake it is a gsc and i am only using for one door or brush...
And I dont get the end cause i only have one.
Join my server @ 217.163.22.223:28960

megazor
CJ Worshipper
CJ Worshipper
Posts: 414
Joined: July 22nd, 2009, 3:02 am
Location: Russia, Vladivostok

Re: Help me with Map Scripting plz

Post by megazor » March 30th, 2011, 2:00 am

Code: Select all

main()
{
   	getEnt("bounce_trig","targetname") thread door_think();
}

door_think()
{
   	door = getEnt(self.target, "targetname");

   	while(1)
   	{
      		self waittill("trigger");
      		door rotateYaw(self.count, 2, .5, .5);
   		door waittill("rotatedone");
   		wait 5;
   		door rotateYaw((self.count * -1), 2, .5, .5);
   		door waittill("rotatedone");
	}
}

Lawless
CJ Fan
CJ Fan
Posts: 110
Joined: January 25th, 2011, 7:11 pm
Gamertag: x STRAF3Zz v2

Re: Help me with Map Scripting plz

Post by Lawless » March 30th, 2011, 5:30 pm

Is that a complete new script or do I need to add the other parts to it?
Join my server @ 217.163.22.223:28960

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: Help me with Map Scripting plz

Post by Rezil » March 30th, 2011, 7:55 pm

Just save it as yourmapname.gsc.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

Lawless
CJ Fan
CJ Fan
Posts: 110
Joined: January 25th, 2011, 7:11 pm
Gamertag: x STRAF3Zz v2

Re: Help me with Map Scripting plz

Post by Lawless » March 30th, 2011, 10:44 pm

Rezil wrote:Just save it as yourmapname.gsc.
I aready have a mp_lawless_v2.gsc to direct the map to my script...
I have just found out by testing a teleporter script that all of my scripts arent working wtf HELP?????????
Join my server @ 217.163.22.223:28960

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: Help me with Map Scripting plz

Post by Rezil » March 30th, 2011, 10:49 pm

Then name it anything and 'direct' it from your main map script.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

Lawless
CJ Fan
CJ Fan
Posts: 110
Joined: January 25th, 2011, 7:11 pm
Gamertag: x STRAF3Zz v2

Re: Help me with Map Scripting plz

Post by Lawless » March 31st, 2011, 12:05 am

Rezil wrote:Then name it anything and 'direct' it from your main map script.
Lol wtf its already named _bounce_trig.gsc and i directed it from mp_lawless_v2.gsc and thats my main map script.
Also thats not the problen the problem is with either my Laptop, CoD4 or CoD4 Radiant!...
Join my server @ 217.163.22.223:28960

megazor
CJ Worshipper
CJ Worshipper
Posts: 414
Joined: July 22nd, 2009, 3:02 am
Location: Russia, Vladivostok

Re: Help me with Map Scripting plz

Post by megazor » March 31st, 2011, 12:49 am

laptop, lol :-)

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests