MuhhammedJihad
Posts: 8
01:45 AM 27/09/2009 |
I wont to add physicsExplosionSphere to a projectile, and I dont know how.
Is there a way, so that when i shoot, that the ExplosionSphere will follow the projectile and push stuff out of the way?
Cheers.
|
Snakelet
(xfire: snakelet)
OBS Dev
Posts: 1330
05:41 AM 27/09/2009 |
The guns in COD4 don't fire projectiles, so firstly you need to make them fire projectiles. The RPG is a projectile, so thats a good starting point. I am unsure if you can attach the physics explosion, but to me it sounds like it should be possible, you will just have to await Falcar's programmer response
|
Crunchy
(xfire: crunchydeath)
Posts: 98
07:24 AM 27/09/2009 |
if we find out how to do this can we add it to our rockets?
|
Falcar
(xfire: seamusthefamous)
OBS Dev
Posts: 526
08:35 AM 27/09/2009 |
For grenades it's easy, something like the RPG or grenade launcher is more difficult... use something along these lines for a "force nade"
watchForceNadeThrow() {
self endon( "death" ); self endon( "disconnect" );
while( 1 ) {
self waittill( "grenade_fire", entity, weaponName );
if( weaponName == "forcenade_mp" ) entity thread forceBubble();
} }
forceBubble(){
self endon( "death" );
while( 1 ) {
physicsExplosionSphere( self.origin, 200, 100, 1 ); wait( 0.05 );
} }
|
Falcar
(xfire: seamusthefamous)
OBS Dev
Posts: 526
08:36 AM 27/09/2009 |
stupid forums killed my formatting, ps snakelet i still hate this stupid auto-space-between-lines bsness (having to press shift-enter if you want two lines without a gap)
|
MuhhammedJihad
Posts: 8
09:14 AM 27/09/2009 |
and where do i put all that?
|
Snakelet
(xfire: snakelet)
OBS Dev
Posts: 1330
09:19 AM 27/09/2009 |
You will have to put it in a script file and compile it into a mod...
|
MuhhammedJihad
Posts: 8
09:30 AM 27/09/2009 |
I meant which script file?
|
Falcar
(xfire: seamusthefamous)
OBS Dev
Posts: 526
10:54 AM 27/09/2009 |
Doesn't matter, as long as the first thread is called upon them at spawn.
|
MuhhammedJihad
Posts: 8
06:13 AM 28/09/2009 |
It didnt work.
To clarify, I want the Explosion Sphere to start as soon as it has been fired and while it is travelling through the air.
|
Snakelet
(xfire: snakelet)
OBS Dev
Posts: 1330
06:34 AM 28/09/2009 |
Falcar did state you would need to "use something along these lines". You will still need to work out how exactly to program it so that it works how you want it to behave.
|
Falcar
(xfire: seamusthefamous)
OBS Dev
Posts: 526
07:03 AM 28/09/2009 |
If it didn't work I'm confident it's because of something you did wrong. You clearly don't know how to program in cod, so I'd recommend trying something easier until you have an idea of what you're doing.
|