Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 26

Thread: Standalone Airstrike CoD2

  1. #11
    Private
    Join Date
    Jan 2014
    Posts
    26
    Thanks
    1
    Thanked 9 Times in 5 Posts
    ok for bind

    need for airstrike
    Last edited by goddzila; 11th January 2014 at 19:17.

  2. #12
    Private
    Join Date
    Jan 2014
    Posts
    26
    Thanks
    1
    Thanked 9 Times in 5 Posts
    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))

  3. #13
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by goddzila View Post
    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".

  4. The Following 3 Users Say Thank You to Tally For This Useful Post:

    kung foo man (11th January 2014),serthy (16th August 2020),smect@ (12th January 2014)

  5. #14
    Private
    Join Date
    Jan 2014
    Posts
    26
    Thanks
    1
    Thanked 9 Times in 5 Posts
    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 12:23.

  6. #15
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    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:
    Code:
        thread maps\mp\gametypes\_addairstrike::addAirstrike(attacker);
    And this is _addairstrike.gsc:
    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();
        }

    The result - I can see the "Use your binoculars" message, but when I do it nothing happens.

    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 04:47. Reason: Merged 3 posts
    set logfile 2

  7. #16
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    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 18:23. Reason: found a bug
    set logfile 2

  8. #17
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    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:
    Click image for larger version. 

Name:	Air_Strike_inventory_icon_WaW.png 
Views:	63 
Size:	2.8 KB 
ID:	745

    Click image for larger version. 

Name:	Strike_Chain_MOAB_HUD_Icon.png 
Views:	85 
Size:	2.4 KB 
ID:	746

    Click image for larger version. 

Name:	Rolling_Thunder_HUD_icon_BO.png 
Views:	63 
Size:	7.4 KB 
ID:	747
    Last edited by guiismiti; 3rd September 2014 at 19:51.

  9. #18
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    Quote Originally Posted by guiismiti View Post
    I wanna change it to the one used in COD4 airstrike.
    - 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)

  10. The Following User Says Thank You to serthy For This Useful Post:

    guiismiti (3rd September 2014)

  11. #19
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    another correction:
    Code:
    bombs = level.airstrikeBombs;
    should be changed to:

    Code:
    bombs = level.airstrikeBombsCount;

  12. #20
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    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 21:59.

  13. The Following User Says Thank You to guiismiti For This Useful Post:

    kung foo man (21st September 2014)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •