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

Members Online

»
0 Active | 6 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 Scripting
Scripting and coding with Call of Duty 4.
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: Custom Killstreaks
Pokeloca
General Member
Since: Jul 31, 2009
Posts: 129
Last: Aug 19, 2012
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Wednesday, Apr. 28, 2010 07:49 pm
As you know, I've been making mods and mapping. I've been asking a lot of questions. This is because I am making a mod.

Is there any way I can get a custom killstreak to my mod? I want something easy like an AC130 flying above the map. Or maybe a explosion you can call in at 25 kills that kills everyone ( not necessarily a nuke )

Thanks,
Pokeloca.


PS: Deekciti, if you see this, I'll test out your kill trigger.
Share |
Xylozi
General Member
Since: Jul 12, 2008
Posts: 218
Last: Mar 1, 2012
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Wednesday, Apr. 28, 2010 08:44 pm
To add a new killstreak, you'll need to start by editing this function:

Code:
giveHardpointItemForStreak()


And adding the new killstreaks conditions. In response to adding something like an AC130, it is not as easy as it may seem. You'll need to do several things such as spawning the AC130 model, connecting and hiding the player, making the AC130 move and ensure that the function won't mess up if the player disconnects, dies, etc.
Share |
Pokeloca
General Member
Since: Jul 31, 2009
Posts: 129
Last: Aug 19, 2012
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Wednesday, Apr. 28, 2010 08:53 pm
I know, I realized when i posted this it wouldnt be easy. For putting in a nuke, how would i edit this:
Quote:
giveHardpointItemForStreak()
Share |
Xylozi
General Member
Since: Jul 12, 2008
Posts: 218
Last: Mar 1, 2012
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Wednesday, Apr. 28, 2010 09:17 pm
Go to that function, and where it says:

Code:

else if ( streak == 7 )
{
 // helicopter stuff
}


Under that add a new else if statement, such as:

Code:
else if ( streak == 10 ) 		
{
 // Do nuke stuff.
}


Obviously you will need to work out how to make the nuke yourself, but that new else if statement will now check when the player has 10 kills and thread the stuff to do with the nuke.
Share |
Pokeloca
General Member
Since: Jul 31, 2009
Posts: 129
Last: Aug 19, 2012
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Saturday, May. 1, 2010 04:50 pm
Quote:

else if ( streak == 7 )
{
// helicopter stuff
}
Under that add a new else if statement, such as:
Code:
else if ( streak == 10 )
{
// Do nuke stuff.
}

Obviously you will need to work out how to make the nuke yourself, but that new else if statement will now check when the player has 10 kills and thread the stuff to do with the nuke.



I still dont know how to do this. Can you make a thorough tutorial?
Share |
Pokeloca
General Member
Since: Jul 31, 2009
Posts: 129
Last: Aug 19, 2012
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Sunday, May. 2, 2010 02:09 am
Hello? Anyone?
Share |
Samuel033
General Member
Since: Dec 10, 2009
Posts: 484
Last: Dec 25, 2015
[view latest posts]
Level 5
Category: CoD4 Scripting
Posted: Sunday, May. 2, 2010 07:59 am
Everything you need is in the hardpoints file. As above, add something like "nuke_mp" just like "airstrike_mp" with whatever kill number requirement you want.

hardpointItemWaiter() is the thread that waits for the player to change the current weapon. If he changes to the hardpoint weapon it will give whichever one the player has. Add the nuke to the same cases as uav and airstrike. For starters follow the uav (radar_mp) example. triggerHardpoint( hardpointType ) tells the game to activate whichever the player has at the moment. In your case the simplest thing to do is play the stock nuke flash fx file, wait 3 seconds or whatever it is, then use the damageents function to apply the damage to all players.

You will see some lines like self iPrintLnBold( &"AIRSTRIKE_AVAILABLE"). That prints the award to the screen. Replace &"AIRSTRIKE" with whatever text you want. The CAPS versions the game use are localized strings... meaning they refer to whatever language the player speaks. English. Russian. However you cannot do that so put "You have been awarded a nuke".

Start with just awarding the bomb. No animations or anything like that. One thing I do not know offhand is how to do is tell the game the map is over after you kill everyone off but its a simple function call. Later on after you get this part working if you want the airstrike follow those functions. You can use altered versions of them to get what you want.
Share |
DemonSeed
General Member
Since: Apr 30, 2009
Posts: 1362
Last: Feb 19, 2018
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Sunday, May. 2, 2010 08:04 am
Adding the AC130 is not "easy". Its very advanced coding. But if you want to have a go at it, go ask the X4 boys over at the eXtreme+ mod forums. There you will be able to get the raw files for their AC130.

The X4 team can be found here:

http://www.mycallofduty.com/index.php
Share |
tHMatt
General Member
Since: Sep 11, 2007
Posts: 473
Last: Mar 20, 2013
[view latest posts]
Level 5
Category: CoD4 Scripting
Posted: Sunday, May. 2, 2010 01:14 pm
What sort of AC130 do you want?

I coded an Ambient AC130, so you call it in after 12 killstreaks, but instead of controlling it yourself, it just circles you on the map, covering you from enemy players, it also moves and relocates as you move around the map. It has 3 fire modes that it selects randomly (aslong as they arent reloading) The kills it gets, are added to your score.

Here is a quick video >

http://www.xfire.com/video/29a765/

I can give you the whole code to that if you want, I have no use anymore
Share |
DemonSeed
General Member
Since: Apr 30, 2009
Posts: 1362
Last: Feb 19, 2018
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Sunday, May. 2, 2010 01:42 pm
The X4 one is manned, as is the one Im working on. Like the one in MW2.

Im waiting to finalize whats going into my next release in terms of models (im hitting the limits now), and if my sentry gun goes according to plan, I will drop the AC130 but if anyone wants to take it over, they are welcome to it.
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 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

»