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

Members Online

»
0 Active | 95 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 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 subscribe
Author Topic: Helicopter wont fire missile ?
benni-iop
General Member
Since: Oct 16, 2010
Posts: 13
Last: Dec 1, 2011
[view latest posts]
Level 1
Category: CoD4 SP Mapping
Posted: Monday, Oct. 18, 2010 09:04 pm
Its me again with a helicopter problem [ohwell]

- the target is a script_origin
- the function continues when the cobra helicopter
reaches a special path

Code:
#include maps\_utility;

#include common_scripts\utility;

#include maps\_vehicle;

#include maps\_helicopter_globals;


main()
{
	maps\_cobra::main("vehicle_cobra_helicopter_fly");
	maps\_load::main();

	thread cobra_fires_rocket();
}

cobra_fires_rocket()
{
	flag_wait("cobra_at_path1");

	cobra = getEnt("cobra", "targetname");
	cobra_target = getEnt( "cobra_target", "targetname" );

	wait 1;

	cobra fire_missile( "cobra_20mm", 1, cobra_target );
}


To the zone file I added :

xmodel,vehicle_cobra_helicopter_fly
weapon,sp/cobra_20mm

and the other standart things ....


Code:
heli_shoots_rockets_at_ent( target )
{
	attractor = missile_createAttractorEnt( target, 100000, 60000 );
	self maps\_helicopter_globals::fire_missile( "mi28_seeker", 3, target, .75 );
	wait( 5 );
	missile_deleteAttractor( attractor );
} // heli_shoots_rockets_at_ent()


Thats the part of the Backlot SP map

I dont know what this does :
attractor = missile_createAttractorEnt( target, 100000, 60000 );

Is this important ?
Share |
_INSANE_
General Member
Since: Nov 7, 2008
Posts: 352
Last: Jul 10, 2011
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 SP Mapping
Posted: Tuesday, Oct. 19, 2010 07:31 am
I don't think "cobra_20mm" is a missiletype... try "ffar"
Share |
benni-iop
General Member
Since: Oct 16, 2010
Posts: 13
Last: Dec 1, 2011
[view latest posts]
Level 1
Category: CoD4 SP Mapping
Posted: Tuesday, Oct. 19, 2010 08:45 am
Ahh , got it ...

1. change weapon to "mi28_seeker"
cobra fire_missile( "mi28_seeker", 1, cobra_target );

2. add precache of this item
precacheItem( "cobra_seeker" );

3. update zone file
weapon,sp/cobra_seeker

Little Summary :
1. script_struct with key value
script_flag_set / cobra_at_path

2. Add to your script
Code:
#include maps\_helicopter_globals;


precacheItem( "cobra_seeker" );

thread your_function();


and

Code:

your_function() 
{
	flag_wait("cobra_at_path"); //wait till flag is true

        // Get your Entities
	cobra = getEnt("cobra", "targetname");
	cobra_target = getEnt( "cobra_target", "targetname" );

	wait 0.1;

	cobra fire_missile( "mi28_seeker", 1, cobra_target );
}


3. Add to your zone file
weapon,sp/cobra_seeker


edited on Oct. 22, 2010 06:08 pm by benni-iop
Share |
sam_fisher3000
General Member
Since: Apr 18, 2007
Posts: 816
Last: Jul 16, 2016
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD4 SP Mapping
Posted: Thursday, Dec. 2, 2010 04:33 am
Use this. It works.

Code:
cobraattacktroops()
{
costart = getent("costart","targetname"); //trigger
costart waittill("trigger");<br />
<br />
wait 1; <br />
<br />
helicop = getent("helic","targetname"); //helicopter
helicop thread mgon(); 
cobrashoothere = getent("cobrashoothere","targetname"); 
//script_origin or the thing you want to shoot at<br />
<br />
cobraattack = getstruct("shoot_here","script_noteworthy"); //the node that you want the heli to stop at
cobraattack waittill( "trigger", helicop ); //wait till the heli stops<br />
<br />
helicop vehicle_detachfrompath(); //detach from path<br />
<br />
wait 0.75;<br />
<br />
helicop thread fire_missile( "mi28_seeker", 10, cobrashoothere, 3 ); //shoot! Look at the script file _helicopter_globals.gsc for more weapons and what each variable is. <br />
<br />
wait 20;<br />
<br />
helicop vehicle_resumepathvehicle(); //resume


Code:
precacheitem("cobra_seeker");






edited on Dec. 1, 2010 11:34 pm by sam_fisher3000
Share |
Restricted Access Topic is Locked 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

»