Author Topic: Grenade Launcher Help!  (Read 1587 times)

I'm making a grenade launcher but i got a cs script and i got 2 problems:
1. The cs file uses the gun bullet how do i get like a grenade partical thingy?
2. how do I package an add-on?
heres my model


here is the bullet
« Last Edit: November 02, 2008, 02:16:35 PM by g12345389 »

1. The cs file uses the gun bullet how do i get like a grenade partical thingy?
Instead of using a particle for the grenade, make another model.

2. how do I package an add-on?
Look at existing add-ons to find out how there packaged

heres my model
Please, give it some color.

Instead of using a particle for the grenade, make another model. How?
Look at existing add-ons to find out how there packaged Ok
Please, give it some color. How?
the fire and the last thing, I don't know how to do, but thanks for the help,
where i put bullet? in shapes folder?\
Code: [Select]
datablock ProjectileData(<YOURWEAPONNAME>Projectile)
{
   projectileShapeName = "./shapes/bullet.dts";
   directDamage        = 30;
   directDamageType    = $DamageType::<YOURWEAPONNAME>;
   radiusDamageType    = $DamageType::<YOURWEAPONNAME>;

   brickExplosionRadius = 0;
   brickExplosionImpact = true;          //destroy a brick if we hit it directly?
   brickExplosionForce  = 10;
   brickExplosionMaxVolume = 1;          //max volume of bricks that we can destroy
   brickExplosionMaxVolumeFloating = 2;  //max volume of bricks that we can destroy if they aren't connected to the ground

   impactImpulse      = 700;
   verticalImpulse   = 1000;
   explosion           = <YOURWEAPONNAME>Explosion;
   particleEmitter     = bulletTrailEmitter;

   muzzleVelocity      = 90;
   velInheritFactor    = 1;

   armingDelay         = 00;
   lifetime            = 4000;
   fadeDelay           = 3500;
   bounceElasticity    = 0.5;
   bounceFriction      = 0.20;
   isBallistic         = false;
   gravityMod = 0.0;

   hasLight    = false;
   lightRadius = 3.0;
   lightColor  = "0 0 0.5";
};
  i need and explosion partical, to make it fall a bit instead of going straight, and i wand it to blow up on collision. can you help me with that?
« Last Edit: November 02, 2008, 02:22:37 PM by g12345389 »

You create a separate model, just a regular grenade shape of your design and make sure you position it at the middle of the 3D grid. That's all really, you might also want to color your grenade.

As for coloring, you need to make a Material, and give that material a color texture: http://forum.blockland.us/index.php?topic=49315.0

Currently Blockland has some scripted color-shift stuff, you can find more on this in one of the Flatshading guides. Basically it lets you re-color a model simply by changing a line in your weapon script, good stuff.

ok i textured, exported my models of the grenade and grenade launcher, i have a cs file, now what do i change to make it fire my grenade instead of a bullet?
heres bullet
« Last Edit: November 02, 2008, 02:17:03 PM by g12345389 »

oh and also how do i get the colors from milkshape to a pgn file? or something like that, and the server cs, how do i make that?

Change the name of the Grenade from Bullet to GLBullet

I have a feeling that it's mistaking the Bullet.dts as the bullet for the Gun and Guns Akimbo.

Quote
datablock ProjectileData(<YOURWEAPONNAME>Projectile)
{
   projectileShapeName = "./shapes/bullet.dts";
how does it get put in the shapes folder? do i put it there or do i just put it in the add-on's zip file, change the thing from shapes/bullet.dts to shapes/GLBullet.dts and it will know to put it in there? and about the server.cs, how do i make that?
I got:
Grenade Launcher.dts
GLBullet.dts
weapon_ExampleGun.cs (im modifying it to shoot the GLBullet, but I need to know how as said above)
I need:
To know how to save textures, what to name then, and is to change any part of the weapon_ExampleGun.cs to shoot the grenade
Server.cs and how to make it

I fixed the code problem what i've found is that it was going from the zip file!
Code: [Select]
datablock ProjectileData(<YOURWEAPONNAME>Projectile)
{
   projectileShapeName = "./shapes/bullet.dts";
Edit: I've done everything! The server.cs, the dts files, the cs editing it thought it would work, I checked it in the add-ons list and when i got on to wrench it, It's not on the drop-down list! Here my add-on, please help me! Update http://www.mediafire.com/?sharekey=2769ab7d8f296624d2db6fb9a8902bda
someone please help me!
« Last Edit: November 08, 2008, 02:38:03 PM by g12345389 »

After starting the server, look in your console for errors related to the weapon. You may have to scroll up quite a bit, depending on how many add-ons you have.

After starting the server, look in your console for errors related to the weapon. You may have to scroll up quite a bit, depending on how many add-ons you have.
it only said its missing material01 and material02
edit: i renamed the textures material01 and material02, but it still not show up...
edit2: i found this in the console, the exaple told me to put 'GrenadeLauncherShellDebris' and 'GrenadeLauncherFireSound' and i checked another addon with had the same like of script like '?ShellDebris' in there, but why does mine not work? new http://www.mediafire.com/?sharekey=2769ab7d8f296624d2db6fb9a8902bda
Code: [Select]
Loading Add-On: Weapon_GrenadeLauncher
Executing Add-Ons/Weapon_GrenadeLauncher/server.cs.
Object 'bulletTrailEmitter' is not a member of the 'ParticleEmitterData' data block class
Add-Ons/Weapon_GrenadeLauncher/server.cs (0): preload failed for GrenadeLauncherItem: ShapeBaseData: Couldn't load shape "Add-Ons/Weapon_GrenadeLauncher/GrenadeLauncher.dts".
Object 'GrenadeLauncherShellDebris' is not a member of the 'DebrisData' data block class
Object 'GrenadeLauncherFireSound' is not a member of the 'AudioProfile' data block class
Add-Ons/Weapon_GrenadeLauncher/server.cs (0): preload failed for GrenadeLauncherImage: Unable to load shape: Add-Ons/Weapon_GrenadeLauncher/GrenadeLauncher.dts.
7 datablocks added.
« Last Edit: November 08, 2008, 02:38:29 PM by g12345389 »