Xonotic Forums
Enabling/disabling a mutator - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Creating & Contributing (https://forums.xonotic.org/forumdisplay.php?fid=10)
+--- Forum: Xonotic - Development (https://forums.xonotic.org/forumdisplay.php?fid=12)
+--- Thread: Enabling/disabling a mutator (/showthread.php?tid=5094)

Enabling/disabling a mutator - Zeo - 09-22-2014

I've been writing a mutator (after spending 3 days learning QuakeC by reading the Xonotic source), and I finally got to a point where it should work, just to be testable, but I have no idea how to enable it. Is there a console command to enable a mutator, or will I need to create a cvar to enable it (if so, how do I do that?)?

If you're interested in what the mutator does, it emulates Team Fortress and uses the player model as the class. Expect more threads from me when I get to Medic, Spy, and Engineer Tongue .

RE: Enabling/disabling a mutator - Mr. Bougo - 09-22-2014

Have you read how other mutators are implemented? Look in miscfunctions.qc, there's a bunch of CHECK_MUTATOR_ADD functions that take care of checking the mutator cvar and initialize the mutator.

Look at how Mario transferred the Pinata feature to a mutator in commit 4138886.

There is separate logic in the menu code to show the checkbox in the mutator menu, in menu/xonotic/dialog_multiplayer_create_mutators.c. But you don't need that to make your mutator work, so focus on the server / client code first.

EDIT: As for the idea itself of developing a class-based system in xonotic, specifically as a mutator, it has been brought up in a different thread and spawned some discussion that you might find interesting: Limited weapon slots & customizable spawn weapons

RE: Enabling/disabling a mutator - Zeo - 09-23-2014

Thanks for the links, part of my problem is I wasn't solid on where cvars come from, so I was looking for a way to declare them until I realized to do "set varname value".

I don't really plan on using this (can you imagine trying to balance the classes?), it's just so I can learn QuakeC.

RE: Enabling/disabling a mutator - Mr. Bougo - 09-23-2014

Ah, practice is the best way to learn, you got that part right Smile