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

Members Online

»
0 Active | 9 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 4
Category: CoD4 SP Mapping
CoD 4 mapping and level design for single player.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: Crouching
BlindSniper
General Member
Since: Aug 22, 2008
Posts: 45
Last: May 29, 2013
[view latest posts]
Level 2
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; }
Share |
voidsource
General Member
Since: May 5, 2007
Posts: 1513
Last: Sep 1, 2013
[view latest posts]
Level 8
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.
Share |
BlindSniper
General Member
Since: Aug 22, 2008
Posts: 45
Last: May 29, 2013
[view latest posts]
Level 2
Category: CoD4 SP Mapping
Posted: Thursday, Apr. 8, 2010 10:50 pm
Oh right I didn't realise that. Also when the actors are in crouch postition can they still play animations?
Share |
voidsource
General Member
Since: May 5, 2007
Posts: 1513
Last: Sep 1, 2013
[view latest posts]
Level 8
Category: CoD4 SP Mapping
Posted: Thursday, Apr. 8, 2010 10:55 pm
yea but if the animation is of them standing it will display them from crouch to the animation with nothing in between
Share |
BlindSniper
General Member
Since: Aug 22, 2008
Posts: 45
Last: May 29, 2013
[view latest posts]
Level 2
Category: CoD4 SP Mapping
Posted: Saturday, Apr. 10, 2010 05:07 pm
Ok thanks voidsource I got another simple problem :D

I'm trying the thing where your teamates don't die. But I don't know the right way to list an array is it:
allyteam =getentarray ("hero,hero1","targetname");
allyteam =getentarray ("hero,"targetname")("hero1,"targetname");
Btw the two people are hero and hero1.

Also when I tried the first one I got bad synatx error.


Share |
voidsource
General Member
Since: May 5, 2007
Posts: 1513
Last: Sep 1, 2013
[view latest posts]
Level 8
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
Share |
BlindSniper
General Member
Since: Aug 22, 2008
Posts: 45
Last: May 29, 2013
[view latest posts]
Level 2
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(); 
}
Share |
voidsource
General Member
Since: May 5, 2007
Posts: 1513
Last: Sep 1, 2013
[view latest posts]
Level 8
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.
Share |
BlindSniper
General Member
Since: Aug 22, 2008
Posts: 45
Last: May 29, 2013
[view latest posts]
Level 2
Category: CoD4 SP Mapping
Posted: Saturday, Apr. 10, 2010 07:02 pm
oh right, Thanks for the help [rocking]
Share |
voidsource
General Member
Since: May 5, 2007
Posts: 1513
Last: Sep 1, 2013
[view latest posts]
Level 8
Category: CoD4 SP Mapping
Posted: Saturday, Apr. 10, 2010 07:04 pm
i edited my previous post. which just so happens to answer ur post. lol
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 SP Mapping

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

»