Author Topic: Base addon code?  (Read 1131 times)

I'm not talking about 'default' add-ons- like Weapon_Gun, Weapon_Rocket_Launcher, or Vehicle_Jeep. I mean items that are always loaded as part of the base game-
the wrench, hammer, wand, etc. Mostly, I need emitter/particle/image data, as having the default Wand/Destructo Wand's code would be helpful for making spellcasting wand variants.

But I've looked around, and the game files don't seem to have them in a readable .cs format. I don't precisely know what to search for, so I'm asking here again.

Oh, also, if it seems like I'm doing a lot of unrelated things, I am. I'm juggling a bunch of different server concepts to see what works and what people will play.

Why not just look at the datablocks of the base weapons/items? For instance, say I want to get the emitter data for the printer. First, I start my own singleplayer game or server. When I spawn, I have a printer in my 3rd inventory slot. To find the ItemData, I open the console and type
Code: [Select]
==> echo(findclientbyname(<name>).player.tool[2]);
383
This is the ID of the printer object. To verify that this is in fact the printer, I run
Code: [Select]
==> echo(383.getName());
PrintGun
To get the image file where the emitter data is listed, I run
Code: [Select]
==> echo(PrintGun.image);
PrintGunImage
Now I want to look through the array of states until I find the firing state.
Code: [Select]
==> echo(PrintGunImage.stateName[0]);
Activate
That's not it. I increment the array index until...
Code: [Select]
==> echo(PrintGunImage.stateName[2]);
Fire
I've found the state index I want. Now to get the corresponding emitter,
Code: [Select]
==> echo(PrintGunImage.stateEmitter[2]);
printGunEmitter
And there's the emitter I want. This whole process can be summarized as
Code: [Select]
==> echo(findclientbyname(<name>).player.tool[2].image.stateEmitter[2]);
printGunEmitter

Just equip the item you want to find the emitter for, and run through the same process. The only potential difference will be the index of the tool and state arrays.

you are correct, they are not readable, as they are encrypted as DSO files found in base/. below i've packaged the files i have on the following items: hammer, wrench, printer, brick item, admin wand, and wand

https://cdn.discordapp.com/attachments/372648606383210508/375502338355363841/default_item_datablocks_and_functions.zip

you are correct, they are not readable, as they are encrypted as DSO files found in base/. below i've packaged the files i have on the following items: hammer, wrench, printer, brick item, admin wand, and wand

https://cdn.discordapp.com/attachments/372648606383210508/375502338355363841/default_item_datablocks_and_functions.zip
Ah, thanks! This is just what I needed.