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

Members Online

»
0 Active | 62 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: move to node/animation
sleep61
General Member
Since: Sep 16, 2007
Posts: 169
Last: Apr 18, 2008
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Thursday, Feb. 14, 2008 05:49 am
hi, i'm making a simple test map in which my allied friend is in a friendly chain and then moves off to a couple of nodes. in the last node i want some animation to play, in this case it is a simple arm wave. moving him to nodes and the friendly chain bits work well, unfortunatley my animation will not play when he reaches the last node. i have searched the forums and tuts but nothing i find seems to reflect what i am trying to do. and yes i have an _anim.gsc for my map. here is my gsc:




#include maps\_anim;
main()
{
maps\_load::main();

level.player takeallweapons();
level.player giveWeapon ("m1garand");
level.player giveWeapon ("thompson");
level.player giveWeapon ("fraggrenade");
level.player switchToWeapon ("m1garand");
thread hammer();

}
hammer()
{
guy = getent ("actor_allied1","script_noteworthy");
guy.animname = "guy1";

trig = getent ("trig1_allied","targetname");

trig waittill ("trigger");

node = getnode ("node1_allied1","targetname");
guy.goalradius = 1;
guy setgoalnode(node);

trig2 = getent ("trig2_allied","targetname");

trig2 waittill ("trigger", other);

node2 = getnode ("node2_allied1","targetname");
guy.goalradius = 1;
guy setgoalnode(node2);
guy waittill("goal");
guy anim_single_solo("guy1", "animationname1");


}



any help would be nice.
Share |
SparkyMcSparks
General Member
Since: Feb 28, 2004
Posts: 1713
Last: Dec 29, 2016
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Thursday, Feb. 14, 2008 06:10 am
guy anim_single_solo("guy1", "animationname1");
should be
guy anim_single_solo("guy", "animationname1");

Do you have the animation "animationname1" defined in your map's anim script file?
Share |
TFlames
General Member
Since: Feb 25, 2007
Posts: 3
Last: Oct 5, 2008
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Thursday, Feb. 14, 2008 09:55 am
Just do

guy anim_single_solo(guy, "animationname1");

Share |
sleep61
General Member
Since: Sep 16, 2007
Posts: 169
Last: Apr 18, 2008
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Thursday, Feb. 14, 2008 01:25 pm
thanks for the reply gents, i changed it from guy1 to guy, no joy. he just moves to his node and squats. i changed it from "guy" to guy, and the same, he just squats. here is my _anim.gsc if that helps.

#using_animtree("generic_human");
main()

{

level.scr_anim["guy1"]["animationname1"] = (%duhoc_assault_randall_waves);

}
Share |
TFlames
General Member
Since: Feb 25, 2007
Posts: 3
Last: Oct 5, 2008
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Thursday, Feb. 14, 2008 06:30 pm
sleep61 writes...
Quote:
thanks for the reply gents, i changed it from guy1 to guy, no joy. he just moves to his node and squats. i changed it from "guy" to guy, and the same, he just squats. here is my _anim.gsc if that helps.

#using_animtree("generic_human");
main()

{

level.scr_anim["guy1"]["animationname1"] = (%duhoc_assault_randall_waves);

}


You need to call your anim file in your script. Just do:

#include maps\_anim;
main()
{
maps\yourlevelname_anim::main(); <-----
// this calls the main function of your anim file
// otherwise your animation is not getting initialized
maps\_load::main();

...

Then when you play the animation make sure you:

guy.animname = "guy1";
guy anim_single_solo(guy, "animationname1");
Share |
sleep61
General Member
Since: Sep 16, 2007
Posts: 169
Last: Apr 18, 2008
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Thursday, Feb. 14, 2008 11:44 pm
TFlames! You Are The Man!! works beautifully, thanks.[wave]
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

»