Author Topic: Addon wont show up on list & needs to damage player OUTSIDE minigame!  (Read 723 times)

I am currently trying to create a special gun for my clan (details under the observers tab under members at http://forum.blockland.us/index.php?topic=223888.0) and i have 2 problems.

when i start the game in the list where you can select addons to use in your server, it dosent show up, i looked back in the console to see that there was an error opening it (then it said ", better handle it better") and i just need to have it open.
EXTRA INFO: this is my first addon i've ever even tryed to make and i just copyed Weapon_gun over and changed it to Weapon_ogun and i went into server.cs and (i have an understanding of basic C) was able to slightly reverse compile the code in my head and changed the damage to 999 (i think... i hope!) and changed description and name check accordingly. i was hoping someone could help me with this. Also i need the gun to work OUTSIDE minigames so it can be used appropreatly and
(fixed) if possable make the gun work for a selected few, and explode for everyone else, killing them.

I also need a version of the Invisibility watch that also cloaks your name and that lasts forever without needing to charge and all that like /completecloak but with that cool fading effect. for the observers.
using something else

any help will be greatly appreciated! please reply!
thx! :)
« Last Edit: February 14, 2013, 05:24:47 PM by Yin Yang »

Im not recoding this for you (as this is coding help, not coding requests) but I can give you a few tips/things to do

  • Delete most of the datablocks in there you copied from the gun script. They are redundant and take up space. Use this instead to force the default gun to be loaded so you can use its datablocks: forceRequiredAddon Reference
  • You will need to keep two of the datablocks and rename them, the item and the image. You wouldn't want to use the regular guns (as you're making your own with it's own behavior).
  • The gun should work outside of minigames by default? Unless, you're trying to make it so someone in the minigame can pick it up when its outside the minigame or perhaps you want someone to be able to shoot another person who's in the minigame? I'd look at packaging miniGameCanDamage() or miniGameCstar fishe() so that you can pickup or use your gun inside or outside of a minigame and can kill whoever you want. This bullet point is probably way over your head and I think a simple server command to give you the gun would be more in your reach. It might take a bit of learning but you should be able to figure it out, server commands are pretty easy.
  • I think for the part where you want to make the gun only available to a select few, you can change the OGunImage::OnFire(%this, %obj, %slot) to check the %obj (which is the object holding your gun) to see if its a player, then check to see if it's one of your "select" few by getting the BLID from the player's client. If its not them then spawn an explosion (pretty sure there's some hacky way to do this because you cant do it easily) and kill them. Just killing them and printing a message might be more within your coding level.
  • I can already see numerous errors in the code. For one, I'm pretty sure bullet::damage is wrong because bullet doesn't exist as a class. You're also going to have to change the gun image's and gun item's datablock names so that you can implement your own script with the ogun.
  • No idea why it won't show up in the add-ons list. You're gonna need to provide a better description of the error.

There's probably something I missed but there's still quite a few things you need to do. If you don't understand this, you may need to do some more basic scripts or just hang around and learn a bit more before you try this.

Im not recoding this for you (as this is coding help, not coding requests) but I can give you a few tips/things to do

  • Delete most of the datablocks in there you copied from the gun script. They are redundant and take up space. Use this instead to force the default gun to be loaded so you can use its datablocks: forceRequiredAddon Reference
  • You will need to keep two of the datablocks and rename them, the item and the image. You wouldn't want to use the regular guns (as you're making your own with it's own behavior).
  • The gun should work outside of minigames by default? Unless, you're trying to make it so someone in the minigame can pick it up when its outside the minigame or perhaps you want someone to be able to shoot another person who's in the minigame? I'd look at packaging miniGameCanDamage() or miniGameCstar fishe() so that you can pickup or use your gun inside or outside of a minigame and can kill whoever you want. This bullet point is probably way over your head and I think a simple server command to give you the gun would be more in your reach. It might take a bit of learning but you should be able to figure it out, server commands are pretty easy.
  • I think for the part where you want to make the gun only available to a select few, you can change the OGunImage::OnFire(%this, %obj, %slot) to check the %obj (which is the object holding your gun) to see if its a player, then check to see if it's one of your "select" few by getting the BLID from the player's client. If its not them then spawn an explosion (pretty sure there's some hacky way to do this because you cant do it easily) and kill them. Just killing them and printing a message might be more within your coding level.
  • I can already see numerous errors in the code. For one, I'm pretty sure bullet::damage is wrong because bullet doesn't exist as a class. You're also going to have to change the gun image's and gun item's datablock names so that you can implement your own script with the ogun.
  • No idea why it won't show up in the add-ons list. You're gonna need to provide a better description of the error.

There's probably something I missed but there's still quite a few things you need to do. If you don't understand this, you may need to do some more basic scripts or just hang around and learn a bit more before you try this.
Wow thx for all that, you described %obj but wat about the rest, also the description file I changed the description and on name check I changed it to weapon_ogun. also i don't care about any of that pick up inside or outside mini game i meant i want it to do damage when your not in a mini game, like the Self Delete gun addon, but turned the right way, also i have my own sound effects and colors for the gun, and i'm planning to add different particles (well, more of the same particles, plus a small ring of smoke coming from the nosle when you fire implying that there was a lot of force when the bullet was fired). This isn't like guns akamo
where its the same thing.
« Last Edit: February 08, 2013, 08:36:40 AM by Yin Yang »

fixed most but still want the gun isomorpic