Spawning Projectiles

This is the development community to discuss tribes mod coding or to ask questions.

Moderator: Moderators

1 Mon Jul 26, 2010 9:31 pm

When using the Projectile::spawnProjectile function, how do I assign an owner to the projectile? Let's say I wanted to spawn random projectiles from the sky, but I wanted the kills to count as my own. How would I do it?
Griever
Spambot in training
Spambot in training
 
Posts: 8

2 Tue Jul 27, 2010 3:53 am

Projectile::spawnProjectile(Object, Trans, ShootId, ShootVel, <TargetObj>)

    Object: The projectile data block name to be spawned. Look in BaseProjData.cs for projectile names.
    Trans: The transform of the shooters weapon.
    ShootId: The Id of the shooter. Example: 8361.
    ShootVel: The velocity of the shooter.
    TargetObj: An object for the projectile lock-on and target.
    USED IN: Currently not used in any script files.
    RETURN: True if succeed or -1 if failed.
    Used to spawn a projectile.
      For Example:
        Trans = GameBase::getMuzzleTransform(Player Id);
        ShootVel = Item::getVelocity(Player Id);
        Projectile::spawnProjectile("DiscShell", Trans, ShootId, ShootVel);
User avatar
Perrinoia
Suggestion bot 9000
 
Posts: 9386

3 Tue Jul 27, 2010 9:05 pm

Ty
Griever
Spambot in training
Spambot in training
 
Posts: 8

4 Thu Jul 29, 2010 7:04 am

User avatar
Perrinoia
Suggestion bot 9000
 
Posts: 9386


Return to Coder's Hangout

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest