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

Members Online

»
0 Active | 98 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
Page
Next Page
subscribe
Author Topic: Botzom Mapping
csocsi96
General Member
Since: Aug 9, 2010
Posts: 75
Last: Aug 24, 2014
[view latest posts]
Level 3
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Saturday, Sep. 29, 2012 06:24 pm
Hello,

I made a map for a Bot Zombie mod. As we know, in the mod the zombies are using DM spawns to spawn :D, and the players are using tdm spawns to spawn.

I put tdm and dm spawns into my map as well, the zombies are spawning properly, but as they spawned the server instantly shuts down. I know that i need to put something else into the map. Anybody knows what am i missing or doing wrong? What are the things that a botzom map MUST contain? I have global intermission info player start and a lot of dm and tdm spawns.

Regards.
Share |
Tally
General Member
Since: Apr 21, 2005
Posts: 819
Last: Oct 26, 2012
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Saturday, Sep. 29, 2012 08:07 pm
csocsi96 writes...
Quote:
Hello,

I made a map for a Bot Zombie mod. As we know, in the mod the zombies are using DM spawns to spawn :D, and the players are using tdm spawns to spawn.

I put tdm and dm spawns into my map as well, the zombies are spawning properly, but as they spawned the server instantly shuts down. I know that i need to put something else into the map. Anybody knows what am i missing or doing wrong? What are the things that a botzom map MUST contain? I have global intermission info player start and a lot of dm and tdm spawns.

Regards.


It will be impossible to know what the problem is without an error message. Enable logfile:

set logfile 2

That will generate a file named console_mp.log. It will either be in your main folder if you don't use an fs_game directory for your mod, or in your mod's fs_game folder. Open it with a text editor, and search for the error.

I suspect it will be "g_SPAWN: no free entities", which will be that you have too many spawns, and the game can't spawn anything else, so is crashing out. But that is just a best guess. I need an actual error to know for sure.
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Saturday, Sep. 29, 2012 08:24 pm
I am assuming that the waypoints are not present in his map. This causes an array undefined error, wich, with developer enabled, should result in a crash. Without developer, well, there is no real telling what it would do.
Share |
csocsi96
General Member
Since: Aug 9, 2010
Posts: 75
Last: Aug 24, 2014
[view latest posts]
Level 3
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Saturday, Sep. 29, 2012 09:22 pm
I will use logfiles in the future, and yes i think that too the error was bcoz of the waypoints. I put some script_origins into the map with the targetname: node. (bcoz its in the script). Now the bot zombies spawn, but they move like someone who has 1 fps. I mean: they move forward 1 meter, and wait 5 second, and move forward again (towards me)

PS.: I did what Tally said about logging but i have no logfiles. I guess everything working fine? And i could kill only one zombie, the others are immune to my bullets.
edited on Sep. 29, 2012 02:35 pm by csocsi96
Share |
csocsi96
General Member
Since: Aug 9, 2010
Posts: 75
Last: Aug 24, 2014
[view latest posts]
Level 3
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Saturday, Sep. 29, 2012 09:41 pm
Should I post the part of the script which is responsible for spawning zombies and moving them? + The getent thingy about entities?
Share |
Tally
General Member
Since: Apr 21, 2005
Posts: 819
Last: Oct 26, 2012
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Sunday, Sep. 30, 2012 04:26 am
csocsi96 writes...
Quote:
Should I post the part of the script which is responsible for spawning zombies and moving them? + The getent thingy about entities?


I personally have no interest in helping you write a zombie mod. All I was doing was trying to help you with a mapping error. Other than that, you can either write code for Call of Duty, or you can't. In which case, learn, as it isn't difficult.

On the other hand, if you have a puzzling mapping error, I will help with that. But as I said, I have no interest in making a zombie mod for you.
Share |
csocsi96
General Member
Since: Aug 9, 2010
Posts: 75
Last: Aug 24, 2014
[view latest posts]
Level 3
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Sunday, Sep. 30, 2012 02:57 pm
ok, now i know that the zombies must have a trigger damage and script brushmodel in the map, named from zd0, zc0, to targetname zd19,zc,19

i know that trigger_damage are the zd... and script brushmodels are the zc.. i just dont know what texture do i need to use if i want to make a script brushmodel? shall i use trigger? or origin?

maybe the script brushmodel is the problem why the zombies are lagging? (moving 1 meter forward every 10 sec)?
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Sunday, Sep. 30, 2012 03:10 pm
without knowing the mod we cannot really help you!
you should contact the modder or other mappers for that...

i guess you dont need any scrip_brushmodels, i thin they should be script_models instead
Share |
csocsi96
General Member
Since: Aug 9, 2010
Posts: 75
Last: Aug 24, 2014
[view latest posts]
Level 3
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Sunday, Sep. 30, 2012 03:59 pm
serthy writes...
Quote:
without knowing the mod we cannot really help you!
you should contact the modder or other mappers for that...

i guess you dont need any scrip_brushmodels, i thin they should be script_models instead


I looked into a botzom map's bsp file, with a text editor, and at the bottom of it there was it:

Code:


{
"targetname" "wd0"
"classname" "trigger_damage"
"model" "*10"
}
{
"targetname" "wc0"
"classname" "script_brushmodel"
"model" "*11"
}
{
"targetname" "zd0"
"classname" "trigger_damage"
"model" "*12"
}
{
"targetname" "zc0"
"classname" "script_brushmodel"
"model" "*13"
}
{
"targetname" "wd1"
"classname" "trigger_damage"
"model" "*14"
}
{
"targetname" "wc1"
"classname" "script_brushmodel"
"model" "*15"
}
{
"targetname" "zd1"
"classname" "trigger_damage"
"model" "*16"
}
{
"targetname" "zc1"
"classname" "script_brushmodel"
"model" "*17"
}
{
"targetname" "wd2"
"classname" "trigger_damage"
"model" "*18"
}
{
"targetname" "wc2"
"classname" "script_brushmodel"
"model" "*19"
}
{
"targetname" "zd2"
"classname" "trigger_damage"
"model" "*20"
}
{
"targetname" "zc2"
"classname" "script_brushmodel"
"model" "*21"
}


etc...


and in the scripts i have:

I think this responds for making the zombies damage triggers and spawning them on dm spawns:
Code:


	for(i=0;i<32;i++) 
	{
		level.zombies[i]=false;
		level.wolves[i]=false;
		getent("zd"+i,"targetname") enablelinkto();
		getent("wd"+i,"targetname") enablelinkto();
		getent("zc"+i,"targetname").origin=(0,0,20000);
		getent("wc"+i,"targetname").origin=(0,0,20000);
		getent("zd"+i,"targetname").origin=(0,0,20000);
		getent("wd"+i,"targetname").origin=(0,0,20000);
		getent("zd"+i,"targetname") hide();
		getent("wd"+i,"targetname") hide();
		getent("zc"+i,"targetname") hide();
		getent("wc"+i,"targetname") hide();
	}
	for(i=level.maxzom;i<32;i++) 
	{
		getent("zd"+i,"targetname") delete();
		getent("wd"+i,"targetname") delete();
		getent("zc"+i,"targetname") delete();
		getent("wc"+i,"targetname") delete();
	}
	
	level.spawns=getentarray("mp_dm_spawn","classname");
	
	loadnodes();


and this (loadnodes) for moving the zombies:

Code:

loadnodes()
{
	nodes=getentarray("node","targetname");
	level.nodes=[];
	for(i=0;i<nodes.size;i++)
	{
		level.nodes[i]=spawnstruct();
		level.nodes[i].origin=nodes[i].origin+(0,0,1);
		level.nodes[i].arcs=[];
		level.nodes[i].dists=[];
		for(j=0;j<nodes.size;j++)
		if(j!=i && sighttracepassed(nodes[i].origin+(0,0,1),nodes[j].origin+(0,0,1),false,undefined))
		{
			level.nodes[i].arcs[level.nodes[i].arcs.size]=j;
			level.nodes[i].dists[level.nodes[i].dists.size]=distancesquared(nodes[i].origin,nodes[j].origin);
		}			
	}
	
	level.routes=[];
	for(i=0;i<level.nodes.size;i++) level.routes[i]=[];
	level.routedists=[];
	for(i=0;i<level.nodes.size;i++) level.routedists[i]=[];
	
	for(n=0;n<level.nodes.size;n++)
	{
		d=[];
		p=[];
		done=[];
		for(i=0;i<level.nodes.size;i++) d[i]=100000000;
		for(i=0;i<level.nodes.size;i++) p[i]=-1;
		for(i=0;i<level.nodes.size;i++) done[i]=false;
		d[n]=0;
		q=[];
		q[n]=0;
		while(q.size>0)
		{
			min=100000000;
			u=-1;
			for(i=0;i<level.nodes.size;i++) if(isdefined(q[i]) && q[i]<min) {min=q[i];u=i;}
			done[u]=true;
			q[u]=undefined;
			for(i=0;i<level.nodes[u].arcs.size;i++) if(!done[level.nodes[u].arcs[i]] && d[level.nodes[u].arcs[i]]>d[u]+level.nodes[u].dists[i])
			{
				d[level.nodes[u].arcs[i]]=d[u]+level.nodes[u].dists[i];
				p[level.nodes[u].arcs[i]]=u;
				q[level.nodes[u].arcs[i]]=d[u]+level.nodes[u].dists[i];
			}
		}
		
		invp=[];
		invp[n]=n;
		for(i=0;i<p.size;i++) if(i!=n)
		{
			last=i;
			cur=i;
			while(cur!=n)
			{
				last=cur;
				cur=p[cur];
			}
			invp[i]=last;
		}
		
		level.routes[n]=invp;
		level.routedists[n]=d;
	}
	
	/*f=openfile("test.txt","write");
	for(i=0;i<level.nodes.size;i++)
	{
	fprintln(f,"\n");
	for(j=0;j<level.nodes.size;j++)
	{
		fprintln(f,level.routes[i][j]+"\t");
	}
	}
	for(i=0;i<level.nodes.size;i++)
	{
	fprintln(f,"\n");
	for(j=0;j<level.nodes.size;j++)
	{
		fprintln(f,level.routedists[i][j]+"\t");
	}
	}
	closefile(f);*/
}


and after the zombies have spawned, it threads this script:

Code:

zombie()
{
	self endon("killed");
	self.maxhealth=int(level.zommaxhealth*level.zt[self.type]["health"]);
	self.health=self.maxhealth;
	self.safety=0;
	self.id=0;
	self.assists=[];
	if(!self.boss) 
	{
		while(level.zombies[self.id]) self.id++;
		level.zombies[self.id]=true;
		d=getent("zd"+self.id,"targetname");
		c=getent("zc"+self.id,"targetname");
	} 
	else
	{
		while(level.wolves[self.id]) self.id++;
		level.wolves[self.id]=true;
		d=getent("wd"+self.id,"targetname");
		c=getent("wc"+self.id,"targetname");	
	}
	
	self thread burn(level.zt[self.type]["fx"]);	
	self setmodel(level.models[level.zt[self.type]["model"]]["walk"]+"1");
	d.origin=self.origin;
	d linkto(self);
	d.owner=self;
	d thread monitordamage();
	self.trig=d;
	self.blocker=c;
	self.blocker.origin=self.origin;
	self.blocker.owner=self;
	self.blocker linkto(self);
	
	self.blocker2=spawn("trigger_radius",self.origin+(0,0,50),0,5,5);
	self.blocker2 setcontents(1);
	self.blocker2 enablelinkto();
	self.blocker2 linkto(self);
	self.blocker2 hide();
	
	self.animation=0;
	for(;;)
	{
		self.closestnode=undefined;
		for(j=0;j<level.nodes.size;j++)
		{
			if(sighttracepassed(self.origin+(0,0,30),level.nodes[j].origin,false,undefined))
			{
				if(!isdefined(self.closestnode)) self.closestnode=j; else
				if(closer(self.origin,level.nodes[j].origin,level.nodes[self.closestnode].origin)) self.closestnode=j;
			}
		}
		if(!isdefined(self.closestnode)) {self.origin=level.spawns[randomint(level.spawns.size)].origin;continue;}
		
		players=getentarray("player","classname");
		while(players.size==0) wait .1;
		
		seehunter=false;
		hunter=-1;
		self.nextnode=undefined;
		min=100000000;
		
		//self hide();
		
		for(i=0;i<players.size;i++) if(isalive(players[i]))
		{
			if(players[i].origin[2]-self.origin[2]<40 && sighttracepassed(self.origin+(0,0,30),players[i].origin+(0,0,30),false,undefined))
			{
				//self showtoplayer(players[i]);
				dir=maps\mp\_utility::vectorscale(anglestoright(vectortoangles(players[i].origin-self.origin)),20);
				if(sighttracepassed(self.origin+(0,0,30)+dir,players[i].origin+(0,0,30),false,undefined) &&
						sighttracepassed(self.origin+(0,0,30)-dir,players[i].origin+(0,0,30),false,undefined))
				{
					dist=distancesquared(self.origin,players[i].origin);
					//if(dist<1000000) self showtoplayer(players[i]);
					if(!seehunter) min=100000000;
					if(dist<min) {min=dist;hunter=players[i];}
					seehunter=true;
				}
			}
			if(!seehunter && isdefined(players[i].closestnode) && level.routedists[self.closestnode][players[i].closestnode]<min) 
			{
				min=level.routedists[self.closestnode][players[i].closestnode];
				self.nextnode=level.routes[self.closestnode][players[i].closestnode];
			}
		}
		
		if(seehunter && isplayer(hunter)) self move(hunter.origin,(min<40000),hunter); else
		if(isdefined(self.nextnode)) 
		{
			if(sighttracepassed(self.origin+(0,0,1),level.nodes[self.nextnode].origin,false,undefined))
				self move(level.nodes[self.nextnode].origin);
			else
				self move(level.nodes[self.closestnode].origin);
		}
		wait .2;
	}
}


edited on Sep. 30, 2012 09:21 am by csocsi96
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Sunday, Sep. 30, 2012 08:43 pm
Code:

		players=getentarray("player","classname");
		while(players.size==0) wait .1;

rofl'd
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

»