Will this work?

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

Moderator: Core Staff

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

Re: Will this work?

Post by Lawless » April 24th, 2011, 12:25 am

megazor wrote:try this and tell us what it says

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 = false;
   	self.doormodel = getent(self.target, "targetname");
   	if (isDefined(self.doormodel))
		iprintln("model defined");

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

door_move()
{
  	self maps\mp\_utility::triggerOff();
   	self.doormoving = true;
  	if (isDefined(self.count))
		iprintln("rotating");
   	self.doormodel rotateyaw(self.count, 2, .5, .5);
   	self.doormodel waittill("rotatedone");
   	wait 60;
   	self.doormodel rotateyaw((self.count * -1), 2, .5, .5);
   	self.doormodel waittill("rotatedone");
   	self maps\mp\_utility::triggerOn();
   	self.doormoving = false;
}
Didn't work ='[
Join my server @ 217.163.22.223:28960

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

Re: Will this work?

Post by Lawless » April 24th, 2011, 12:26 am

Drofder2004 wrote:
megazor wrote:he said it was defined in radiant:

key = count
value = 90
Didn't see that.

for the sake of testing, I would enter a value in the script and NOT in radiant.
Where would i enter this in the script?
Join my server @ 217.163.22.223:28960

User avatar
iCYsoldier
CJ Worshipper
CJ Worshipper
Posts: 289
Joined: December 5th, 2009, 7:12 am
Location: Australia

Re: Will this work?

Post by iCYsoldier » April 24th, 2011, 2:22 am

Lawless wrote:Where would i enter this in the script?
Where you see 'self.count', replace it with 90:

Code: Select all

door_move()
{
    self maps\mp\_utility::triggerOff();
    self.doormoving = true;
    self.doormodel rotateyaw(90, 2, .5, .5);
    self.doormodel waittill("rotatedone");
    wait 60;
    self.doormodel rotateyaw((90 * -1), 2, .5, .5);
    self.doormodel waittill("rotatedone");
    self maps\mp\_utility::triggerOn();
    self.doormoving = false;
}

IzNoGoD
CJ Worshipper
CJ Worshipper
Posts: 343
Joined: January 6th, 2009, 8:39 pm
Location: Netherlands/Holland

Re: Will this work?

Post by IzNoGoD » April 24th, 2011, 9:26 am

Seems to me you have a door and a trigger, and are trying trigger commands on your door.
They dont work then.
LMGTFY!

Its not a glitch... Its the future!

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Will this work?

Post by Drofder2004 » April 24th, 2011, 11:29 pm

IzNoGoD wrote:Seems to me you have a door and a trigger, and are trying trigger commands on your door.
They dont work then.

Code: Select all

self_closing_doors()
{
   	doors = getentarray("bounce_trig", "targetname");
   	for(i = 0; i < doors.size; i++)
      		doors[i] thread door_think();
}
From that line of code, I would assume door is actually a trigger. and self.doormodel is an entity, representing a door.

Although, honestly, I do not like the fact the door entity is a variable attached to the trigger. I would (at least while testing) make these two independant variables [door and trig].
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests