From d02057fcc163ba843e75373543f334976c129f0d Mon Sep 17 00:00:00 2001 From: LegendaryGuard Date: Wed, 10 Feb 2021 21:23:49 +0000 Subject: [PATCH] Added Menu and Draw functions, weapons introduction and short dev guide. Fixed some stuff --- ...er-programming-QuakeC-things-in-Xonotic.md | 40 +++++++++++++++---- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/Functions-and-other-programming-QuakeC-things-in-Xonotic.md b/Functions-and-other-programming-QuakeC-things-in-Xonotic.md index 30030ad..ffea69b 100644 --- a/Functions-and-other-programming-QuakeC-things-in-Xonotic.md +++ b/Functions-and-other-programming-QuakeC-things-in-Xonotic.md @@ -3,9 +3,7 @@ # MUTATOR functions (from: `qcsrc/client/mutators/events.qh`, `qcsrc/common/mutators/events.qh`, `qcsrc/server/mutators/events.qh`) -### Introduction - -How to use MUTATOR functions: +### How to use MUTATOR functions: **Attention:** to use a hook, first register your mutator using `REGISTER_MUTATOR`, then create your function using `MUTATOR_HOOKFUNCTION`. @@ -92,16 +90,31 @@ https://timepath.github.io/scratchspace/d6/ddd/server_2mutators_2events_8qh.html

+# WEAPON functions + +## A bit of introduction + +You'll need understand that weapons can be interacted with autocvars variables and its own .qh file where cvars are declared. *Think*, *touch*, *explode* and those types of functions can be declared within an *attack* function and *whatever* it is called. Note that there are also METHODs that are necessary for the weapon to work. + +- **Think** function makes the weapon shot react on what to do. +- **Touch** function makes the weapon shot react against some element where touch (like player, monster, vehicle, ...). +- **Explode** function makes the weapon explosion react. +- **Attack/Whatever** function is where the weapon attack executes, keep in mind that it has the other functions attached to be executed. + +You can look the example of this weapon code: +- [**devastator.qh**](https://timepath.github.io/scratchspace/d9/dfa/devastator_8qh_source.html) +- [**devastator.qc**](https://timepath.github.io/scratchspace/d9/d5d/devastator_8qc_source.html) + +
## List of WEAPON functions -This is a created functions list to modify/create weapons. There are incomplete explanations for each function. +This is a created list of functions to modify/create weapons. There are incomplete explanations for each function. There are contents taken from `qcsrc/common/weapons/all.qh`. **WARNING:** The contents may content wonky code, and the interactions can change and not do the same what happens here. -

- [**W_SetupShot_Dir**](https://timepath.github.io/scratchspace/d4/d3f/tracing_8qh.html#aff0ea351757ee6caf83b25d12d18656c) @@ -137,7 +150,8 @@ void W_SetupProjVelocity_Explicit( - [**W_MuzzleFlash**](https://timepath.github.io/scratchspace/d0/ddd/weapons_2all_8qh_source.html)(located in `qcsrc/common/weapons/all.qh` line 406) -In the moment when player shots the weapon, weapon flashes. +In the moment when player shots the weapon, weapon flashes. + *Note:* write `#ifdef SVQC` at the start of using this function, and write with `#endif` after declared the function(only can do this if the code which needs execute can do this, although maybe you need more functions/things in the code inside this). ```c @@ -150,5 +164,17 @@ void W_MuzzleFlash(Weapon thiswep, entity actor, .entity weaponentity, vector sh - [**Weapon decrease ammo, speed factor, rate factor, reload functions**](https://timepath.github.io/scratchspace/d5/de0/weaponsystem_8qc.html) (located in `qcsrc/server/weapons/weaponsystem.qh`) +
+
+ +# Menu and Draw functions + +You can look the draw functions where HUD is being drawn: +- [**Draw functions and macros (`qcsrc/client/draw.qh`)**](https://timepath.github.io/scratchspace/d5/d8d/client_2draw_8qh_source.html) + +More info inside the code where you can draw/print HUD and menu: +- [**Globals, constants, fonts, prints, error cmds, vector stuff, conversion functions and all drawing/printing HUDs/menus/characters related (`qcsrc/dpdefs/upstream/menudefs.qc`)**](https://timepath.github.io/scratchspace/d8/de2/menudefs_8qc_source.html) + +
-AND.... STILL in process \ No newline at end of file +AND... STILL more things in process \ No newline at end of file -- 2.39.2