| Author |
Topic: Crouching |
| BlindSniper |
General Member Since: Aug 22, 2008 Posts: 45 Last: May 29, 2013 [view latest posts] |
|
|
|
Category: CoD4 SP Mapping Posted: Thursday, Apr. 8, 2010 08:35 pm |
 |
I've got an animation semi-working where the guy goes to the corner then crouches. However he doesn't stay in the crouch position. How can I get him to maintain the crouch?
Would it need to be looped if so how do I do that?
Code:
#include common_scripts\utility;
#include maps\_utility;
#include maps\_anim;
#using_animtree( "generic_human" );
main()
{
precachemodel( "weapon_ak47" );
precachemodel( "weapon_m16" );
maps\test_castle_anim::main();
maps\_load::main();
level.weaponClipModels = [];
level.weaponClipModels[0] = "weapon_m16_clip";
level.weaponClipModels[1] = "weapon_ak47_clip";
level.weaponClipModels[3] = "weapon_mp5_clip";
level.player takeallweapons();
level.player giveWeapon ("ak47");
level.player giveWeapon ("fraggrenade");
level.player giveWeapon ("flash_grenade");
thread anims();
}
anims()
{
level.guy = getent( "friend_m4", "targetname" );
level.guy.animname = "friend_m4";
anim_node = getnode( "crouch_target", "targetname" );
level.guy setgoalnode(anim_node);
level.guy waittill( "goal" );
anim_node anim_reach_solo( level.guy, "crouch" );
anim_node thread anim_single_solo( level.guy, "crouch" );
}
[code
]#include maps\_utility; #include common_scripts\utility; #include maps\_anim; #using_animtree ("generic_human");
main() {
anims();
}
anims()
{ level.scr_anim[ "friend_m4" ][ "crouch"]= %covercrouch_aim5; }
|
 |
|
|
| voidsource |
General Member Since: May 5, 2007 Posts: 1513 Last: Sep 1, 2013 [view latest posts] |
|
|
|
Category: CoD4 SP Mapping Posted: Thursday, Apr. 8, 2010 10:23 pm |
 |
well if you have him going to a node u can check the option in the node that tells him dont stand and dont prone, which in return forces him to crouch. when your done with him and want him to move on to hte next node he will move to it normally ( assuming u didnt check any other boxes in his next node )
edited on Apr. 8, 2010 06:23 pm by voidsource
also you can just tell him via script wat position to be in. here is wat you would type:
Code:
ent allowedstances( "prone" );// will make him go to prone only.
ent allowedstances( "crouch" );
ent allowedstances( "stand" );
//now if you wanted him to be allowed to have all 3 of them, then
//just put all three in like
ent allowedstances( "prone", "crouch", "stand" );
hope that works. |
|
|
|
| BlindSniper |
General Member Since: Aug 22, 2008 Posts: 45 Last: May 29, 2013 [view latest posts] |
|
|
|
|
| voidsource |
General Member Since: May 5, 2007 Posts: 1513 Last: Sep 1, 2013 [view latest posts] |
|
|
|
|
| BlindSniper |
General Member Since: Aug 22, 2008 Posts: 45 Last: May 29, 2013 [view latest posts] |
|
|
|
|
| voidsource |
General Member Since: May 5, 2007 Posts: 1513 Last: Sep 1, 2013 [view latest posts] |
|
|
|
Category: CoD4 SP Mapping Posted: Saturday, Apr. 10, 2010 06:48 pm |
 |
well if you dont want ur teammate to die just give them a magic bullet shield. And its ok if 2 ai's have the same k/v's that would just be easier to write the script. So i would change both the guys k/v's to "hero", "targetname" then it would be easier for the code to work. It would look like this:
Code:
allyteam = getentarray( "hero", "targetname" );
for( i=0; i< allyteam.size; i++ )
allyteam[i] thread magic_bullet_shield();
that should allow them to be alive and take all the bullets they want without dying. now theres also another script that you can write it which allows them to take the bullets and not react as if they got hit. which makes more believable when u see them stand there in the crossfire and they wont die. otherwise you would see them get hit and they will react to pain but wont die, no matter how many times they get hit in a very short time. I dont remember what it is called but if i ever do find out i will let you know.
also when you do decide to have ur allyteam finally die then you would have to take off the magic bullet shield. for that just type:
allyteam stop_magic_bullet_shield();
hope this helps
edited on Apr. 10, 2010 02:50 pm by voidsource |
|
|
|
| BlindSniper |
General Member Since: Aug 22, 2008 Posts: 45 Last: May 29, 2013 [view latest posts] |
|
|
|
Category: CoD4 SP Mapping Posted: Saturday, Apr. 10, 2010 06:55 pm |
 |
But if I need the two peoples targetnames to be different how would I put them both in?
edited on Apr. 10, 2010 02:56 pm by BlindSniper
I still get bad syntax error when I have it as one person.
Code:
thread ally_nodamage();
}
ally_nodamage()
{
allyteam =getentarray ("hero","targetname");
for(i=0;i
allyteam[i] thread maps_utility::magic_bullet_shield();
}
|
 |
|
|
| voidsource |
General Member Since: May 5, 2007 Posts: 1513 Last: Sep 1, 2013 [view latest posts] |
|
|
|
Category: CoD4 SP Mapping Posted: Saturday, Apr. 10, 2010 06:59 pm |
 |
then you wouldnt use getentarray, you would just use getent.
it would then look like this
Code:
guy1 = getent( "hero", "targetname" );
guy2 = getent( "hero1", "targetname" );
guy1 thread magic_bullet_shield();
guy2 thread magic_bullet_shield();
edited on Apr. 10, 2010 02:59 pm by voidsource
u probably get the error because getentarray is used for an array of characters containing the same key/values so if you dont have an array ( more than 1 ) character with the same key value then thats where you would get the problem. when its just one single person with that unique k/v then you would only use getent. i have posted a link of my source files for the first sp map that i have done:
My source files
this should help clear up some of the things i did write for my own characters in my map. it has everything from stock script to the actual map layout with all the triggers and watnot. It has everything exactly as i used it. |
|
|
|
| BlindSniper |
General Member Since: Aug 22, 2008 Posts: 45 Last: May 29, 2013 [view latest posts] |
|
|
|
|
| voidsource |
General Member Since: May 5, 2007 Posts: 1513 Last: Sep 1, 2013 [view latest posts] |
|
|
|
|
|
|
mp_TempleCall of Duty: Mods: Multiplayer (624.12Kb)
|