Anyone want to help me with creating a taser?

Author Topic: Anyone want to help me with creating a taser?  (Read 1184 times)

/title
Going to try and make a taser, I need help the coding and modelling. I want to try this out for an experiment to see if I can get the grip on modelling, as well as just general teamwork. If your interested in trying to help me learn some basics in blender and maybe a bit on torque works then let me know because I'd love to try and make this a reality.

Before you start a project you usually want to write a short document that lists all the methods and classes you'll be utilizing in the project. In object oriented design its usually called class discovery or universal modeling language. It helps guide your design in the project and how you communicate between each class and method.

In general, all weapon-based items have a simple architecture

==========================
AudioProfile weaponFireSound
AudioProfile projectileHitSound

ParticleData weaponFireParticle
                V
ParticleEmitterData weaponFireEmitter

ParticleData weaponTrailParticle
                V
ParticleEmitterData weaponTrailEmitter


ProjectileData weaponProjectile
                V
ImageData weaponImage
                V
ItemData weaponItem
==========================

these are most of the basic datablocks you need to create for your weapon. With this you can break each down and write comments on what you want from each. for example, its a taser, so under weaponTrailParticle you might want to say "i want this trail to have electricity effects" and etc.

In terms of method usage, this will make or break your weapon function. for the taser, you want a certain number of methods. I'll write them down for you and describe why you need them and what they do.

function ProjectileData::damage(%this,%obj,%col,%fade,%pos,%normal)
^ this method handles all damage dealt when a projectile hits a player armor. you want to package this because you want your taser to probably stun the player. inside this method, you could include a little code like %col.tumble and checks to see if the target is already tumbling (that way you can't lock an enemy in an infinite tumble)
« Last Edit: March 31, 2018, 02:30:23 PM by thegoodperry »

phantos thats quite good advice except for the fact he's 100% new to ts it appears and that's not something he should be worrying about if he's just trying to grasp the fundamentals

darth, join Blockland Content Creators if you haven't already, and there people can give you directed guidance on Blender and scripting. I've got a pair of tutorial docs for people 100% new to blender linked there as well. they're also on the Addon Making Academy topic, though that has died out for a while.

oh. well uh, you should probably read the official torquescript syntax guide before attempting any sort of add-on development beyond editing fields.

anyways if your new to add-on development, all object instances use Datablocks which store data that the object will inherit. When you spawn an item in-game, you are creating an instance of the weapon object, which contains data from whatever Datablock its attached to. Example, spawning a gun on a brick creates a Gun object at that exact location, but its data, like model information and ui name information, is stored on the GunItem datablock. or when you plant a 2x2 brick, you create a 2x2 brick object in the world space, with all its data inherited from the FxDts2x2BrickData datablock

All this is fundamental to understanding how add-ons work, but you dont have to understand it in order to make add-ons. A good start is to edit fields of pre-made add-ons and see how they change in-game. Keep in mind that you dont have to restart your server to test add-ons. You can change parts of the code while running a server, then use exec("Add-ons/Weapon_YourAddon/server.cs"); coupled with TransmitDatablocks();. these will update your changes so they are reflected on the server.

Its good to make the general architecture of your add-on outside the server and then change values like bullet damage and emitter size inside the server, where you can see how your changes are reflected.
« Last Edit: March 31, 2018, 07:25:06 PM by thegoodperry »

alright, for now I'm just gonna stick on attempting to make a model and then messing about with developing the actual code to learn how some of this tuff works since I have no experience with either