ok for bind
need for airstrike
Printable View
ok for bind
need for airstrike
DoAirstrike()
{
self endon("disconnect");
if(isDefined(level.airstrikeUse) && level.airstrikeUse != "")
self iPrintlnBold(level.airstrikeUse);
self waittill("binocular_fire"); <==================================== for:this:I need
targetPos = GetTargetedPos();
if(isDefined(level.airstrikeIncommingText) && level.airstrikeIncommingText != "")
iPrintln(level.airstrikeIncommingText);
if(isDefined(targetPos))
That is an engine notification - when you raise your binoculars, the game notifies you "binocular_enter"; when you lower them, it notifies you "binocular_exit". You don't have to do anything. The game does it for you.
They are left over notifications from COD:United Offensive - in that game, you fired artillery with the binoculars you acquired when you were a certain rank. The game notified itself that the binoculars had been raised, and then there was a function to monitor for the attackbutton pressed. Then, it targeted what the player was looking at, and fired the artillery on their position. It ended on lowering the binoculars with the notification "binocular_exit".
I need more buttons because I need to sentrygun. airstrike and nuke but thanks anyway.
Now I nuke currently put on a headshot kill
http://fr.xfire.com/video/61be00/
Can anybody give me a hand?
What I'm trying to do is - enable air strike for the player when he kills 5 enemies without dying.
- Setup() from _airstrike.gsc is being called in Callback_StartGameType() from tdm.gsc as it is instructed in the first post
- both corrections were made (from kung foo man and goddzila)
- in Callback_PlayerKilled from tdm.gsc I'm calling this:
And this is _addairstrike.gsc:Code:thread maps\mp\gametypes\_addairstrike::addAirstrike(attacker);
The result - I can see the "Use your binoculars" message, but when I do it nothing happens.PHP Code:
addAirstrike(attacker)
{
if(attacker.pers["kill_spree"] > 999)
attacker.pers["kill_spree"] = 0;
killcount = undefined;
self.pers["kill_spree"] = 0;
attacker.pers["kill_spree"]++;
killcount = attacker.pers["kill_spree"];
if(killcount == 5)
{
attacker iprintlnBold("^3Use your binoculars to call air support.");
attacker thread maps\mp\gametypes\_airstrike::DoAirstrike();
}
}
By the way, the console is not reporting any errors.
Lol, instead of pressing "F" I've been pressing the regular fire button (mouse 1) all the time.
Anyway, the code I posted is working and should allow the player to use air strike after 5 frags in a row. :)
Made a mod from the script:
https://www.youtube.com/watch?v=iNEwG3D8EIQ
Modifications:
- Implemented the modifications reported by kung foo man and goddzila;
- You need a 5 killstreak to be able to use the air strike - you can change it in _addAirstrike.gsc;
- When you die, you loose your air strike (to avoid stacks... e. g. someone who died without using it would be able to use twice after another 5 killstreak);
- Changed the models of the planes - it's a spitfire if you're in an allied team, and a stuka if you're axis;
- Added sound to the bomb explosions;
- Added sound to the planes - it's the spitfire flyby sound if you're in an allied team, and a stuka if you're axis;
- Increased the height of the plane route from 400 to 600;
- All changes to ctf/dm/hq/sd/tdm.gsc can be found by searching for the word airstrike. Total of two changes in each file;
- Changed the "Press F (...)" message to "Press [[{+activate}]] (...)", so players who have changed the key of the activate fuction will see the proper key in the message.
http://www.speedyshare.com/yNeGZ/dow...-airstrike.iwd
Bug - I had to add self endon spawn to avoid players stacking multiple airstrikes - if a player uses the airstrike, dies and spawns before the plane is gone, the plane won't get deleted (you can even see it in the video).
Another detail - you might need to adjust the number of bombs dropped depending on the size of your map.
One doubt remaining... the type of weapon used is not defined on airstrike. How can I do it? You can see in the video that, when a player dies, the hud weapon image is a skull - I wanna change it to the one used in COD4 airstrike.
Like these:
Attachment 745
Attachment 746
Attachment 747
- create a new custom weapon (or modify a standard one)
- in the weaponfile change the name of the hud indicator to your new material (guess its prefixed with 'hud_')
- precache the weapon in script
- call obituary( arg0 , arg1 , your_weapon_name , arg3 , ... ); (if the weaponfile is corrupted or not precached/does not exist the default deathicon/skull is shown)
remember: you can only precache a specific amount of weapons (32 or 64)
another correction:
should be changed to:Code:bombs = level.airstrikeBombs;
Code:bombs = level.airstrikeBombsCount;
still in development:
http://social.xfire.com/video/62cc29
:p
by the way, the first matrix I made was 30x15 (so, 450 elements...), and then I found out that it appears I cannot have more than 256 (or so) elements in a single menu. Now it's a 20x10 matrix (200 elements, still good enough).
The background image depends on the map - I added one element with a full screen image for each map of the server, and there's a dvartest to display the image or not.
What is not working so far:
4:3 isn't working. The background image is fullscreen (which is relative to the ratio of your screen). So, if you use 4:3, the menu elements will be in the wrong positions, since they have an absolute origin value, and not a relative (fullscreen is relative). The solution to this would be to use relative origin values for the elements, but right now I don't know how to do that.