Page 3 of 3 FirstFirst 123
Results 21 to 30 of 33

Thread: Fire direction/angles

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by Tally View Post
    No, it's in COD2 for sure but it must be Single Player only.
    Indeed, it is only available in SP. But it might be possible to port it to MP.
    Edit: isn't in SP either. I posted the wrong function.. (for turret).

    COD4
    PHP Code:
    int __cdecl sub_808F8EA(int a1)
    {
      
    int *v1// ebx@2
      
    int result// eax@3
      
    char v3// [sp+8h] [bp-10h]@0

      
    if ( HIWORD(a1) == )
      {
        
    v1 = &dword_8335620[43 * (unsigned __int16)a1];
      }
      else
      {
        
    sub_815F134("not a hud element");
        
    v1 0;
      }
      
    result sub_80C76EC(0);
      
    v1[4] = *(_DWORD *)result;
      if ( !(*(
    _BYTE *)(result 246) & 0x10) )
        
    result sub_81228D4(
                   
    15,
                   
    "SetTargetEnt() called on a non-broadcasting entity, may not show in client snapshots.",
                   
    v3);
      return 
    result;

    COD2 turrent setTargetEntity (not a hud function, oops).
    PHP Code:
    int __cdecl GScr_SetTargetEntity(int a1)
    {
      
    char *v1// ebx@2
      
    int v2// ebx@3
      
    int result// eax@3
      
    char v4// al@5
      
    int v5// eax@5
      
    int v6// ebx@5

      
    if ( HIWORD(a1) )
      {
        
    Scr_ObjectError("not an entity");
        
    v1 0;
        if ( 
    v10C )
          goto 
    LABEL_3;
      }
      else
      {
        
    v1 = (char *)&g_entities 508 * (unsigned __int16)a1;
        if ( *((
    _DWORD *)v1 67) )
        {
    LABEL_3:
          
    v2 = *((_DWORD *)v1 67);
          
    result Scr_GetEntity(0);
          *(
    _DWORD *)(v2 16) = result;
          return 
    result;
        }
      }
      
    v4 SL_ConvertToString(*((_WORD *)v1 140));
      
    v5 va("entity type '%s' is not a turret"v4);
      
    Scr_Error(v5);
      
    v6 = *((_DWORD *)v1 67);
      
    result Scr_GetEntity(0);
      *(
    _DWORD *)(v6 16) = result;
      return 
    result;

    Last edited by Mitch; 13th June 2015 at 11:29.

  2. The Following User Says Thank You to Mitch For This Useful Post:

    serthy (11th June 2015)

  3. #2
    Private
    Join Date
    Jun 2013
    Posts
    70
    Thanks
    20
    Thanked 32 Times in 26 Posts
    hi, i do it this way
    PHP Code:
    init()
    {
    precacheshader("finder_icon");
    }

    markfounded(target,size)
    {
    scale int(size);
        
    //self endon("disconnect");
        
        
    target_mark newClientHudElem(self);
        
    target_mark.target[0];
        
    target_mark.target[1];
        
    target_mark.target[2] + 28;
        
    target_mark.archived true;
        
    target_mark.alpha 1;
        
    target_mark.color = (1,0,0);
        
    target_mark setShader("finder_icon"scalescale);
        
    target_mark setwaypoint(true);

        
    wait .05;
        
    target_mark destroy();

    }


    canseeinview()
    {
    self endon("disconnect");
    max_viewangle 15;
    if(
    isdefined(self.isbot))
    if(
    self.isbot) return;

    for(;;)
    {
            while(
    self playerads() == 1)//aim only
            
    {
            if (
    self getcurrentweapon() != "enfield_mp")//your gun
            
    break;
            
            
    players getentarray("player""classname");
            for(
    0players.sizef++)
            {
            
    //wait .05;
            
    player players[f];
            
            if(
    player == self )
            continue;
            
            
    //if((isdefined(player.pers["team"]) && player.pers["team"] == "spectator"))
                    //continue;
                    
            
    if (!isalive(player) ||player.sessionstate != "playing")
            continue;

        
    dist2 vectornormalize(player.origin self.origin);
        
        
    vfwd anglestoforward(self getplayerangles());
        
    dot vectordot(vfwddist2);
        if (
    dot 1)
            
    dot 1;
        else if (
    dot < -1)
            
    dot = -1;
            
        
    viewangle acos(dot);
        if (
    viewangle max_viewangle)
            continue;
            
        
    test bullettracepassed(self geteye(),player geteye(),false,self);
    if(
    test)
    self thread markfounded(player.origin,8);

    }
    wait .05;
    }
    wait .05;
    }

    here u can see it in action just use targetfinder gun or wait for ac
    Server IP: 217.172.178.19:28979 (V1.2)
    Last edited by vanfreddy; 11th June 2015 at 00:17.

  4. The Following User Says Thank You to vanfreddy For This Useful Post:

    guiismiti (11th June 2015)

  5. #3
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    If I'm not asking too much, could you upload your finder icon shader please? I only have 1.3 installed, I'd like to see how it is. The code works well.


    Editted amazing...
    Last edited by guiismiti; 11th June 2015 at 01:26.
    set logfile 2

  6. #4
    Private
    Join Date
    Jun 2013
    Posts
    70
    Thanks
    20
    Thanked 32 Times in 26 Posts

  7. The Following User Says Thank You to vanfreddy For This Useful Post:

    guiismiti (11th June 2015)

  8. #5
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    https://.../libcod/binaries.7z
    Contains both 1.0 binary for MP and SP.
    Last edited by kung foo man; 11th June 2015 at 15:26. Reason: Please share such stuff per PM/Steam, not sure on legal issues

  9. The Following User Says Thank You to Mitch For This Useful Post:

    filthy_freak_ (12th June 2015)

  10. #6
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Changing topic again, but still with the AC-130, not sure if I can solve this one.

    I simply like the fire sounds from COD4, but I can't find them.
    I know I can find the regular weapon sounds in the mod tools, but not the AC-130.

    I found this, in a sound aliases file (common.csv) from the mod tools:
    Code:
    #AC-130 Weapon Sounds,,,,,,,,,,,,,,,,,,,,,,,
    ac130_gunready,,null.wav,1,1,na,,,750,12000,auto,,,,0.9,ac130,,,,,,,,
    ac130_25mm_fire,,ac130/ac130_25mm_fire_rev01sh2.wav,0.37,0.37,explosion,0.7,0.7,11500,12000,weapon2d,,,,0.9,ac130,,,,,,ac130weapon,,0.3
    #ac130_25mm_fire,,ac130/ac130_25mm_fire_rev01sh2.wav,0.18,0.18,explosion,1.1,1.1,11500,12000,weapon2d,,,,0.9,ac130,,,,,,,,0.1
    ac130_40mm_fire,,ac130/ac130_40mm_fire_c2.wav,0.75,0.8,explosion,0.85,0.95,11500,12000,weapon2d,,,,0.9,ac130,,,ac130_40mm_reload,,,ac130weapon,,0.5
    #ac130_40mm_fire,,weapons/test/ac130_40mm_fire_d1.wav,1,1,explosion,0.85,0.95,11500,12000,weapon2d,,,,0.9,ac130,,,ac130_40mm_reload,,,,,0.2
    #ac130_40mm_fire,,weapons/50cal/weap_50cal_temp_v2.wav,1,1,explosion,0.9,0.9,11500,12000,weapon2d,,,,0.9,ac130,,,ac130_40mm_reload,,,,,0.2
    #ac130_40mm_fire,,ac130/ac130_40mm_fire_rev01.wav,0.21,0.21,explosion,1.25,1.35,11500,12000,weapon2d,,,,0.9,ac130,,,ac130_40mm_reload,,,,,0.2
    ac130_105mm_fire,,ac130/ac130_105canon_fire.wav,0.45,0.45,explosion,0.7,0.8,11500,12000,weapon2d,,,,0.9,ac130,,,ac130_105mm_reload,,,ac130weapon,,0.65
    #ac130_105mm_fire,,ac130/ac130_105canon_fire.wav,0.2,0.2,explosion,0.7,0.8,11500,12000,weapon2d,,,,0.9,ac130,,,ac130_105mm_reload,,,,,0.4
    ac130_40mm_reload,,ac130/ac130_40mm_reload.wav,0.3,0.3,explosion,0.95,1.05,11500,12000,reload2d,,,,0.9,ac130,,,,,1000,ac130weapon,,
    #ac130_40mm_reload,,ac130/ac130_40mm_reload.wav,0.12,0.12,explosion,0.95,1.05,11500,12000,reload2d,,,,0.9,ac130,,,,,1000,,,
    ac130_105mm_reload,,ac130/ac130_105canon_reload.wav,0.7,0.7,explosion,0.9,0.9,11500,12000,reload2d,,,,0.9,ac130,,,,,2000,ac130weapon,,
    #ac130_105mm_reload,,ac130/ac130_105canon_reload.wav,0.12,0.12,explosion,0.95,1.05,11500,12000,reload2d,,,,0.9,ac130,,,,,2000,,,
    ac130_weapon_switch,,user_interface/ui_text_beep1.wav,0.25,0.25,vehicle,1.5,1.6,500000,,local2,,,,0.9,ac130,,,,,,,,
    Tried googling the wav file names, no success.

    Anybody has any idea? It should be ripped somewhere.
    set logfile 2

  11. #7
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    wav files are compiled into the .ff and as far as i know there is no way to extract them again (unless you record them ingame ofcourse)
    For stock sounds you could look in the raw/sound folder, but there is no ac130 folder in there
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  12. #8

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

    guiismiti (25th September 2015)

  14. #9
    Private First Class
    Join Date
    Oct 2013
    Posts
    219
    Thanks
    56
    Thanked 105 Times in 66 Posts
    http://tom-crowley.co.uk/downloads/

    "Tom FastFile Extractor"

  15. The Following User Says Thank You to filthy_freak_ For This Useful Post:

    guiismiti (25th September 2015)

  16. #10
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    The only method that worked was the sounds ripping. The rest only worked for scripts.

    Anyway, I'm uploading the sounds I got. Had to do some additional stuff, since cod wouldn't accept the sounds right after I saved them from Audacity, saying they were corrupted. Still had to convert them.
    Also, couldn't get the 40mm fire sound (I'll try to make a mod for singleplayer, changing the ac130 ambient sound volume to zero, then record it).
    Attached Files Attached Files
    set logfile 2

Tags for this Thread

Posting Permissions

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