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

Members Online

»
0 Active | 10 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 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
Previous Page
subscribe
Author Topic: Making a More "Rough" Bot...
r00t_
General Member
Since: Dec 15, 2010
Posts: 51
Last: May 16, 2011
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Friday, Jan. 14, 2011 09:49 pm
Oh wow. Is the algorithm part of a public mod? Is it something I can find somewhere?

Also, wouldn't there be something similar to this algorithm in the single player gsc files for cod2. Because doesn't the AI in single player do sort of the same thing as astar?

EDIT: woot 2nd page!
Share |
r00t_
General Member
Since: Dec 15, 2010
Posts: 51
Last: May 16, 2011
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Saturday, Jan. 15, 2011 02:46 am
It is now time that I get to some real scripting. I have made a rough duplicate to the map used in the gametype I am trying to mimic. I also put in a script -> model. Things I set on it:

model: xmodel/zombie
targetname: zombie
angle: (set correct angle for aesthetics)
origin: 64 64 0 (ground level, beginning of ramp)

I put in spawns, lighting, and voila I compile and i have my preliminary map.
Also, I put in a hurt trigger and a damage trigger. The hurt trigger was intended to be linked with the xmodel to make it damage(hurt) whatever the xmodel touched. And the damage trigger was to start the movement in motion.

Here is the script I whipped up in like 15 minutes.
Code:
main()
{
	thread zombiemove();
}

zombiemove()
{
	zombie = getent("zombie","targetname");
	trig = getent("trig_damage","targetname");
	model = getent("trig_hurt","targetname");
	model linkto(zombie);
	int i, x, y, counter=1;
	trig waittill("trigger");
	thread rotate();
	for(i=104;i<=1000;i+=96)
	{
		if(counter == 1)
		{
			x = 64;
			y = 960;
		}
		else if(counter == 2)
		{
			x = 960;
			y = 960;
		}
		else if(counter == 3)
		{
			x = 960;
			y = 64;
		}
		else if(counter == 4)
		{
			x = 64;
			y = 64;
			counter = 0;
		}
		pos = (x,y,i);
		zombie moveto(pos,15,2,2);
		zombie waittil("movedone");
		counter++;
	}
}

rotate()
{
	zombie = getent("zombie","targetname");
	int i, x=0, y, z=0, counter=1;
	wait(1);
	while(1)
	{
		if(counter == 1)
			y = o;
		else if(counter == 2)
			y = 270;
		else if(counter == 3)
			y = 180;
		else if(counter == 4)
		{
			y = 90;
			counter = 0;
		}
		wait(13);
		angles = (x,y,z);
		zombie RotateTo(angles, 2);
		counter++;
	}
}


Before I get a bunch of people responding "YOU NOOB!! THAT'S A TERRIBLE WAY TO DO ALL THAT!" Well that might be true, but at least it should work. However, if you know for a fact that something in this script shouldn't work, then please, do tell [casanova].

So I ran the maps without a single compile error. However, when I shot the damage trigger to make everything move, nothing happened.

As a debugging strategy I whipped up this script in like 2 minutes.
Code:
main()
{
	thread zombiemove();
}

zombiemove()
{
	zombie = getent("zombie","targetname");
	model = getent("trig_hurt","targetname");
	model linkto(zombie);
	wait(10);
	pos = (64,960,104);
	zombie moveto(pos,15,2,2);
	zombie waittill("movedone");
}


Literally all this was supposed to do is after 10 seconds of the map being loaded, it should have moved the xmodel and when i touch it it should have killed me.

But of course, it never moved. And neither did the hurt trigger. I'm assuming this is because a script xmodel does not work the way I'm thinking it does. Or there is plainly something wrong with the xmodel I'm using.
Share |
clanhelio
General Member
Since: Aug 30, 2008
Posts: 223
Last: Mar 24, 2011
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Saturday, Jan. 15, 2011 09:07 pm
liltc64 writes...
Quote:
by the looks of lack of skill you have with scripting i dont think you should take on such a task for this is for more advanced modders. you should start out with something more simpler so you dont start bashing your head threw your wall.

He certainly has done his research though.
Share |
r00t_
General Member
Since: Dec 15, 2010
Posts: 51
Last: May 16, 2011
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Saturday, Jan. 15, 2011 10:15 pm
clanhelio writes...
Quote:
He certainly has done his research though.


Why thank you [biggrin]

When I am interested in something, i put all my effort into it.
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Saturday, Jan. 15, 2011 11:22 pm
Read somthing about polygon pathfinding, that its better than waypoints. You should try to make that instead of waypoints:


http://www.ai-blog.net/archives/000152.html
Share |
Restricted Access Topic is Locked
Page
Previous 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

»