- Joined: Tue Aug 18, 2020 8:31 pm
- Byond Username: Bamhalazam
I don't know anything about coding. I want to add two objects to the game: a fencing epee and bag. I have made the sprites but I do not know how to even start the process of converting the sprites into objects.
Any help would be appreciated!
- Joined: Thu Aug 10, 2017 9:32 pm
- Byond Username: Wesoda25
- Site Admin
- Joined: Tue Jul 01, 2014 7:02 pm
- Byond Username: PKPenguin321
- Github Username: PKPenguin321
- Location: U S A, U S A, U S A
BYOND, which you need to have in order to play the game in the first place, comes with its own development environment called Dream Maker and a hosting tool called Dream Daemon. If you're running Windows you can just search for them in your taskbar and they should pop up.
Download our source code here: https://github.com/tgstation/tgstation/ ... master.zip
Then when you unzip it, open tgstation.dme to open the game code in Dream Maker. The code should be ready to go by default, and you can compile it by click Build > Compile. This will output a .dmb file in the same folder as the .dme, which you can double click to run or properly host with Dream Daemon.
Once you have a test server that you locally host, you'll automatically get access to admin tools. Among these tools is the ability to View Variables. Right click ANYTHING and find View Variables in the right click menu to open up a handy window that shows you the values of everything on an object/mob/whatever. For example, view the variables of a fire extinguisher and you can find the "force" variable to see exactly how much damage it does. Learning by experience like this is really handy for newbies.
Once you've played around with it for a bit, check out our code here: https://github.com/tgstation/tgstation You'll notice a search bar up at the top which you will probably make a lot of use of. If I search for fire extinguisher, my top result is extinguisher.dm, where you can see the object definition (line 1), variables being set (lines 2 through 18), new variables being declared and set (lines 19-28)... You'll notice that "force" is defined on line 13, and is equal to what the in-game View Variables window said! Also some variables are defined in weird ways, like "icon", which points to a ".dmi" file... If you open up that .dmi file in Dream Maker, you'll find where we store icons! Poke around a bit in there and you'll quickly find Dream Makers sprite editor.
Basically just poke around, see how things work, and go off of example. A new object that's just a weapon should be really easy, and what I've shown you here should be enough to help you figure out how to do it.
If you want to actually merge your code into our live codebase, you'll want to set up git, but that's a whole different tutorial. Cross that bridge when you get to it, it'll make your life easier if you're just starting out.
- Joined: Sat Jun 02, 2018 10:27 am
- Byond Username: Cacogen
you can see how a sabre is created here:
https://github.com/tgstation/tgstation/ ... isc.dm#L55
Code: Select all
/obj/item/melee/sabre/epee name = "fencing epee" desc = "This is used to fence." icon_state = "epee" icon = 'icons/obj/items_and_weapons.dmi' //object sprite should go in this file, named as above (e.g. epee) inhand_icon_state = "epee" lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi' //left inhand sprite should go in this file, named as above (e.g. epee) righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi' //right inhand sprite should go in this file, named as above (e.g. epee) force = 2 //melee damage sharpness = SHARP_EDGED //i assume there's a define in the code for not sharp somewhere which you'd replace here to prevent embedding throwforce = 5 //thrown damage armour_penetration = 0 //i don't know how this works but i'm guessing you'd want it at 0 for a fencing sword
technokek wrote:Cannot prove this so just belive me if when say this
Users browsing this forum: No registered users