]> git.xonotic.org Git - xonotic/xonotic.wiki.git/blobdiff - Functions-and-other-programming-QuakeC-things-in-Xonotic.md
Added and fixed some nade cvars
[xonotic/xonotic.wiki.git] / Functions-and-other-programming-QuakeC-things-in-Xonotic.md
index d6fab7faee674c32b65a6458b18c9eef9bb0226b..30030adefb9f776ee8b3344f8a28ba8df0a5559d 100644 (file)
@@ -1,7 +1,7 @@
 **Note:** The article is written as developer notes to ease developer tasks and save QuakeC function terms here. Some references are taken from `events.qh`.
 
 
-# MUTATOR functions (from: `qcsrc/server/mutators/events.qh`)
+# MUTATOR functions (from: `qcsrc/client/mutators/events.qh`, `qcsrc/common/mutators/events.qh`, `qcsrc/server/mutators/events.qh`)
 
 ### Introduction
 
@@ -24,7 +24,7 @@ Creates a function and calls `new_mutator_name` (from `REGISTER_MUTATOR`) and on
 
 Example:
 ```c
-MUTATOR_HOOKFUNCTION(new_mutator_name_or_events.qh_main_hook, PlayerSpawn)
+MUTATOR_HOOKFUNCTION(new_mutator_name, events.qh_main_hook)
 {
     // whatever does
 }
@@ -71,9 +71,20 @@ MUTATOR_CALLHOOK(name_of_MUTATOR_HOOKFUNCTION_or_events.qh_main_hook, some_varia
 
 You can look the MUTATOR functions in:
 
+**COMMON**:
+
 **`qcsrc/common/mutators/events.qh`** :
 https://timepath.github.io/scratchspace/d4/d95/common_2mutators_2events_8qh.html
 
+
+**CLIENT**:
+
+**`qcsrc/client/mutators/events.qh`** :
+https://timepath.github.io/scratchspace/d8/d0e/client_2mutators_2events_8qh.html
+
+
+**SERVER**:
+
 **`qcsrc/server/mutators/events.qh`** :
 https://timepath.github.io/scratchspace/d6/ddd/server_2mutators_2events_8qh.html
 
@@ -81,4 +92,63 @@ https://timepath.github.io/scratchspace/d6/ddd/server_2mutators_2events_8qh.html
 <br />
 <br />
 
+
+## List of WEAPON functions
+
+This is a created functions list 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.
+
+<br />
+<br />
+
+- [**W_SetupShot_Dir**](https://timepath.github.io/scratchspace/d4/d3f/tracing_8qh.html#aff0ea351757ee6caf83b25d12d18656c)
+
+```c
+W_SetupShot_Dir(
+       ent,
+       wepent,
+       s_forward,
+       antilag,
+       recoil,
+       snd,
+       chan,
+       maxdamage,
+       deathtype 
+)
+```
+
+- [**W_SetupProjVelocity_Explicit**](https://timepath.github.io/scratchspace/d7/d31/tracing_8qc.html#a55f8f2b1828413bfb123a5fcb61b9f8e)
+
+```c
+void W_SetupProjVelocity_Explicit(
+    entity     proj,
+    vector     dir,
+    vector     upDir,
+    float      pSpeed,
+    float      pUpSpeed,
+    float      pZSpeed,
+    float      spread,
+    float      forceAbsolute 
+)
+```
+
+- [**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.
+*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
+void W_MuzzleFlash(Weapon thiswep, entity actor, .entity weaponentity, vector shotorg, vector shotdir);
+```
+
+- [**Weapon selection functions**](https://timepath.github.io/scratchspace/d8/d6b/selection_8qh.html)
+(located in `qcsrc/server/weapons/selection.qh`)
+
+- [**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`)
+
+
 AND.... STILL in process
\ No newline at end of file