Post: Object Physics
08-27-2012, 03:19 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Reasoning:
Well this was by no means hard or anything, but I didn't know what to do with this and I CBA to make something advanced with it. I hope you can use this to make better cars and such for MW2/Cod4 or w/e you please. I just made this to test with some physics, and I didn't have a use for it. Enjoy.

What does it do?
This is simple, it creates a crate that goes along with the terrain (like a vehicle). It uses simple functions (built in by IW) and it's pretty easy to use. It Won't run over big walls such as a barrier, and it won't go too crazy over jagged terrain.

To Spawn:
    
self thread crateMove();


    
crateMove()
{
crate = spawn("script_model", self.origin+(0,0,30));
crate setModel( "com_plasticcase_enemy" );
crate.angles = self.angles;
self PlayerLinkTo( crate, "tag_origin", 0.5 );
wait 4;
crate crateStart();
}
crateStart()
{
for(;Winky Winky
{
//use this ifront to keep going forward.
//ifront = BulletTrace( self.origin, anglesToForward(self.angles) * 5, 0, self)[ "position" ];
o = self.origin;
ifront = self.origin + (5,5,5000);
floor = BulletTrace( ifront, ifront - (0,0,9000), 0, self)[ "position" ];
if(distance(floor, o) > 100)
break;
angle = vectorToAngles( floor - o )[1];
angle += 360;
angle = int( angle ) % 360;
angle -= 90;
if(angle < 45 || angle > -45)
self rotateTo(vectorToAngles( floor - o ),0.3);
self moveTo(floor, 0.3);
wait 0.3;
}
}
(adsbygoogle = window.adsbygoogle || []).push({});

The following 9 users say thank you to Jakes625 for this useful post:

247Yamato, homeedog, KingcreekS, Kitty=^.^=, LightModz, JokerRey, Restxrt Modz, Uk_ViiPeR, xePixTvx
10-07-2012, 04:16 PM #11
Devil Child
Error… Cat invasion!
Originally posted by 247Yamato View Post
I know both :carling:


i realize now i meant to quote oyay
10-07-2012, 06:53 PM #12
Source Code
Bounty hunter
Originally posted by GAMER View Post
Reasoning:
Well this was by no means hard or anything, but I didn't know what to do with this and I CBA to make something advanced with it. I hope you can use this to make better cars and such for MW2/Cod4 or w/e you please. I just made this to test with some physics, and I didn't have a use for it. Enjoy.

What does it do?
This is simple, it creates a crate that goes along with the terrain (like a vehicle). It uses simple functions (built in by IW) and it's pretty easy to use. It Won't run over big walls such as a barrier, and it won't go too crazy over jagged terrain.

To Spawn:
    
self thread crateMove();


    
crateMove()
{
crate = spawn("script_model", self.origin+(0,0,30));
crate setModel( "com_plasticcase_enemy" );
crate.angles = self.angles;
self PlayerLinkTo( crate, "tag_origin", 0.5 );
wait 4;
crate crateStart();
}
crateStart()
{
for(;Winky Winky
{
//use this ifront to keep going forward.
//ifront = BulletTrace( self.origin, anglesToForward(self.angles) * 5, 0, self)[ "position" ];
o = self.origin;
ifront = self.origin + (5,5,5000);
floor = BulletTrace( ifront, ifront - (0,0,9000), 0, self)[ "position" ];
if(distance(floor, o) > 100)
break;
angle = vectorToAngles( floor - o )[1];
angle += 360;
angle = int( angle ) % 360;
angle -= 90;
if(angle < 45 || angle > -45)
self rotateTo(vectorToAngles( floor - o ),0.3);
self moveTo(floor, 0.3);
wait 0.3;
}
}


Its stuff like this that makes other scripts more detailed. Enzo

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo