From 305abdf90652008108c4eee3933e9bb1d910da60 Mon Sep 17 00:00:00 2001 From: FatalErr42O <58855799+FatalError42O@users.noreply.github.com> Date: Fri, 3 Jan 2025 17:56:46 -0800 Subject: [PATCH] luadox fix? --- classes/Gun.lua | 1 + docs/class/Gun.html | 2 +- docs/class/player_model_handler.html | 2 +- docs/index.html | 2 +- docs/index.js | 2 +- docs/manual/changelog.html | 2 +- docs/module/Bullet_hole.html | 2 +- docs/module/Control_handler.html | 2 +- docs/module/Gun-methods.html | 2 +- docs/module/Gun.html | 451 ++++++++++++++++++++++++--- docs/module/misc_helpers.html | 2 +- docs/module/play_sound.html | 2 +- docs/search.html | 2 +- 13 files changed, 425 insertions(+), 49 deletions(-) diff --git a/classes/Gun.lua b/classes/Gun.lua index 46c5e5b..3e78ac9 100644 --- a/classes/Gun.lua +++ b/classes/Gun.lua @@ -25,6 +25,7 @@ local Vec = vector -- *Please note:* there are likey undocumented fields that are used in internal functions. If you find one, please make an issue on Github. -- -- @class gun +-- @display Gun -- @field properties @{lvl1_fields.properties|properties} which define the vast majority of gun attributes and may change accross instances -- @field consts @{lvl1_fields.consts|constants} which define gun attributes and should not be changed in an instance of the gun -- @field offsets runtime storage of @{lvl1_fields.offsets|offsets} generated by recoil sway wag or any other element. diff --git a/docs/class/Gun.html b/docs/class/Gun.html index 94a69fb..5b2f366 100644 --- a/docs/class/Gun.html +++ b/docs/class/Gun.html @@ -69,7 +69,7 @@
Classes
diff --git a/docs/class/player_model_handler.html b/docs/class/player_model_handler.html index 65c1153..e00ae3b 100644 --- a/docs/class/player_model_handler.html +++ b/docs/class/player_model_handler.html @@ -41,7 +41,7 @@
Classes
diff --git a/docs/index.html b/docs/index.html index a5117b6..c005e4d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -32,7 +32,7 @@
Classes
diff --git a/docs/index.js b/docs/index.js index 6f06729..56a34ea 100644 --- a/docs/index.js +++ b/docs/index.js @@ -1,5 +1,5 @@ var docs = [ -{path:"class/gun.html", type:"class", title:"Gun.gun", text:"class fields Defining a gun: *method documentation coming soon (or never...) The appearance and handling of guns by default are defined by two table fields: their consts and their properties. properties define nearly everything, from how a gun handles to how it looks, what model it uses, etc. while consts define attributes that should never change, like bones within the gun, framerates, wether the gun is allowed to have certain attributes at all. The other fields of the class define tracking variables or other important things for the internal workings. There are essentially only 3 fields you must define to register a gun: itemstring, name, and properties. To hold the gun, the item defined in itemstring must actually exist, it will not automatically register. To have a functional gun however, more will need to be changed in terms of properties. it's reccomended that you take a look at existing mods (like guns4d_pack_1) for guidance Guns4d uses a class system for most moving parts- including the gun. New guns therefore are created with the :inherit(def) method, where def is the definition of your new gun- or rather the changed parts of it. So to make a new gun you can run Guns4d.gun:inherit() or you can do the same thing with a seperate class of weapons. Set name to \"__template\" for template classes of guns. for properties: for tables where you wish to delete the parent class's fields altogether (since inheritence prevents this) you can set the field \"__replace_old_table=true\" additionally Please note:* there are likey undocumented fields that are used in internal functions. If you find one, please make an issue on Github."}, +{path:"class/gun.html", type:"class", title:"Gun", text:"class fields Defining a gun: *method documentation coming soon (or never...) The appearance and handling of guns by default are defined by two table fields: their consts and their properties. properties define nearly everything, from how a gun handles to how it looks, what model it uses, etc. while consts define attributes that should never change, like bones within the gun, framerates, wether the gun is allowed to have certain attributes at all. The other fields of the class define tracking variables or other important things for the internal workings. There are essentially only 3 fields you must define to register a gun: itemstring, name, and properties. To hold the gun, the item defined in itemstring must actually exist, it will not automatically register. To have a functional gun however, more will need to be changed in terms of properties. it's reccomended that you take a look at existing mods (like guns4d_pack_1) for guidance Guns4d uses a class system for most moving parts- including the gun. New guns therefore are created with the :inherit(def) method, where def is the definition of your new gun- or rather the changed parts of it. So to make a new gun you can run Guns4d.gun:inherit() or you can do the same thing with a seperate class of weapons. Set name to \"__template\" for template classes of guns. for properties: for tables where you wish to delete the parent class's fields altogether (since inheritence prevents this) you can set the field \"__replace_old_table=true\" additionally Please note:* there are likey undocumented fields that are used in internal functions. If you find one, please make an issue on Github."}, {path:"class/player_model_handler.html", type:"class", title:"Player_model_handler.player_model_handler", text:"player_model_handler defining the player model when holding a gun each player model should have a \"gun holding equivelant\". There are numerous reasons for this first and foremost is that because Minetest is a [redacted mindless insults]. because of this you cannot unset bone offsets and return to normal animations. Bone offsets are needed for the arms to aim at the gun there's no simple way around this fact. Since every model is different custom behavior has to be defined for most."}, {path:"module/misc_helpers.html", type:"module", title:"misc_helpers", text:""}, {path:"module/play_sound.html", type:"module", title:"play_sound", text:"implements tools for quickly playing audio."}, diff --git a/docs/manual/changelog.html b/docs/manual/changelog.html index d44a9f0..fcbd0d0 100644 --- a/docs/manual/changelog.html +++ b/docs/manual/changelog.html @@ -38,7 +38,7 @@
Classes
diff --git a/docs/module/Bullet_hole.html b/docs/module/Bullet_hole.html index ee579c5..8ef74ec 100644 --- a/docs/module/Bullet_hole.html +++ b/docs/module/Bullet_hole.html @@ -39,7 +39,7 @@
Classes
diff --git a/docs/module/Control_handler.html b/docs/module/Control_handler.html index dcff745..23a46ea 100644 --- a/docs/module/Control_handler.html +++ b/docs/module/Control_handler.html @@ -39,7 +39,7 @@
Classes
diff --git a/docs/module/Gun-methods.html b/docs/module/Gun-methods.html index 75c8914..b0fcde0 100644 --- a/docs/module/Gun-methods.html +++ b/docs/module/Gun-methods.html @@ -39,7 +39,7 @@
Classes
diff --git a/docs/module/Gun.html b/docs/module/Gun.html index 2c3a83d..fe03d8a 100644 --- a/docs/module/Gun.html +++ b/docs/module/Gun.html @@ -3,7 +3,7 @@ - Gun - Guns4d + gun - Guns4d @@ -27,7 +27,7 @@
Contents
-

Module Gun - +

Module gun +

+

module

+ +
+

Synopsis

+
Attributes
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
properties

properties which define the vast majority of gun attributes and may change accross instances

+
consts

constants which define gun attributes and should not be changed in an instance of the gun

+
offsets

runtime storage of offsets generated by recoil sway wag or any other element

+
name

string the name of the gun

+
itemstring

string the itemstring of the gun- i.e. "guns4d_pack_1:m4"

+
itemstack

ItemStack the gun itemstack

+
player

ObjRef the operator of the weapon

+
meta

MetaDataRef itemstack meta

+
id

string the ID of the gun used for tracking of it's inventory

+
gun_entity

ObjRef the gun entity

+
_registered

list of registered guns, DO NOT MODIFY I really need a metatable for this class

+
bolt_charged

bool is the bolt charged

+
particle_spawners

table list of particle spawner handles (generated by firing)

+
current_firemode

int the active index of the firemode from firemodes

+
walking_tick

float walking time used to generate the figure 8 for wag

+
time_since_last_fire

float

+
time_since_creation

float

+
rechamber_time

float time left for the chamber to cycle (for firerates)

+
burst_queue

int number of rounds left that need to be fired after a burst fire

+
muzzle_flash

function

+
gun_translation

vec3 translation of the gun relative to the "gun" bone or the player axial rotation

+
property_modifiers

table indexed list of functions which are called when the gun's properties need to be built

+
attached_objects

table a list of ObjRefs that are attached to the gun as a result of attached_objects

+
subclass_instances

table list of subclass instances (i.e. Sprite_scope)

+
animation_rotation

vector containing the rotation offset from the current frame, this will be factored into the gun's direction if {@consts.ANIMATIONS_OFFSET_AIM}=true

+
animation_translation

vector containing the translational/positional offset from the current frame

+
total_offsets

all offsets from gun.offset of a type added together gun in the same format as a an offset (that is, five vectors, gun_axial, player_axial, etc.)

+
velocities

velocities in the format of offsets, but only containing angular (gun_axial and player_axial) offsets

+
+
+
+
+gun.properties + +
+
+

properties which define the vast majority of gun attributes and may change accross instances

+ +
+
+gun.consts + +
+
+

constants which define gun attributes and should not be changed in an instance of the gun

+ +
+
+gun.offsets + +
+
+

runtime storage of offsets generated by recoil sway wag or any other element.

+ +
+
+gun.name + +
+
+

string the name of the gun. Set to __template for guns which have no instances and serve as a template. It is safe to set name to the same as gun.itemstring

+ +
+
+gun.itemstring + +
+
+

string the itemstring of the gun- i.e. "guns4d_pack_1:m4". Set to "" for __template guns.

+ +
+
+gun.itemstack + +
+
+

ItemStack the gun itemstack. Remember to player:set_wielded_item(self.itemstack) when making meta or itemstack changes.

+ +
+
+gun.player + +
+
+

ObjRef the operator of the weapon. This may at some point be deprecated when I start to implement AI/mob usage

+ +
+
+gun.meta + +
+
+

MetaDataRef itemstack meta

+ +
+
+gun.id + +
+
+

string the ID of the gun used for tracking of it's inventory

+ +
+
+gun.gun_entity + +
+
+

ObjRef the gun entity

+ +
+
+gun._registered + +
+
+

list of registered guns, DO NOT MODIFY I really need a metatable for this class...

+ +
+
+gun.bolt_charged + +
+
+

bool is the bolt charged

+ +
+
+gun.particle_spawners + +
+
+

table list of particle spawner handles (generated by firing)

+ +
+
+gun.current_firemode + +
+
+

int the active index of the firemode from firemodes

+ +
+
+gun.walking_tick + +
+
+

float walking time used to generate the figure 8 for wag

+ +
+
+gun.time_since_last_fire + +
+
+

float

+ +
+
+gun.time_since_creation + +
+
+

float

+ +
+
+gun.rechamber_time + +
+
+

float time left for the chamber to cycle (for firerates)

+ +
+
+gun.burst_queue + +
+
+

int number of rounds left that need to be fired after a burst fire

+ +
+
+gun.muzzle_flash + +
+
+

function

+ +
+
+gun.gun_translation + +
+
+

vec3 translation of the gun relative to the "gun" bone or the player axial rotation.

+ +
+
+gun.property_modifiers + +
+
+

table indexed list of functions which are called when the gun's properties need to be built. This is used for things like attachments, etc.

+ +
+
+gun.attached_objects + +
+
+

table a list of ObjRefs that are attached to the gun as a result of attached_objects

+ +
+
+gun.subclass_instances + +
+
+

table list of subclass instances (i.e. Sprite_scope)

+ +
+
+gun.animation_rotation + +
+
+

vector containing the rotation offset from the current frame, this will be factored into the gun's direction if {@consts.ANIMATIONS_OFFSET_AIM}=true

+ +
+
+gun.animation_translation + +
+
+

vector containing the translational/positional offset from the current frame

+ +
+
+gun.total_offsets + +
+
+

all offsets from gun.offset of a type added together gun in the same format as a an offset (that is, five vectors, gun_axial, player_axial, etc.). Note that if +offsets are changed after update, this will not be updated automatically until the next update. update_rotations() must be called to do so.

+ +
+
+gun.velocities + +
+
+

velocities in the format of offsets, but only containing angular (gun_axial and player_axial) offsets.

+ +
+
@@ -105,57 +480,57 @@ - - - - - - - - - - - @@ -226,7 +601,7 @@
-
See also properties
+
See also properties
hip

table hipfire properties

+

table hipfire properties

ads

table aiming ("aiming down sights") properties

+

table aiming ("aiming down sights") properties

firemodes

table list of firemodes

+

table list of firemodes

recoil

table defines the guns recoil

+

table defines the guns recoil

sway

table defines the guns idle sway

+

table defines the guns idle sway

wag

table defines the movement of the gun while walking

+

table defines the movement of the gun while walking

charging

table defines how rounds are chambered into the gun

+

table defines how rounds are chambered into the gun

ammo

table defines what ammo the gun uses

+

table defines what ammo the gun uses

visuals

table defines visual attributes of the gun

+

table defines visual attributes of the gun

sounds

table defines sounds to be used by functions of the gun

+

table defines sounds to be used by functions of the gun

inventory

table inventory related attributes

+

table inventory related attributes

@@ -252,7 +627,7 @@ -
inventory_image

string inventory image for when the gun is loaded. This is added automatically during construction.

+

string inventory image for when the gun is loaded. This is added automatically during construction as the item's wield image.

@@ -265,7 +640,7 @@
-
See also properties
+
See also properties
@@ -276,7 +651,7 @@ - @@ -299,7 +674,7 @@
-
See also properties
+
See also properties
part_handler

part_handler Part_handler class to use. Default is Guns4d.part_handler

+

part_handler Part_handler class to use. Default is Guns4d.part_handler

@@ -328,7 +703,7 @@
-
See also properties
+
See also properties
@@ -363,7 +738,7 @@

list containing the firemodes of the gun. Default only contains "single". Strings allowed by default: -

See also properties
+
See also properties
@@ -387,7 +762,7 @@

IMPORTANT: expects fields to be tables containing a "gun_axial" and "player_axial" field. -

See also properties
+
See also properties
Example
property = {
     gun_axial = type
@@ -415,7 +790,7 @@ this means that increasing it decreases the time it takes for the angular veloci
 
 
- @@ -448,8 +823,8 @@ this means that increasing it decreases the time it takes for the angular veloci
-

IMPORTANT: expects fields to be tables containing a "gun_axial" and "player_axial" field. In the same format as gun.properties.recoil -

See also properties
+

IMPORTANT: expects fields to be tables containing a "gun_axial" and "player_axial" field. In the same format as gun.properties.recoil +

See also properties
target_correction_max_rate

float The maximum rate per second of recoil offset as determined with gun.properties.recoil.target_correction_factor

+

float The maximum rate per second of recoil offset as determined with gun.properties.recoil.target_correction_factor

@@ -483,7 +858,7 @@ this means that increasing it decreases the time it takes for the angular veloci
-
See also properties
+
See also properties
@@ -499,7 +874,7 @@ this means that increasing it decreases the time it takes for the angular veloci -
offset

table containing angular deviation while walking in the same format as an offset vector. Acts as a multiplier on the figure-8 generated while walking.

+

table containing angular deviation while walking in the same format as an offset vector. Acts as a multiplier on the figure-8 generated while walking.

@@ -512,7 +887,7 @@ this means that increasing it decreases the time it takes for the angular veloci
-
See also properties
+
See also properties
@@ -533,12 +908,12 @@ this means that increasing it decreases the time it takes for the angular veloci - -
draw_animation

string name of the animation to play from visuals.animations. Default "draw"

+

string name of the animation to play from visuals.animations. Default "draw"

draw_sound

string name of the sound to play from sounds. Default "draw"

+

string name of the sound to play from sounds. Default "draw"

@@ -551,7 +926,7 @@ this means that increasing it decreases the time it takes for the angular veloci
-
See also properties
+
See also properties
@@ -585,7 +960,7 @@ this means that increasing it decreases the time it takes for the angular veloci
-
See also properties
+
See also properties
@@ -637,7 +1012,7 @@ should be in the format {x=integer,y=integer}

}

There are other animations which are variable which are not listed here, these are usually defined by properties such as: -reload, draw_animation

+reload, draw_animation

@@ -650,8 +1025,8 @@ reload, draw
-

other fields are defined by other properties such as properties.charging.draw_sound and properties.reload -

See also properties
+

other fields are defined by other properties such as properties.charging.draw_sound and properties.reload +

See also properties
See also soundspec
diff --git a/docs/module/misc_helpers.html b/docs/module/misc_helpers.html index 7ae795f..9b144b9 100644 --- a/docs/module/misc_helpers.html +++ b/docs/module/misc_helpers.html @@ -45,7 +45,7 @@ diff --git a/docs/module/play_sound.html b/docs/module/play_sound.html index 1cceee0..8c1ae0f 100644 --- a/docs/module/play_sound.html +++ b/docs/module/play_sound.html @@ -41,7 +41,7 @@ diff --git a/docs/search.html b/docs/search.html index 3f73f5c..dad9d09 100644 --- a/docs/search.html +++ b/docs/search.html @@ -32,7 +32,7 @@