Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Enabling/disabling a mutator

#1
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 .
I am Xonotic, and so can you!
Pwnage, a close relative of sausage.
Look how terrible I am:
[Image: 20796.png]
Reply

#2
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
[Image:http://i.imgur.com/4XODR.png]640K ought to be enough for anybody.
     ― Linux Torvalds
Reply

#3
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.
I am Xonotic, and so can you!
Pwnage, a close relative of sausage.
Look how terrible I am:
[Image: 20796.png]
Reply

#4
Ah, practice is the best way to learn, you got that part right Smile
[Image:http://i.imgur.com/4XODR.png]640K ought to be enough for anybody.
     ― Linux Torvalds
Reply



Possibly Related Threads...
Thread Author Replies Views Last Post
  Offhand blaster mutator Lyberta 1 840 02-19-2018, 11:56 AM
Last Post: sev
  [TUTORIAL] Writing your first mutator Lyberta 0 1,140 04-29-2017, 01:42 PM
Last Post: Lyberta
Lightbulb What do you think of my mutator? (Chaos Arena) W4RP1G 2 2,322 04-18-2012, 01:57 AM
Last Post: W4RP1G
  Character Class Mutator Flying Steel 9 6,495 07-18-2010, 12:28 AM
Last Post: DiaboliK

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum software by © MyBB original theme © iAndrew 2016, remixed by -z-