ok for bind
need for airstrike
ok for bind
need for airstrike
Last edited by goddzila; 11th January 2014 at 18:17.
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".
kung foo man (11th January 2014),serthy (16th August 2020),smect@ (12th January 2014)
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/
Last edited by goddzila; 12th January 2014 at 11:23.
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.
Last edited by kung foo man; 2nd September 2014 at 03:47. Reason: Merged 3 posts
set logfile 2
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.
Last edited by guiismiti; 2nd September 2014 at 17:23. Reason: found a bug
set logfile 2
- 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)
guiismiti (3rd September 2014)
another correction:
should be changed to:Code:bombs = level.airstrikeBombs;
Code:bombs = level.airstrikeBombsCount;
still in development:
http://social.xfire.com/video/62cc29
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.
Last edited by guiismiti; 20th September 2014 at 20:59.
kung foo man (21st September 2014)