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

Members Online

»
0 Active | 15 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 4
Category: CoD4 SP Mapping
CoD 4 mapping and level design for single player.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: door
tschiggen
General Member
Since: Oct 19, 2010
Posts: 122
Last: Feb 16, 2012
[view latest posts]
Level 4
Category: CoD4 SP Mapping
Posted: Tuesday, Oct. 19, 2010 10:16 am
first I want to say sorry for my english. Im german.

So here my question:
I made a useable door ( like in the TUT-section). But the AI dont move into the next room. It seems like the Brushmodel cuts the pathnode way.

pls Help
Share |
Mystic
General Member
Since: Apr 10, 2004
Posts: 6147
Last: Apr 15, 2018
[view latest posts]
Level 10
Forum Moderator
Im a fan of MODSonair
Category: CoD4 SP Mapping
Posted: Tuesday, Oct. 19, 2010 11:13 am
Does your AI have a reason to go through the door? such as a target node for example.
Share |
tschiggen
General Member
Since: Oct 19, 2010
Posts: 122
Last: Feb 16, 2012
[view latest posts]
Level 4
Category: CoD4 SP Mapping
Posted: Tuesday, Oct. 19, 2010 11:30 am
Yes. He´s colorgroup red. so i trigger the trigger and he doesnt move. I checked it 5 or 6 times.
Share |
FattalError
General Member
Since: May 4, 2009
Posts: 26
Last: Feb 16, 2011
[view latest posts]
Level 2
Category: CoD4 SP Mapping
Posted: Tuesday, Oct. 19, 2010 11:47 am
Try this:
Code:
door connectpaths();
Share |
tschiggen
General Member
Since: Oct 19, 2010
Posts: 122
Last: Feb 16, 2012
[view latest posts]
Level 4
Category: CoD4 SP Mapping
Posted: Tuesday, Oct. 19, 2010 12:18 pm
is it get or become an error message?

whatever if I put it in my script i get/become the errormessage


bad syntax
door connectpaths();



help pls
Share |
FattalError
General Member
Since: May 4, 2009
Posts: 26
Last: Feb 16, 2011
[view latest posts]
Level 2
Category: CoD4 SP Mapping
Posted: Tuesday, Oct. 19, 2010 02:35 pm
This function is correct, problem isn't here. Have you in script door=getent(".....","targetname"); or is it array?
If is it array, it must look diferently:
Code:
doors = getentarray("......","targetname");
for (i=0 ; i < doors.size; i++)
{
doors[i] connectpaths();
}

And yes, script_brushmodel cuts pathnodes way. For check it, you must use this line in CompileTools:
Code:
+ai_shownodes 1 +ai_shownearestnode 64  +g_entinfo 1 +ai_showpaths 1
Share |
tschiggen
General Member
Since: Oct 19, 2010
Posts: 122
Last: Feb 16, 2012
[view latest posts]
Level 4
Category: CoD4 SP Mapping
Posted: Tuesday, Oct. 19, 2010 03:03 pm
this script is array.

but It doesnt work!

My script:
main()
{

doortriggers = getentarray("doortrig","targetname");
for(i = 0; i < doortriggers.size; i++)
doortriggers thread door_think();
door connectpaths();
}
door_think()
{
self.doormoving = false;
self.doorclosed = true;
self.doormodel = getent(self.target, "targetname");

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

door_move()
{
self.doormoving = true;
if(self.doorclosed)
{
self.doormodel rotateyaw(-90,1,0.5,0.5);
self.doormodel waittill("rotatedone");
self.doorclosed = false;

}
else
{
self.doormodel rotateyaw(90,1,0.5,0.5);
self.doormodel waittill("rotatedone");
self.doorclosed = true;
}
self.doormoving = false;
}
Share |
FattalError
General Member
Since: May 4, 2009
Posts: 26
Last: Feb 16, 2011
[view latest posts]
Level 2
Category: CoD4 SP Mapping
Posted: Tuesday, Oct. 19, 2010 03:28 pm
It can't be function, you haven't defined door!
Write this into main() thread: (and delete row door connectpaths();)
Code:
doors = getentarray("name of your doors brushmodels","targetname");
for (i=0 ; i < doors.size; i++)
{
doors[i] connectpaths();
}
Share |
tschiggen
General Member
Since: Oct 19, 2010
Posts: 122
Last: Feb 16, 2012
[view latest posts]
Level 4
Category: CoD4 SP Mapping
Posted: Tuesday, Oct. 19, 2010 04:53 pm
I think i´m too stupid. If i want to use the door now, it says there is an undefined field object.



main()
{
doors = getentarray("door","targetname");
for (i=0 ; i < doors.size; i++)
{
doors connectpaths();
}


doortriggers = getentarray("doortrig","targetname");
for(i = 0; i < doortriggers.size; i++)
doortriggers thread door_think();

}
door_think()
{
self.doormoving = false;
self.doorclosed = true;
self.doormodel = getent(self.target, "targetname");

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

door_move()
{
self.doormoving = true;
if(self.doorclosed)
{
self.doormodel rotateyaw(-90,1,0.5,0.5);
self.doormodel waittill("rotatedone");
self.doorclosed = false;

}
else
{
self.doormodel rotateyaw(90,1,0.5,0.5);
self.doormodel waittill("rotatedone");
self.doorclosed = true;
}
self.doormoving = false;
}
Share |
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 1293
Last: Jul 9, 2016
[view latest posts]
Level 8
Category: CoD4 SP Mapping
Posted: Wednesday, Oct. 20, 2010 01:01 am
He is saying to do this.
Code:
main()
{
	doortriggers = getentarray("doortrig","targetname");
	for(i = 0; i < doortriggers.size; i++)
	doortriggers[i] connectpaths();
	doortriggers thread door_think();
}
door_think()
{
	self.doormoving = false;
	self.doorclosed = true;
	self.doormodel = getent(self.target, "targetname");

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

door_move()
{
	self.doormoving = true;
	if (self.doorclosed)
	{
		self.doormodel rotateyaw(-90,1,0.5,0.5);
		self.doormodel waittill("rotatedone");
		self.doorclosed = false;
	}
	else
	{
		self.doormodel rotateyaw(90,1,0.5,0.5);
		self.doormodel waittill("rotatedone");
		self.doorclosed = true;
	}
	self.doormoving = false;
}


He made it harder to understand by not using your original script.
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 SP Mapping

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

»