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

Members Online

»
0 Active | 102 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
Page
Next Page
subscribe
Author Topic: (Hind) Enemy Helicopter strafe run
SPi
General Member
Since: Jul 4, 2012
Posts: 531
Last: Nov 9, 2019
[view latest posts]
Level 6
Category: CoD4 SP Mapping
Posted: Wednesday, Sep. 5, 2012 10:38 am
I want to make a Hind crossing a straight path and fire just 1 missile (in a specific area if possible.) and then delete itself.

Anyone knows how to?
Share |
Josh.S
General Member
Since: May 27, 2012
Posts: 86
Last: Sep 16, 2014
[view latest posts]
Level 3
Category: CoD4 SP Mapping
Posted: Wednesday, Sep. 5, 2012 10:36 pm
Well you could try using 5 or more hinds to spawn and follow a path using a trigger then use attackAI and the other vehicle weapon keys&values(press shift+V to find out)
or you can use E target and you can give it one of the missiles to fire(try checking vehicle weapons for some)
Share |
SPi
General Member
Since: Jul 4, 2012
Posts: 531
Last: Nov 9, 2019
[view latest posts]
Level 6
Category: CoD4 SP Mapping
Posted: Thursday, Sep. 6, 2012 10:04 am
Ok ive made the paths script team and trigger spawn and now i wonder if it will follow the line i made? do i have to trigger it? if yes how?
and its spawn trigger what values does it have to have?

I compiled bsp and it couldnt find vehicle file vehicle/hind

I need just one hind.

Please help
and i dont need quick answers i need specified and explained answers i dont know everything about vehicles.
just to inform.
Share |
Josh.S
General Member
Since: May 27, 2012
Posts: 86
Last: Sep 16, 2014
[view latest posts]
Level 3
Category: CoD4 SP Mapping
Posted: Friday, Sep. 7, 2012 09:27 pm
First you need to fix the vehicle/hind error
go to the asset manager open it.
now press load and go to: source_data/vehiclesettings.gdt
open it and find hind once you select it press F10
let it convert then the error wont show.
you can give the trigger a targetname (maybe strafe_A)
then in your GSC whenever you want the strafe run to happen use this line activate_trigger_with_targetname( "wave3_tank" );
remeber to make the trigger spawn the vehicle
press the trigger then the vehicle Press Shift+V select spawn vehicle open it agian select Move Vehicle.

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: Saturday, Sep. 8, 2012 03:29 am
I have to ask. Did you follow the basic tutorial on how to spawn vehicles? You have doubts on how it works. Follow it first to have the helicopter in the map. Worry about the shooting later. It's actually more complicated (for beginners anyways) and there is a script that you need to use. I can give you the script b/c I use it and it works. The shift + v commands for shooting origins, vehicles, isn't working too well. So I rely on a script. The script I got from the m1a1 shoot from the downloads, so kudos to the person that made it.

The reason for the vehicle error is common. I get it at times too when I forget to include certain things. Make you are calling the hind in the gsc file and also you have it in your zone file. Importantly, in the radiant, the hind has a vehicletype of hind in the keys/value.
So,

key: vehicletype
value: hind

I'll just give you a quick, brief tutorial.

Insert model, give it all the required keys/values, importantly vehicletype

Make a trigger and select both the vehicle and the trigger, press shift + v and click on spawn and move vehicle. Get some script_origins or script_structs and link the helicopter to them one at a time. On one of the script_origin or script_struct, give it a targetname. To keep it simple, give it script_stopnode. You can do this on the last script_origin to keep it simpler. This is to prevent the helicopter from swaying around or moving around. The helicopter stays there. For the shooting part, make sure you have a script_origin where you want the helicopter to shoot. Give it a targetname.

Now, as for the script, I can give you it but it's complicated for you to understand. It'll take sometime to explain it to you. Though, follow the basic tutorial I told you and use the vehicle tutorial on the forum as well. I can just give you the script and you copy and paste but if it doesn't work, what's the point. So if you can get the first step ready then I can take some time to help you understand how the shooting works.

You can add me on xfire or steam for help. xfire: samfisher3000 and steam: sam_fisher3000

So feel free to do so. I have seen you use the forum a lot and you have lots of questions. No worries, it's always complex for beginners. I can help if you like.
Share |
SPi
General Member
Since: Jul 4, 2012
Posts: 531
Last: Nov 9, 2019
[view latest posts]
Level 6
Category: CoD4 SP Mapping
Posted: Saturday, Sep. 8, 2012 09:06 am
attachment: image(30.5Kb)
OK. thanx for that. I know how to connect the vehiclenodes and vehnodes rotate (these I use for the helicopter) and i gave the targetnames the tut showed. But the tut was for a ground vehicle so there are some differences.
I had already gave the vehicletype and based on that the error showed up i guess. Cos when that Key/value did not exist there was an error with a null missing or somethink.(Just saying).

*Did you follow the basic tutorial on how to spawn vehicles?*

Is there a tut on how to spawn vehicles?I spawn them same way as actors.If wrong tell me.

the keys values of the hind (script/vehicle) are on the uploaded image.

I have set the hind speed 30-40
and set lookahead 1


Thats all for now. Let me know If somethink is wrong
Share |
Josh.S
General Member
Since: May 27, 2012
Posts: 86
Last: Sep 16, 2014
[view latest posts]
Level 3
Category: CoD4 SP Mapping
Posted: Saturday, Sep. 8, 2012 03:02 pm
Youre right because if you set a helicopters lookahead it turns back and fourth i dont think helicopters have lookaheads
First dont use the script group system for vehicles
remove that just connect it to a vehicle node that has speed of 30 or 40 then make sure it has START_NODE selected
Share |
SPi
General Member
Since: Jul 4, 2012
Posts: 531
Last: Nov 9, 2019
[view latest posts]
Level 6
Category: CoD4 SP Mapping
Posted: Saturday, Sep. 8, 2012 03:39 pm
Good and how can i give the chopper the order to move?
Share |
3st0nian
General Member
Since: Jan 14, 2008
Posts: 291
Last: Dec 4, 2017
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 SP Mapping
Posted: Saturday, Sep. 8, 2012 05:53 pm
Create a script_vehicle. Give it these KVP(key-value pairs):
"model" "vehicle_mi24p_hind_woodland"
"vehicletype" "hind"
"script_vehiclespawngroup" "1"
"script_team" "axis"
"speed" "20"
"script_godmode" "1"
Change the speed to what you want.

Now create script_struct and give it KVP:
"script_noteworthy" "hind_shoot"

Connect hind to that script_struct. Now create new script_struct and give it KVP
"script_noteworthy" "deleteme"

Connect previous script_struct with this one. Make a vehicle path with these two structs,
where first struct is the position, where hind will shoot a missile
and the last one where hind gets deleted.

Now make script_origin and give it KVP:
"targetname" "hind_target"

Missile will go to that location.

Finally make a trigger_multiple and give it KVP:
"targetname" "start_hind"
Place it, where you want to start the hind sequence.

And script should look like this:
Code:

#include maps\_utility;

#include common_scripts\utility;


main()
{	
	precacheItem("hind_FFAR");
	maps\_hind::main("vehicle_mi24p_hind_woodland");
	maps\_load::main(); 
	
	thread hind_shoot();
}

hind_shoot()
{
	trigger = getent("start_hind", "targetname");
	target = getent("hind_target", "targetname");
	shoot_node = getstruct("hind_shoot", "script_noteworthy");
	trigger waittill("trigger");
	thread maps\_vehicle::create_vehicle_from_spawngroup_and_gopath(1);
	shoot_node waittill("trigger", hind);
	hind maps\_helicopter_globals::fire_missile("ffar_hind", 1, target);//("ffar_hind", this number here shows how many misisles hind will fire, target)
	//hind maps\_helicopter_globals::shootEnemyTarget_Bullets(target);//This line makes hind shoot bullets to target
}


Updated a bit after reading sam_fisher3000 post below, added script_godmode, so hind cant be shot down.

edited on Sep. 8, 2012 12:06 pm by 3st0nian
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: Saturday, Sep. 8, 2012 06:34 pm
SPi writes...
Quote:
OK. thanx for that. I know how to connect the vehiclenodes and vehnodes rotate (these I use for the helicopter) and i gave the targetnames the tut showed. But the tut was for a ground vehicle so there are some differences.
I had already gave the vehicletype and based on that the error showed up i guess. Cos when that Key/value did not exist there was an error with a null missing or somethink.(Just saying).

*Did you follow the basic tutorial on how to spawn vehicles?*

Is there a tut on how to spawn vehicles?I spawn them same way as actors.If wrong tell me.

the keys values of the hind (script/vehicle) are on the uploaded image.

I have set the hind speed 30-40
and set lookahead 1


Thats all for now. Let me know If somethink is wrong


Spawning vehicle is not the same as spawning AI. Vehicle has more aspects or KV to insert and the trigger is a little different. I never set speed on the hind or lookahead. It's always a vehicle node KV and mainly works for ground vehicles. If you say it works, then it works.

As for the shooting, that script 3st0nian give is short and concise, though I don't use it. I used part of it especially the last part, fire missile to specify the number of shots but there's an error when the vehicle dies or deleted b/c the vehicle no longer exist and you'll get constant errors.

So I stick to the script that I used so the whole shooting stops when the helicopter dies. And I just script one of the script_origin and use vehicledetachfrompath(); so whenever the helicopter gets to that path or node, it stops and you can let it shoot. Or you can use script_stopnode/1

Here's an alternative to shooting, though more complex but it gives a bit more flexibility. The script that was posted seemed to target one origin or struct but here you can have an array of targets. Though I am pretty sure you can target multiple targets with the script already posted. And you can have more functions for the one I used.

Example:

chopper thread abrams_targets_stuff(); // - done mind the name

Code:
heli_fight() //not needed for helicopters but for ground vehicles - good to have reference 
{
	level.enhelik = self;
	self.ignoreme = true; //no need
	self.IgnoreRandomBulletDamage = true; //no need
	self waittill( "goal" );
	
	self.a.rockets = 5000;
	if ( isalive( level.enhelik ) )
	{
		self setentitytarget( level.enhelik );
		attractor = Missile_CreateAttractorOrigin( level.enhelik.origin + ( 0, 0, 0 ), 5000, 500 );
		
		
		//add_wait( ::_wait, 30 );
		//do_wait_any();
	
		if ( isalive( level.enhelik ) )
			radiusdamage( level.enhelik.origin, 250, 5000, 2500 );

		Missile_DeleteAttractor( attractor );
	}
	
	
}

abrams_targets_stuff() //main one - dont mind the name 
{
	level.enhelik endon( "death" ); //stops when dead
	level.timer = gettime();
	wait( 0.1 );
	targets = getentarray( "tathere", "targetname" ); //targets
	
	level.enhelik thread abrams_aims_at_targets();
	wait( 1.2 );
for ( ;; )
	{
		shots = randomintrange( 4, 7 );
		for ( i = 0; i < shots; i++ )
		{
			self SetVehWeapon( "hind_FFAR" ); //set weapons
			//self SetVehWeapon( "cobra_Sidewinder");
			self fireWeapon();
			wait( 2.1 );
		}
		wait( randomfloatrange( 2, 4 ) );
	}
	
}

abrams_aims_at_targets()
{
	level.enhelik endon( "death" ); //same
	targets = getentarray( "tathere", "targetname" );
	for ( ;; )
	{
		for ( i = 0; i < targets.size; i++ )
		{
			self setturrettargetent( targets[ i ] );
			self waittill( "turret_on_target" );
			wait( randomfloat( 6, 10 ) );
		}
	}
	
}


The code I used is the exact same as the source files released for the m1a1 tank shoot. Mostly, but for helicopter, it's best to specify the weapon type. Any weapon can be used. I tried cannon, turret, missiles, sidewinder, FFAR, etc. And more flexibility like mentioned.

Hope this helps.
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

»