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

Members Online

»
0 Active | 45 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 subscribe
Author Topic: Sitting AI?
ArmorMaster
General Member
Since: Mar 30, 2005
Posts: 371
Last: Oct 3, 2009
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Wednesday, Aug. 9, 2006 10:46 pm
Does anyone know if there's a way to make sitting AI? I'm making a World War I trench warfare map and I want the player to walk through the trenches and see AI sitting down and stuff. Can anyone help me?
Share |
veef
General Member
Since: Apr 25, 2006
Posts: 1258
Last: Aug 29, 2006
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Wednesday, Aug. 9, 2006 11:00 pm
Do you mean like the wounded tutorial here http://www.modsonline.com/Tutorials-read-358.html
Share |
ArmorMaster
General Member
Since: Mar 30, 2005
Posts: 371
Last: Oct 3, 2009
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Thursday, Aug. 10, 2006 02:37 am
Umm.. I was kind of thinking like soldiers just sitting on a bench or something before going over the top. I was imagining soldiers sitting naturally and not jerking in pain...

thanks though
Share |
Ace008
General Member
Since: Jul 22, 2005
Posts: 738
Last: Jan 3, 2009
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Friday, Aug. 11, 2006 08:49 pm
Well I made some guys that sit, not sure it is the right way but hey it works[biggrin].

Here is what I did:

Add an AI to you map and give him a targetname.

I named mine James so that would be:

key:targetname
value:James

That is it for the mapping part although you will have to ajust the position of the player sometimes so he is no floating and make it look good.

Now for the script:

Code:
#include maps\_utility;

#include maps\_anim;

#using_animtree("generic_human");
main()
{
maps\_load::main();
maps\mymapname_anim::main();

level.player takeallweapons();
level.player giveWeapon ("m1garand");
level.player giveWeapon ("colt");
level.player giveWeapon ("fraggrenade");
level.player switchToWeapon ("m1garand");

level.James = getent("James", "targetname");
level.James.animname = "James";



thread sit();
}
sit()
{


level.James anim_single_solo(level.James, "sitting");
}


Than make an mymapname_anim.gsc and place this inside:
Code:
#using_animtree("generic_human");
main()
{

			
level.scr_anim["James"]["sitting"]						= %halftrack_guy05_idle;
                                                                                                         
}


If you want to add multiple guys sitting it works off the same principles. Add some AI and give them all different targetnames. I chose to name mine sitting_guy, James, and Hathcock. Than as before you are done with the mapping part.

Now for the script, hopefully it will work for you.

Code:
#include maps\_utility;

#include maps\_anim;

#using_animtree("generic_human");
main()
{
maps\_load::main();
maps\mymapname_anim::main();

level.player takeallweapons();
level.player giveWeapon ("enfield");
level.player switchToWeapon ("enfield");

level.James = getent("James", "targetname");
level.James.animname = "James";

level.sitting_guy = getent("sitting_guy", "targetname");
level.sitting_guy.animname = "sitting_guy";

level.Hathcock = getent("Hathcock", "targetname");
level.Hathcock.animname = "Hathcock";

thread sit();

thread sit2();

thread sit3();

}
sit()
{

level.James anim_single_solo(level.James, "sitting");
}

sit2()
{

level.sitting_guy thread maps\_anim::anim_loop_solo (level.sitting_guy, "sit", undefined , "stop", undefined, undefined);
}

sit3()
{

level.Hathcock thread maps\_anim::anim_loop_solo (level.Hathcock, "rest", undefined , "stop", undefined, undefined);

}


Now make a mymapname_anim.gsc and place this inside:

Code:
#using_animtree("generic_human");
main()
{

			
level.scr_anim["sitting_guy"]["sit"][0]						= (%eldaba_tired_idleB);
level.scr_anim["James"]["sitting"]						= %halftrack_guy05_idle;
level.scr_anim["Hathcock"]["rest"][0]                                                                                                                        = %halftrack_guy04_idle;
}


That should be it,here is a picture of what it looks like when it is done:

Share |
auzt1n06
General Member
Since: Jul 22, 2006
Posts: 12
Last: Dec 20, 2006
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Saturday, Nov. 4, 2006 12:45 am
I tried this but cant seem to get it to work. there seems to be a script error when i load the map. but all the line parameteres are correct.
Can anyone help me.

#include maps\_utility;
#include maps\_anim;
#using_animtree("generic_human");

main()
{
maps\_load::main();
maps\wint_anim::main();
maps\wint_fx::main();

setCullFog(0, 20000, 0.8, 0.8, 0.8, 0); //Fog
setExpFog(0.00050, .60, .60, .60, 3);

level.player takeallweapons();
level.player giveWeapon ("svt40");
level.player giveWeapon ("luger");
level.player giveWeapon ("fraggrenade");
level.player switchToWeapon ("svt40");

level.James = getent("James", "targetname");
level.James.animname = "James";

thread sit();

}

sit()

{

level.James anim_single_solo(level.James, "sitting");

}



#using_animtree("generic_human");
main()
{

level.scr_anim["James"]["sitting"][0]
= %halftrack_guy05_idle;

}
Share |
Ace008
General Member
Since: Jul 22, 2005
Posts: 738
Last: Jan 3, 2009
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Saturday, Nov. 4, 2006 03:04 pm
Well it looks to me like you didn't make a anim.gsc.

Make a file called mymapname.gsc and place this code in it.

Code:
#include maps\_utility;

#include maps\_anim;

#using_animtree("generic_human");

main()
{
maps\_load::main();
maps\wint_anim::main();
maps\wint_fx::main();

setCullFog(0, 20000, 0.8, 0.8, 0.8, 0); //Fog 
setExpFog(0.00050, .60, .60, .60, 3);

level.player takeallweapons();
level.player giveWeapon ("svt40");
level.player giveWeapon ("luger");
level.player giveWeapon ("fraggrenade");
level.player switchToWeapon ("svt40");

level.James = getent("James", "targetname");
level.James.animname = "James";

thread sit();

}

sit()

{

level.James anim_single_solo(level.James, "sitting");

}


Now make a mymapname_anim.gsc and place this code in it.

Code:
#using_animtree("generic_human");
main()
{

level.scr_anim["James"]["sitting"][0] 
= %halftrack_guy05_idle;

}


If that doesn't work try typing +set developer 1 into you COD2 shotcut target and it will give you a better description of the error.

edited on Nov. 4, 2006 10:06 am by Ace008
Share |
auzt1n06
General Member
Since: Jul 22, 2006
Posts: 12
Last: Dec 20, 2006
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Saturday, Nov. 4, 2006 03:24 pm
I checked the console for the error that it gives me and here it is:

******* script runtime error *******
type object is not an anim: (file 'maps/_anim.gsc', line 362)
guy animscripted( "single anim", org, angles, level.scr_anim[guy.animname][anime] );
*
called from:
(file 'maps/_anim.gsc', line 986)
anim_single (newguy, anime, tag, node, tag_entity);
*
called from:
(file 'maps/wint.gsc', line 31)
level.James anim_single_solo(level.James, "sitting");
*
called from:
(file 'maps/wint.gsc', line 23)
thread sit();
*
started from:
(file 'maps/wint.gsc', line 5)
main()
*

ca anyone tell me the porblem?? I am not to familiar with the scripting yet, but in the mean time i will try to solve it on my own but could use some help. thanks.
Share |
Ace008
General Member
Since: Jul 22, 2005
Posts: 738
Last: Jan 3, 2009
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Saturday, Nov. 4, 2006 03:50 pm
Is that your whole script you posted? Sorry I am not much help, I am only starting to grasp scripting a little.
Share |
auzt1n06
General Member
Since: Jul 22, 2006
Posts: 12
Last: Dec 20, 2006
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Saturday, Nov. 4, 2006 11:54 pm
Besides the script, do I have to do anything in radiant like add a node of scripted thing and connect it to the actor or something???
Share |
Ace008
General Member
Since: Jul 22, 2005
Posts: 738
Last: Jan 3, 2009
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Sunday, Nov. 5, 2006 01:59 pm
You shouldn't have to add anything to the actors in the map except a targetname. If you Private Message me your email or post it here I will send you a test map I made for you to look at if that will help you at all.
Share |
Restricted Access Topic is Locked 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

»