Results 1 to 6 of 6

Thread: [CoD2] SWIMMING

  1. #1
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts

    [CoD2] SWIMMING

    Another great new achievement in the CoD2-Modding-History made by IzNoGod!

    http://www.xfire.com/video/5c7323/
    timescale 0.01

  2. #2
    Private
    Join Date
    Jul 2012
    Posts
    76
    Thanks
    9
    Thanked 56 Times in 38 Posts
    Expected something different
    I thought by swimming you meant swimming on the surface of the water. This is more like diving.
    Anyways, it looks amazing. This guy is so amazing and his newest creation...wow. Honestly, great work.

  3. The Following User Says Thank You to Peterlankton For This Useful Post:

    kung foo man (1st December 2012)

  4. #3
    Private First Class YuriJurek's Avatar
    Join Date
    Jun 2013
    Posts
    219
    Thanks
    152
    Thanked 88 Times in 47 Posts
    IzNoGod would you mind posting source code for this kind of swimming ?! It would be great !
    Thanks.

  5. #4
    Private First Class
    Join Date
    Dec 2012
    Posts
    127
    Thanks
    132
    Thanked 114 Times in 63 Posts
    Quote Originally Posted by kung foo man View Post
    Swimzoring by IzNoGod:


    PHP Code:
    #include std\player;

    swim()
    {
        
    swimspeed 200;
        
    swimfactor 0.05;
        
    swimcorrection 35.5//experimental random number (do not change)
        
    if(isdefined(self.swim_running) && self.swim_running)
            return; 
    //dont double-start thread
        
    waters getentarray("water""targetname");
        
    touching false;
        
    wastouching false;
        while(
    isdefined(self) && isdefined(self.sessionstate) && self.sessionstate == "playing")
        {
            
    wastouching touching;
            
    touching false;
            for(
    0waters.sizei++)
            {
                if(
    self istouching(waters[i]))
                {
                    
    touching true;
                    break;
                }
            }
            
    vec = (000);
            if(
    touching || wastouching)
            {
                
    fw anglestoforward(self getplayerangles());
                
    rg anglestoright(self getplayerangles());
                if(
    self leftButtonPressed())
                    
    vec -= rg;
                if(
    self rightButtonPressed())
                    
    vec += rg;
                if(
    self forwardButtonPressed())
                    
    vec += fw;
                if(
    self backButtonPressed())
                    
    vec -= fw;
                if(
    self leanleftButtonPressed())
                    
    vec -= (001);
                if(
    self leanrightButtonPressed())
                    
    vec += (001);
                
    vec vectornormalize(vec);
                
    vec maps\mp\_utility::vectorScale(vecswimspeed);
            }
            if(
    touching)
            {
                
    currentspeed self getVelocity();
                
    speed_diff vec currentspeed;
                
    speed = (speed_diff[0] * swimfactorspeed_diff[1] * swimfactorspeed_diff[2] * swimfactor swimcorrection * (0.5 self isonground()));
                
    self addVelocity(speed);
            }
            else if(
    wastouching && (vec[2] > swimspeed/10 || self jumpButtonPressed()))
            {
                
    currentspeed self getVelocity();
                
    currentspeed = (currentspeed[0], currentspeed[1], 250);
                
    self setvelocity(currentspeed);
            }
            
    wait 0.05;
        }
        if(
    isdefined(self))
            
    self.swim_running false;

    Found something (maybe the same) in thread @https://killtube.org/showthread.php?t=1407

  6. The Following 2 Users Say Thank You to Jeplaa For This Useful Post:

    kung foo man (12th November 2013),YuriJurek (12th November 2013)

  7. #5
    Private First Class YuriJurek's Avatar
    Join Date
    Jun 2013
    Posts
    219
    Thanks
    152
    Thanked 88 Times in 47 Posts
    Thank you for your answer, you've been very helpful.

  8. #6
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts

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

    kung foo man (12th November 2013)

Posting Permissions

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