Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 33

Thread: Fire direction/angles

  1. #11
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Video? I want to see how it looks

  2. #12
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    http://classic.xfire.com/video/62cecc/

    message me if you want the code, some things must also be set in the game type script, the gunship menu must be added so the players can call the function (or simply use F3 to start it), sounds and soundaliases, effects and maybe even more.

    Editted: I know that the ammo for the 25mm is not discounting - it's temporary for the tests. I'll also change the ammo hud color when current ammo goes under 1/3 of the max ammo.
    Last edited by guiismiti; 25th September 2014 at 19:20.

  3. The Following 2 Users Say Thank You to guiismiti For This Useful Post:

    kung foo man (25th September 2014),Ni3ls (25th September 2014)

  4. #13
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    I've been testing my mods now that I'm back, and I tested this gunship not as the user for the first time. I noticed the flashes go from the target to the shooter, and that looks really weird - the shots go from the ground to the pilot and beyond the ac130.

    What is the syntax here? Maybe I can fix it.

    Code:
    trace = bullettrace(point, point + forward, true, self);
    set logfile 2

  5. #14
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    nope, just rotate your normal 180 degrees using a vectorscale with -1 as scale on it (in playfx)
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  6. The Following User Says Thank You to IzNoGoD For This Useful Post:

    guiismiti (7th June 2015)

  7. #15
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    After loosing most of my work, I only corrected this now.

    In addition to IzNo's correction, I had also to change the source of the shot, by changing this
    Code:
    playfx(level._effect["ac25mm_tracer_flash"], trace["position"], normal);
    to this
    Code:
    playfx(level._effect["ac25mm_tracer_flash"], startpoint, normal);
    set logfile 2

  8. #16
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Since xfire is going down, I'll just leave this here

    https://www.youtube.com/watch?v=tzKUYd89_24


    Any ideas on how to highlight other players for the gunship gunner only? I know that team icons show up for same team players only, but not sure if this is hardcoded or what...
    Last edited by guiismiti; 10th June 2015 at 21:16.
    set logfile 2

  9. #17
    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
    Since xfire is going down, I'll just leave this here

    https://www.youtube.com/watch?v=tzKUYd89_24


    Any ideas on how to highlight other players for the gunship gunner only? I know that team icons show up for same team players only, but not sure if this is hardcoded or what...
    I know of 2 ways:

    1. Play an Fx (maybe a simple decal or light) on the players origin and do a hide() + showToPlayer() on the fx to the pilot only)
    2. use Huds lik in the zombie-gametypes

  10. The Following 2 Users Say Thank You to serthy For This Useful Post:

    guiismiti (10th June 2015),Mitch (10th June 2015)

  11. #18
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by guiismiti View Post
    Since xfire is going down, I'll just leave this here

    https://www.youtube.com/watch?v=tzKUYd89_24


    Any ideas on how to highlight other players for the gunship gunner only? I know that team icons show up for same team players only, but not sure if this is hardcoded or what...
    Not sure if you can use setTargetEnt() in COD2 MP, but in COD4, we did it with a waypoint:

    Code:
    ac130_AddtargetWaypoints( team )
    {
    	self.ac130_targetWaypoint = [];
    	
    	for( i = 0; i < level.players.size; i++ )
    	{
    		player = level.players[i];
    
    		if( !isAlive( player ) )
    			continue;
    		
    		if( level.teambased && player.pers["team"] != team )
    			continue;
    				
    		waypoint = NewClientHudElem( self );
    		waypoint.x = 0;
    		waypoint.y = 0;
    		waypoint.z = 0;
    		waypoint.archived = true;
    		waypoint.alpha = 1.0;
    		waypoint setShader( level.playerTargetShader, 8, 8 );
    		waypoint setWayPoint( true, level.playerTargetShader );
    		waypoint setTargetEnt( player );
    		
    		self.ac130_targetWaypoint[self.ac130_targetWaypoint.size] = waypoint;
    	}
    }
    The waypoint becomes "attached" to each player targeted, and follows them around.

  12. #19
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    Quote Originally Posted by Tally View Post
    Not sure if you can use setTargetEnt() in COD2 MP, but in COD4...
    setEntTarget() is CoD4 only, you can use Tally's code, but you need to set the origin of the hud every frame to the players origin (this looks abit laggy though)

  13. #20
    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 01:17.

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

    guiismiti (11th June 2015)

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
  •