Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Patonki

Pages: [1]
1
Modification Help / Rotating Vehicles on Projectile Collision.
« on: August 19, 2008, 09:47:39 AM »
I'm back with another question. I basically want my projectile to rotate a vehicle to a certain angle, ignoring the current angle. I think I got my projectile to only react to vehicles, but I'm still stumped about rotating them. Help would be appreciated.

2
Modification Help / Re: Two different projectiles.
« on: August 09, 2008, 03:49:30 PM »
I figured it out myself. Thanks for the help!

3
Modification Help / Re: Two different projectiles.
« on: August 06, 2008, 09:21:18 AM »
Sorry for the shameless self-bump, but if someone would fix
Quote
function 2projectilegunImage::onFire(%this, %obj, %slot)
{
  %projectile = primaryProjectile;
  %projectile1 = secondaryProjectile;
  %p = new Projectile()
  {
         dataBlock = %projectile;
         initialVelocity = vectorScale(%obj.getMuzzleVector(%slot),%projectile.muzzleVelocity);
         initialPosition = %obj.getMuzzlePoint(%slot);
         sourceObject = %obj;
         sourceSlot = %slot;
         client = %obj.client;
  };
  MissionCleanup.add(%p);
  %v = new Projectile()
  {
         dataBlock = %projectile1;
         initialVelocity = vectorScale(%obj.getMuzzleVector(%slot),%projectile1.muzzleVelocity);
         initialPosition = %obj.getMuzzlePoint(%slot);
         sourceObject = %obj;
         sourceSlot = %slot;
         client = %obj.client;
  };
  MissionCleanup.add(%v);
}
and test if it works ingame. I don't mind testing it myself, It's just that it usually takes a long time before I get answered. Sorry for all the trouble.

4
Modification Help / Re: Two different projectiles.
« on: August 04, 2008, 03:03:23 PM »
I tried both, but looking for the two projectiles.
My weaponimage is as it's stated.

5
Modification Help / Re: Two different projectiles.
« on: August 04, 2008, 10:08:28 AM »
Ah, sorry, I should'w told you I tried it too. Sorry, my fault. Again.

Depending on the angle, the distance where the projectile runs function 1 varies, and sometimes doesn't run function 2 at all. I'm beginning to think that the script for two projectiles is the way to go.

I know I'm asking a lot, but please help me.

6
Modification Help / Re: Two different projectiles.
« on: August 04, 2008, 04:47:42 AM »
I got
Quote
function SimplierProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
   %distancefromplayer = VectorDist(%obj.getPosition(),%col.getPosition());
   if(%distancefromplayer < 1)
      {
         (function1)
      }
      else
      {
         (function2)
      }
}
to almost work by stating that the client is %obj.

It only works in a certain angle.

But the function 1 comes up way too far. Even 1 isn't short enough, and if I go under, it won't work. I'd like to perform function 1 at point blank or bit farther. 

And SpaceGuy, your script dosn't work, sorry. Thanks for the help!

7
Modification Help / Re: Two different projectiles.
« on: August 03, 2008, 03:44:58 PM »
Yes. It shoots neither.

8
Modification Help / Re: Two different projectiles.
« on: August 03, 2008, 02:09:47 PM »
Ah, something painfully obvious must be wrong here.
Quote
function 2projectilegunImage::onFire(%this, %obj, %slot)
{

%projectile = primaryProjectile;
%projectile1 = secondaryProjectile;
%p = new (primaryProjectileType)()
      {
         dataBlock = %projectile;
         initialPosition = %obj.getMuzzlePoint(%slot);
         sourceObject = %obj;
         sourceSlot = %slot;
         client = %obj.client;
};
MissionCleanup.add(%p);
%v = new (secondaryProjectileType)()
      {
         dataBlock = %projectile1;
         initialPosition = %obj.getMuzzlePoint(%slot);
         sourceObject = %obj;
         sourceSlot = %slot;
         client = %obj.client;
      };
         MissionCleanup.add(%v);
}
Keep in mind, that I'm not that good at scripting. If someone would point out what to add/remove, that would be golden. Thanks.

9
Modification Help / Re: Two different projectiles.
« on: August 03, 2008, 05:13:09 AM »
I quoted that wrong.  I have my functions, and my projectile is called SimplierProjectile. Sorry, my fault.
And is this the new projectile code?
Quote
      %p = new (%this.projectileType)()
      {
         dataBlock = %projectile;
         initialVelocity = %velocity;
         initialPosition = %obj.getMuzzlePoint(%slot);
         sourceObject = %obj;
         sourceSlot = %slot;
         client = %obj.client;
From the Saw-Off Shotgun by Ephialtes

I see a lot of '%this.projectile' in there, which I assume means the default projectile. What should I replace it with?

10
Modification Help / Re: Two different projectiles.
« on: August 02, 2008, 05:24:27 PM »
Can you post the code, if that's not too much to ask?

Also
Quote
function SimplierProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
   %distancefromplayer = VectorDist(%obj.getPosition(),%col.getPosition());
   if(%distancefromplayer < 100)
      {
         (function1)
      }
      else
      {
         (function2)
      }
}
Doesn't seem to work for me.

Thanks for your help so far!

11
Modification Help / Re: Two different projectiles.
« on: August 02, 2008, 07:13:58 AM »
Look at a weapon like the shotgun for code on making a projectile.
This is where I run into trouble. The shotgun codes create the same projectile over again. Sorry if this sounds stupid, but could you give me an example? If my first projectile is called 'primaryprojectile' and the second 'secondaryprojectile', where in the code do I state this?

or

If it's any simplier, making the same projectile do two different actions depending on the distance from the player. I'm thinking something like
Quote
function SimplierProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
   if(%distancefromplayer < 100)
      {
         (function1)
      }
      else
      {
         (function2)
      }
}
But how do I state that %distancefromplayer is the actual distance? Again, this may sound very newbish, sorry.
Then again, I might be wrong. Help would be appreciated.

Thanks.

12
Modification Help / Two different projectiles.
« on: July 31, 2008, 06:54:32 PM »
Is there any way to make a weapon shoot two projectiles with different actions on collision at the same time? If there is, then please help me out here. I don't know that much about scripting.

Thanks.

Pages: [1]