New code stuff in the Alpha (coders read!)

Old, unused, or irrelevant topics regarding development.
Locked
User avatar
Abbysynth
Registered user
Posts: 465
Joined: 30 Apr 2015, 21:15
Location: Ottawa, Ontario

New code stuff in the Alpha (coders read!)

Post by Abbysynth » 02 Jul 2015, 19:40

Okay, so by now you're all pretty used to our vanilla CM codebase. The Alpha works pretty different in a few subtle but important ways which you should all be familiarizing yourselves with.

Xenos had to be rebuilt effectively from the ground up, since newstyle Bay gutted the entire mob type and made it into a human subspecies (bleegh). Castes were rewritten from the ground up and all the castes and powers consolidated - you should definitely be familiarizing yourselves with the /modules/cm_aliens folder as it contains EVERYTHING that has to do with xenos. The name of the game here is consolidation -- rather than doing 12 different procs for the xenos, I've tried to put everything as generic and cross-referenced as possible for future expansion and changes.

Xenos interacting with the world require an attack_alien() proc on the atom in question -- you'll see them all in /cm_aliens/attack_alien.dm. This is where ALL the procs are going, instead of in each object file scattered around the code. They are functionally identical to the standard attack_hand procs you're all familiar with (clicking something with an empty hand selected). In vanilla code it's all generally done xeno-wise with attack_paw() or attack_alien(), ours are all attack_alien(), though if necessary you can just make attack_alien() call attack_hand() to replicate it. There are procs for it going all the way from the atom standard to each individual item we want the xenos to interact with -- for example, obj/machinery/attack_alien() is the parent (which makes xenos stare and drool at stuff) and is overwritten with obj/machinery/computer/shuttle_control.attack_alien() to allow a check for Queens using that specific console.

All the other files in cm_alien are functionally equivalent to the ones you'll find in the other mob folders. Know them. Love them.

Languages in newBay work a little weirdly. At first we had it using Hivemind as a seperate language, but there were some serious issues with that so I wrote my own in XenoSay.dm and forced :a to use hivemind. As for xenos talking normally, there's a language specifically for them called Xenocommon in mob/living/languages.dm I believe. You shouldn't need to really touch any of that stuff; XenoSay is what you want to be messing with.

As a sidenote, Yautja also get their own language, which is mostly just rumbles and roars. I don't recall offhand but I do think they can speak Galactic Common (the normal human speaking language) but need to use :4 I think as a prefix modifier. If you want to play a Yautja on the alpha build, and have +admin rights, go to View Vars on a mob, scroll way down to Change Species, and set them to Yautja. Try not to abuse this please. They currently don't have any items or anything yet and just some test abilities, so they're not ready for public consumption.

New bay uses colored lights. You can set colored lights using blah.l_color = "012ABC" which is xx xx xx for R G B hex values. If you set it on a light source be warned that a person picking up that light source has to have their l_color changed as well; the var only applies to the object it's set on, and light source items like flashlights just make that -person- glow when picked up.

Squads - these are functionally similar in a lot of ways to jobs. There are default squad datums that keep track of things like who has already been auto-assigned to a squad, the squad leader, and so on. A lot of it is there only as a framework for future expansion -- it will eventually be possible to change a squad's colors on the fly, for example. The majority of the squad stuff is in /code/gamemode/jobs, the job_controller.dm is where the auto assigning stuff is. The squad datums are in the same folder as all the actual jobs, like captain.dm, in that job folder. Players who join late will still be auto-assigned, but people who have their squads changed by the squad console in the XO bridge area will not affect them; squads are only modified with the auto assigner code.

The jungle turfs and all associated stuff with them is kept in /code/game/turfs/groundmap_turfs.dm. Mostly it's just the jungle plants and structures, along with the water - the water itself is also mentioned in the movement code for mobs, as it slows you down. The water also generates overlays that gives the "water up to the ankles" effect on game bootup.

The groundmap's electronics and such are kept.. Uhh, crap, I don't remember now. In groundmap_geothermal.dm, I think in /code/modules/power/. This is where the geothermal generators as well as the "colony floodlight" code is. They're all pretty much fine, but if you need to tweak stuff that's them.

Pretty much everything else is stock Bay, so familiarize yourself with newstyle Bay before you start going nuts with code tweaks. Remember - if you are changing something on Alpha, it is extremely important that you let the other coders know BEFORE you start working on it, because it might be there for a good reason. If we have bugs that are carried over from vanilla to Alpha, you should feel free to re-fix them, I know a lot of you guys have been doing tremendous bugfix work lately.

Locked