doc updates

This commit is contained in:
FatalErr42O 2025-01-03 16:14:00 -08:00
parent 14905c42b0
commit 9043713480
19 changed files with 544 additions and 149 deletions

30
changelog.md Normal file
View File

@ -0,0 +1,30 @@
# changelog 1.3.0
* #### Established Versioning system
* #### moved the following fields
* `inventory_image_magless` -> `inventory.inventory_image_magless`
* `inventory_image_magless` -> `inventory.inventory_image_magless`
* `firemode_inventory_overlays` - > `inventory.firemode_inventory_overlays`
* `ammo_handler` -> `subclasses.ammo_handler`
* `sprite_scope` -> `subclasses.sprite_scope`
* `crosshair` -> `subclasses.crosshair`
* #### create the following classes
* `Part_handler`
* completed (expansion later)
* facilitates attachments
* `Physics_system`
* inactive
* future implementation for automatic translation
* `Reflector_sight`
* work in progress
* simulates a reflector sight with an entity
* #### added the following changes to the gun class
* made `consts` and `properties` proxy tables for protection of data (and reworked the LEEF class lib for this)
* created a system for property modification
* added `subclasses` property to replace hardcoded subclasses with modular system
* added `subclass_instances` field (see above). These will be automatically updated if their index is in the subclasses list.
* added `visuals.attached_objects` property to define attached entities
* added `attached_objects` field
* made `get_pos` capable of accounting for animation translations

View File

@ -296,12 +296,11 @@ local function reregister_item(self, props)
end end
--accept a chain of indices where the value from old_index overrides new_index --accept a chain of indices where the value from old_index overrides new_index
local function warn_deprecation(gun, field, new_field) local function warn_deprecation(gun, field, new_field)
minetest.log("warning", "Guns4d: `"..gun.."` deprecated use of field `"..field.."` use `"..new_field.."` instead.") minetest.log("warning", "Guns4d: `"..gun.."` deprecated use of field `"..field.."` in properties. Use `"..new_field.."` instead.")
end end
local function patch_old_gun(self, minor_version) local function patch_deprecated(self, minor_version)
local props = self.properties local props = self.properties
--minor version 2 changes... --1.2->1.3 (probably missing some.)
if minor_version==2 then
if props.firemode_inventory_overlays then if props.firemode_inventory_overlays then
warn_deprecation(self.name, "firemode_inventory_overlays", "inventory.firemode_inventory_overlays") warn_deprecation(self.name, "firemode_inventory_overlays", "inventory.firemode_inventory_overlays")
for i, _ in pairs(props.firemode_inventory_overlays) do for i, _ in pairs(props.firemode_inventory_overlays) do
@ -314,7 +313,15 @@ local function patch_old_gun(self, minor_version)
props.subclasses[i] = props[i] props.subclasses[i] = props[i]
end end
end end
if self.properties.inventory_image then
self.properties.inventory.inventory_image = self.properties.inventory_image
warn_deprecation(self.name, "inventory_image", "inventory.inventory_image")
end end
if self.properties.inventory_image_magless then
self.properties.inventory.inventory_image_magless = self.properties.inventory_image_magless
warn_deprecation(self.name, "inventory_image_magless", "inventory.inventory_image_magless")
end
end end
--========================== MAIN CLASS CONSTRUCTOR =============================== --========================== MAIN CLASS CONSTRUCTOR ===============================
@ -352,7 +359,7 @@ function gun_default:construct_base_class()
end end
if self.consts.VERSION[2] < 3 then if self.consts.VERSION[2] < 3 then
minetest.log("error", "Guns4d: `"..self.name.."` had minor version before `1.3.0` indicating that this gun likely has no versioning. Attempting patches for `1.2.0`...") minetest.log("error", "Guns4d: `"..self.name.."` had minor version before `1.3.0` indicating that this gun likely has no versioning. Attempting patches for `1.2.0`...")
patch_old_gun(self, 2) patch_deprecated(self, 2)
end end
self.properties = leef.class.proxy_table.new(self.properties) self.properties = leef.class.proxy_table.new(self.properties)

View File

@ -194,13 +194,13 @@ function gun_default:update_image_and_text_meta(meta)
end end
end end
--pick the image --pick the image
local image = self.properties.inventory_image local image = self.properties.inventory.inventory_image
if (ammo.total_bullets > 0) and not ammo.magazine_psuedo_empty then if (ammo.total_bullets > 0) and not ammo.magazine_psuedo_empty then
image = self.properties.inventory_image image = self.properties.inventory.inventory_image
elseif self.properties.inventory_image_magless and ( (ammo.loaded_mag == "empty") or (ammo.loaded_mag == "") or ammo.magazine_psuedo_empty) then elseif self.properties.inventory.inventory_image_magless and ( (ammo.loaded_mag == "empty") or (ammo.loaded_mag == "") or ammo.magazine_psuedo_empty) then
image = self.properties.inventory_image_magless image = self.properties.inventory.inventory_image_magless
elseif self.properties.inventory_image_empty then elseif self.properties.inventory.inventory_image_empty then
image = self.properties.inventory_image_empty image = self.properties.inventory.inventory_image_empty
end end
--add the firemode overlay to the image --add the firemode overlay to the image
local firemodes = 0 local firemodes = 0

View File

@ -1,8 +1,6 @@
--- Gun class
local Vec = vector local Vec = vector
--- Gun class fields --- class fields
-- --
-- ## Defining a gun: -- ## Defining a gun:
-- --
@ -82,16 +80,17 @@ local gun_default = {
-- @field hip `table` @{gun.properties.hip|hipfire properties} -- @field hip `table` @{gun.properties.hip|hipfire properties}
-- @field ads `table` @{gun.properties.ads|aiming ("aiming down sights") properties} -- @field ads `table` @{gun.properties.ads|aiming ("aiming down sights") properties}
-- @field firemodes `table` @{gun.properties.firemodes|list of firemodes} -- @field firemodes `table` @{gun.properties.firemodes|list of firemodes}
-- @field firemode_inventory_overlays `table` @{gun.properties.firemode_inventory_overlays|list of corresponding images for firemodes}
-- @field recoil `table` @{gun.properties.recoil|defines the guns recoil} -- @field recoil `table` @{gun.properties.recoil|defines the guns recoil}
-- @field sway `table` @{gun.properties.sway|defines the guns idle sway} -- @field sway `table` @{gun.properties.sway|defines the guns idle sway}
-- @field wag `table` @{gun.properties.wag|defines the movement of the gun while walking} -- @field wag `table` @{gun.properties.wag|defines the movement of the gun while walking}
-- @field charging `table` @{gun.properties.charging|defines how rounds are chambered into the gun} -- @field charging `table` @{gun.properties.charging|defines how rounds are chambered into the gun}
-- @field ammo `table` @{gun.properties.ammo|defines what ammo the gun uses} -- @field ammo `table` @{gun.properties.ammo|defines what ammo the gun uses}
-- @field visuals `table` @{gun.properties.visuals|defines visual attributes of the gun} -- @field visuals `table` @{gun.properties.visuals|defines visual attributes of the gun}
-- @field sounds `table` @{gun.properties.sounds|defines sounds to be used by functions of the gun}
-- @field inventory `table` @{gun.properties.inventory|inventory related attributes}
-- @compact -- @compact
properties = { properties = {
--- starting vertical rotation of the gun --- `float` starting vertical rotation of the gun
initial_vertical_rotation = -60, initial_vertical_rotation = -60,
--- `float`=.5 max angular deviation (vertical) from breathing --- `float`=.5 max angular deviation (vertical) from breathing
breathing_scale = .5, breathing_scale = .5,
@ -99,10 +98,6 @@ local gun_default = {
flash_offset = Vec.new(), flash_offset = Vec.new(),
--- `int`=600 The number of rounds (cartidges) this gun can throw per minute. Used by update(), fire() and default controls --- `int`=600 The number of rounds (cartidges) this gun can throw per minute. Used by update(), fire() and default controls
firerateRPM = 600, firerateRPM = 600,
--- `string` inventory image for when the gun has no magazine
inventory_image_magless = nil,
--- `string` inventory image for when the gun is loaded. This is added automatically during construction.
inventory_image = nil,
--- an ordered list of reloading states used by @{default_controls}. --- an ordered list of reloading states used by @{default_controls}.
-- --
-- the default reload states for a magazine operated weapon, copied from the m4. -- the default reload states for a magazine operated weapon, copied from the m4.
@ -113,7 +108,7 @@ local gun_default = {
-- {action="load", time=.5, anim="load", sounds = {sound="ar_mag_load", delay = .25}}, -- {action="load", time=.5, anim="load", sounds = {sound="ar_mag_load", delay = .25}},
-- {action="charge", time=.5, anim="charge", sounds={sound="ar_charge", delay = .2}} -- {action="charge", time=.5, anim="charge", sounds={sound="ar_charge", delay = .2}}
reload = {}, reload = {},
--- a table {x1,y1,z1,x2,y2,z2} specifying the bounding box of the model. The first 3 (x1,y1,z1) are the lower of their counterparts. This is autogenerated if not present. --- `table` (optional) a table `{x1,y1,z1, x2,y2,z2}` specifying the bounding box of the model. The first 3 (x1,y1,z1) are the lower of their counterparts. This is autogenerated from the model when not present, reccomended that you leave nil.
model_bounding_box = nil, model_bounding_box = nil,
--- `string` overlay on the item to use when infinite ammo is on --- `string` overlay on the item to use when infinite ammo is on
infinite_inventory_overlay = "inventory_overlay_inf_ammo.png", infinite_inventory_overlay = "inventory_overlay_inf_ammo.png",
@ -137,19 +132,15 @@ local gun_default = {
firemode = Guns4d.default_touch_controls.firemode, firemode = Guns4d.default_touch_controls.firemode,
jump_cancel_ads = Guns4d.default_touch_controls.jump_cancel_ads jump_cancel_ads = Guns4d.default_touch_controls.jump_cancel_ads
}, },
--- properties.inventory
--
-- @table gun.properties.inventory
-- @see lvl1_fields.properties|properties
-- @compact
inventory = { inventory = {
--[[part_slots = { --- the size in meters to render the gun in it's inventory opened with /guns4d_inv
underbarrel = {
formspec_inventory_location = {x=0, y=1}
slots = 2,
rail = "picatinny" --only attachments fit for this type will be usable.
allowed = {
"group:guns4d_underbarrel"
},
bone = "" --the bone both to attach to and to display at on the menu.
}
},]]
render_size = 2, --length (in meters) which is visible accross the z/forward axis at y/up=0, x=0. For orthographic this will be the scale of the orthographic camera. Default 2 render_size = 2, --length (in meters) which is visible accross the z/forward axis at y/up=0, x=0. For orthographic this will be the scale of the orthographic camera. Default 2
--- the image of the gun in it's inventory opened with /guns4d_inv
render_image = "m4_ortho.png", --expects an image of the right side of the gun, where the gun is facing the right. Default "m4_ortho.png" render_image = "m4_ortho.png", --expects an image of the right side of the gun, where the gun is facing the right. Default "m4_ortho.png"
--- table of firemodes and their overlays in the player's inventory when the gun is on that firemode --- table of firemodes and their overlays in the player's inventory when the gun is on that firemode
firemode_inventory_overlays = { --#4 firemode_inventory_overlays = { --#4
@ -162,8 +153,23 @@ local gun_default = {
--safe default: "inventory_overlay_safe.png" (unimplemented firemode) --safe default: "inventory_overlay_safe.png" (unimplemented firemode)
safe = "inventory_overlay_safe.png" safe = "inventory_overlay_safe.png"
}, },
--- `string` (optional) inventory image for when the gun has no magazine
inventory_image_magless = nil,
--- `string` inventory image for when the gun is loaded. This is added automatically during construction.
inventory_image = nil,
--[[part_slots = {
underbarrel = {
formspec_inventory_location = {x=0, y=1}
slots = 2,
rail = "picatinny" --only attachments fit for this type will be usable.
allowed = {
"group:guns4d_underbarrel"
}, },
--- `table` a list of subclasses to create on construct and update. Note special fields `ammo_handler` and `part_handler`. bone = "" --the bone both to attach to and to display at on the menu.
}
},]]
},
--- properties.subclasses
-- --
-- @table gun.properties.subclsses -- @table gun.properties.subclsses
-- @see lvl1_fields.properties|properties -- @see lvl1_fields.properties|properties
@ -394,8 +400,15 @@ local gun_default = {
fire = {x=0,y=0}, fire = {x=0,y=0},
}, },
}, },
--- a table of @{guns4d_soundspec|soundspecs} to be referenced by other functions --- properties.sounds
--
-- other fields are defined by other properties such as @{gun.properties.charging.draw_sound|properties.charging.draw_sound} and @{lvl1_fields.properties.reload|properties.reload}
-- @table gun.properties.sounds
-- @see lvl1_fields.properties|properties
-- @see guns4d_soundspec|soundspec
-- @compact
sounds = { --this does not contain reload sound effects. sounds = { --this does not contain reload sound effects.
--- sound player when firing the weapon
fire = { fire = {
{ {
__replace_old_table=true, __replace_old_table=true,

View File

@ -16,6 +16,7 @@
<div class="group two"> <div class="group two">
</div> </div>
<div class="group three"> <div class="group three">
<div class="button iconleft"><a href="../manual/changelog.html" title="changelog"><img src="../img/i-left.svg?7653a2d" alt=""/><span>Previous</span></a></div>
<div class="button iconright"><a href="../class/player_model_handler.html" title="player_model_handler"><span>Next</span><img src="../img/i-right.svg?7653a2d" alt=""/></a></div> <div class="button iconright"><a href="../class/player_model_handler.html" title="player_model_handler"><span>Next</span><img src="../img/i-right.svg?7653a2d" alt=""/></a></div>
</div> </div>
</div> </div>
@ -29,14 +30,16 @@
<li><a href="#gun">Class <code>gun</code></a></li> <li><a href="#gun">Class <code>gun</code></a></li>
<li><a href="#lvl1_fields.properties"><p>properties</p> <li><a href="#lvl1_fields.properties"><p>properties</p>
</a></li> </a></li>
<li><a href="#gun.properties.inventory"><p>properties.inventory</p>
</a></li>
<li><a href="#gun.properties.subclsses"><p>properties.subclasses</p>
</a></li>
<li><a href="#gun.properties.ads"><p>properties.ads</p> <li><a href="#gun.properties.ads"><p>properties.ads</p>
</a></li> </a></li>
<li><a href="#gun.properties.hip"><p>properties.hip</p> <li><a href="#gun.properties.hip"><p>properties.hip</p>
</a></li> </a></li>
<li><a href="#gun.properties.firemodes"><p>properties.firemodes</p> <li><a href="#gun.properties.firemodes"><p>properties.firemodes</p>
</a></li> </a></li>
<li><a href="#gun.properties.firemode_inventory_overlays"><p>properties.firemode_inventory_overlays</p>
</a></li>
<li><a href="#gun.properties.recoil"><p>properties.recoil</p> <li><a href="#gun.properties.recoil"><p>properties.recoil</p>
</a></li> </a></li>
<li><a href="#gun.properties.sway"><p>properties.sway</p> <li><a href="#gun.properties.sway"><p>properties.sway</p>
@ -49,12 +52,20 @@
</a></li> </a></li>
<li><a href="#gun.properties.visuals"><p>properties.visuals</p> <li><a href="#gun.properties.visuals"><p>properties.visuals</p>
</a></li> </a></li>
<li><a href="#gun.properties.sounds"><p>properties.sounds</p>
</a></li>
<li><a href="#lvl1_fields.offsets"><p>offsets</p> <li><a href="#lvl1_fields.offsets"><p>offsets</p>
</a></li> </a></li>
<li><a href="#lvl1_fields.consts"><p>consts</p> <li><a href="#lvl1_fields.consts"><p>consts</p>
</a></li> </a></li>
</ul> </ul>
</div> </div>
<div class="manual">
<div class="heading">Manual</div>
<ul>
<li><a href="../manual/changelog.html">changelog 1.3.0</a></li>
</ul>
</div>
<div class="classes"> <div class="classes">
<div class="heading">Classes</div> <div class="heading">Classes</div>
<ul> <ul>
@ -79,7 +90,7 @@
<a class="permalink" href="#gun" title="Permalink to this definition"></a> <a class="permalink" href="#gun" title="Permalink to this definition"></a>
</h2> </h2>
<div class="inner"> <div class="inner">
<p>Gun class fields</p> <p>class fields</p>
<h2>Defining a gun:</h2> <h2>Defining a gun:</h2>
<p><strong>method documentation coming soon</strong> (or never...)</p> <p><strong>method documentation coming soon</strong> (or never...)</p>
<p>The appearance and handling of guns by default are defined by two table fields: their <a href="../class/gun.html#lvl1_fields.consts">consts</a> and their <a href="../class/gun.html#lvl1_fields.properties">properties</a>. <p>The appearance and handling of guns by default are defined by two table fields: their <a href="../class/gun.html#lvl1_fields.consts">consts</a> and their <a href="../class/gun.html#lvl1_fields.properties">properties</a>.
@ -92,6 +103,8 @@ it's reccomended that you take a look at existing mods (like guns4d_pack_1) for
<p>Guns4d uses a class system for most moving parts- including the gun. New guns therefore are created with the :inherit(def) method, <p>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() 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 &quot;__template&quot; for template classes of guns.</p> or you can do the same thing with a seperate class of weapons. Set name to &quot;__template&quot; for template classes of guns.</p>
<p>for properties: for tables where you wish to delete the parent class's fields altogether (since inheritence prevents this) you can set the field &quot;__replace_old_table=true&quot;
additionally</p>
<p><em>Please note:</em> there are likey undocumented fields that are used in internal functions. If you find one, please make an issue on Github.</p> <p><em>Please note:</em> there are likey undocumented fields that are used in internal functions. If you find one, please make an issue on Github.</p>
<div class="synopsis"> <div class="synopsis">
@ -203,17 +216,27 @@ or you can do the same thing with a seperate class of weapons. Set name to &quot
</tr> </tr>
<tr> <tr>
<td class="name"><var id="gun.property_modifiers">property_modifiers</var><a class="permalink" href="#gun.property_modifiers" title="Permalink to this definition"></a></td> <td class="name"><var id="gun.property_modifiers">property_modifiers</var><a class="permalink" href="#gun.property_modifiers" title="Permalink to this definition"></a></td>
<td class="doc"><p><a href="../module/misc_helpers.html#table"><code>table</code></a> indexed list of modifiers not set by the gun but to be applied to the gun. After changing, gun:update_modifiers() must be called to update it. Also may contain lists of modifiers.</p> <td class="doc"><p><a href="../module/misc_helpers.html#table"><code>table</code></a> indexed list of functions which are called when the gun's properties need to be built. This is used for things like attachments, etc.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="name"><var id="gun.sounds">sounds</var><a class="permalink" href="#gun.sounds" title="Permalink to this definition"></a></td> <td class="name"><var id="gun.attached_objects">attached_objects</var><a class="permalink" href="#gun.attached_objects" title="Permalink to this definition"></a></td>
<td class="doc"><p>a table of <a href="../module/play_sound.html#guns4d_soundspec">soundspecs</a> to be referenced by other functions</p> <td class="doc"><p><a href="../module/misc_helpers.html#table"><code>table</code></a> a list of ObjRefs that are attached to the gun as a result of attached_objects</p>
</td>
</tr>
<tr>
<td class="name"><var id="gun.subclass_instances">subclass_instances</var><a class="permalink" href="#gun.subclass_instances" title="Permalink to this definition"></a></td>
<td class="doc"><p><a href="../module/misc_helpers.html#table"><code>table</code></a> list of subclass instances (i.e. Sprite_scope)</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="name"><var id="gun.animation_rotation">animation_rotation</var><a class="permalink" href="#gun.animation_rotation" title="Permalink to this definition"></a></td> <td class="name"><var id="gun.animation_rotation">animation_rotation</var><a class="permalink" href="#gun.animation_rotation" title="Permalink to this definition"></a></td>
<td class="doc"><p><code>vector</code> containing the offset from animations, this will be generated if {@consts.ANIMATIONS_OFFSET_AIM}=true</p> <td class="doc"><p><code>vector</code> containing the rotation offset from the current frame, this will be factored into the gun's direction if {@consts.ANIMATIONS_OFFSET_AIM}=true</p>
</td>
</tr>
<tr>
<td class="name"><var id="gun.animation_translation">animation_translation</var><a class="permalink" href="#gun.animation_translation" title="Permalink to this definition"></a></td>
<td class="doc"><p><code>vector</code> containing the translational/positional offset from the current frame</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -257,11 +280,6 @@ offsets are changed after update, this will not be updated automatically until t
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="name"><var id="lvl1_fields.properties.firemode_inventory_overlays">firemode_inventory_overlays</var><a class="permalink" href="#lvl1_fields.properties.firemode_inventory_overlays" title="Permalink to this definition"></a></td>
<td class="doc"><p><a href="../module/misc_helpers.html#table"><code>table</code></a> <a href="../class/gun.html#gun.properties.firemode_inventory_overlays">list of corresponding images for firemodes</a></p>
</td>
</tr>
<tr>
<td class="name"><var id="lvl1_fields.properties.recoil">recoil</var><a class="permalink" href="#lvl1_fields.properties.recoil" title="Permalink to this definition"></a></td> <td class="name"><var id="lvl1_fields.properties.recoil">recoil</var><a class="permalink" href="#lvl1_fields.properties.recoil" title="Permalink to this definition"></a></td>
<td class="doc"><p><a href="../module/misc_helpers.html#table"><code>table</code></a> <a href="../class/gun.html#gun.properties.recoil">defines the guns recoil</a></p> <td class="doc"><p><a href="../module/misc_helpers.html#table"><code>table</code></a> <a href="../class/gun.html#gun.properties.recoil">defines the guns recoil</a></p>
</td> </td>
@ -292,28 +310,18 @@ offsets are changed after update, this will not be updated automatically until t
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="name"><var id="lvl1_fields.properties.ammo_handler">ammo_handler</var><a class="permalink" href="#lvl1_fields.properties.ammo_handler" title="Permalink to this definition"></a></td> <td class="name"><var id="lvl1_fields.properties.sounds">sounds</var><a class="permalink" href="#lvl1_fields.properties.sounds" title="Permalink to this definition"></a></td>
<td class="doc"><p><code>Ammo_handler</code> the class (based on) ammo_handler to create an instance of and use. Default is <code>Guns4d.ammo_handler</code></p> <td class="doc"><p><a href="../module/misc_helpers.html#table"><code>table</code></a> <a href="../class/gun.html#gun.properties.sounds">defines sounds to be used by functions of the gun</a></p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="name"><var id="lvl1_fields.properties.part_handler">Part_handler</var><a class="permalink" href="#lvl1_fields.properties.part_handler" title="Permalink to this definition"></a></td> <td class="name"><var id="lvl1_fields.properties.inventory">inventory</var><a class="permalink" href="#lvl1_fields.properties.inventory" title="Permalink to this definition"></a></td>
<td class="doc"><p><code>Part_handler</code> Part_handler class to use. Default is <code>Guns4d.part_handler</code></p> <td class="doc"><p><a href="../module/misc_helpers.html#table"><code>table</code></a> <a href="../class/gun.html#gun.properties.inventory">inventory related attributes</a></p>
</td>
</tr>
<tr>
<td class="name"><var id="lvl1_fields.properties.sprite_scope">sprite_scope</var><a class="permalink" href="#lvl1_fields.properties.sprite_scope" title="Permalink to this definition"></a></td>
<td class="doc"><p><code>Sprite_scope</code> sprite scope class to use</p>
</td>
</tr>
<tr>
<td class="name"><var id="lvl1_fields.properties.crosshair">crosshair</var><a class="permalink" href="#lvl1_fields.properties.crosshair" title="Permalink to this definition"></a></td>
<td class="doc"><p><code>Dynamic_crosshair</code> crosshair class to use</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="name"><var id="lvl1_fields.properties.initial_vertical_rotation">initial_vertical_rotation</var><a class="permalink" href="#lvl1_fields.properties.initial_vertical_rotation" title="Permalink to this definition"></a></td> <td class="name"><var id="lvl1_fields.properties.initial_vertical_rotation">initial_vertical_rotation</var><a class="permalink" href="#lvl1_fields.properties.initial_vertical_rotation" title="Permalink to this definition"></a></td>
<td class="doc"><p>starting vertical rotation of the gun</p> <td class="doc"><p><code>float</code> starting vertical rotation of the gun</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -332,16 +340,6 @@ offsets are changed after update, this will not be updated automatically until t
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="name"><var id="lvl1_fields.properties.inventory_image_magless">inventory_image_magless</var><a class="permalink" href="#lvl1_fields.properties.inventory_image_magless" title="Permalink to this definition"></a></td>
<td class="doc"><p><code>string</code> inventory image for when the gun has no magazine</p>
</td>
</tr>
<tr>
<td class="name"><var id="lvl1_fields.properties.inventory_image">inventory_image</var><a class="permalink" href="#lvl1_fields.properties.inventory_image" title="Permalink to this definition"></a></td>
<td class="doc"><p><code>string</code> inventory image for when the gun is loaded. This is added automatically during construction.</p>
</td>
</tr>
<tr>
<td class="name"><var id="lvl1_fields.properties.reload">reload</var><a class="permalink" href="#lvl1_fields.properties.reload" title="Permalink to this definition"></a></td> <td class="name"><var id="lvl1_fields.properties.reload">reload</var><a class="permalink" href="#lvl1_fields.properties.reload" title="Permalink to this definition"></a></td>
<td class="doc"><p>an ordered list of reloading states used by default_controls.</p> <td class="doc"><p>an ordered list of reloading states used by default_controls.</p>
<p>the default reload states for a magazine operated weapon, copied from the m4.</p> <p>the default reload states for a magazine operated weapon, copied from the m4.</p>
@ -356,7 +354,7 @@ offsets are changed after update, this will not be updated automatically until t
</tr> </tr>
<tr> <tr>
<td class="name"><var id="lvl1_fields.properties.model_bounding_box">model_bounding_box</var><a class="permalink" href="#lvl1_fields.properties.model_bounding_box" title="Permalink to this definition"></a></td> <td class="name"><var id="lvl1_fields.properties.model_bounding_box">model_bounding_box</var><a class="permalink" href="#lvl1_fields.properties.model_bounding_box" title="Permalink to this definition"></a></td>
<td class="doc"><p>a table {x1,y1,z1,x2,y2,z2} specifying the bounding box of the model. The first 3 (x1,y1,z1) are the lower of their counterparts. This is autogenerated if not present.</p> <td class="doc"><p><a href="../module/misc_helpers.html#table"><code>table</code></a> (optional) a table <code>{x1,y1,z1, x2,y2,z2}</code> specifying the bounding box of the model. The first 3 (x1,y1,z1) are the lower of their counterparts. This is autogenerated from the model when not present, reccomended that you leave nil.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -384,6 +382,79 @@ offsets are changed after update, this will not be updated automatically until t
</div> </div>
</div> </div>
<div class="section"> <div class="section">
<h2 class="table" id="gun.properties.inventory">properties.inventory
<a class="permalink" href="#gun.properties.inventory" title="Permalink to this definition"></a>
</h2>
<div class="inner">
<div class="see">See also <a href="../class/gun.html#lvl1_fields.properties">properties</a></div>
<div class="synopsis">
<table class="fields compact">
<tr>
<td class="name"><var id="gun.properties.inventory.render_size">render_size</var><a class="permalink" href="#gun.properties.inventory.render_size" title="Permalink to this definition"></a></td>
<td class="doc"><p>the size in meters to render the gun in it's inventory opened with /guns4d_inv</p>
</td>
</tr>
<tr>
<td class="name"><var id="gun.properties.inventory.render_image">render_image</var><a class="permalink" href="#gun.properties.inventory.render_image" title="Permalink to this definition"></a></td>
<td class="doc"><p>the image of the gun in it's inventory opened with /guns4d_inv</p>
</td>
</tr>
<tr>
<td class="name"><var id="gun.properties.inventory.firemode_inventory_overlays">firemode_inventory_overlays</var><a class="permalink" href="#gun.properties.inventory.firemode_inventory_overlays" title="Permalink to this definition"></a></td>
<td class="doc"><p>table of firemodes and their overlays in the player's inventory when the gun is on that firemode</p>
</td>
</tr>
<tr>
<td class="name"><var id="gun.properties.inventory.inventory_image_magless">inventory_image_magless</var><a class="permalink" href="#gun.properties.inventory.inventory_image_magless" title="Permalink to this definition"></a></td>
<td class="doc"><p><code>string</code> (optional) inventory image for when the gun has no magazine</p>
</td>
</tr>
<tr>
<td class="name"><var id="gun.properties.inventory.inventory_image">inventory_image</var><a class="permalink" href="#gun.properties.inventory.inventory_image" title="Permalink to this definition"></a></td>
<td class="doc"><p><code>string</code> inventory image for when the gun is loaded. This is added automatically during construction.</p>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="section">
<h2 class="table" id="gun.properties.subclsses">properties.subclasses
<a class="permalink" href="#gun.properties.subclsses" title="Permalink to this definition"></a>
</h2>
<div class="inner">
<div class="see">See also <a href="../class/gun.html#lvl1_fields.properties">properties</a></div>
<div class="synopsis">
<table class="fields compact">
<tr>
<td class="name"><var id="gun.properties.subclsses.ammo_handler">ammo_handler</var><a class="permalink" href="#gun.properties.subclsses.ammo_handler" title="Permalink to this definition"></a></td>
<td class="doc"><p><code>Ammo_handler</code> the class (based on) ammo_handler to create an instance of and use. Default is <code>Guns4d.ammo_handler</code></p>
</td>
</tr>
<tr>
<td class="name"><var id="gun.properties.subclsses.part_handler">part_handler</var><a class="permalink" href="#gun.properties.subclsses.part_handler" title="Permalink to this definition"></a></td>
<td class="doc"><p><a href="../class/gun.html#gun.properties.subclsses.part_handler"><code>part_handler</code></a> Part_handler class to use. Default is <code>Guns4d.part_handler</code></p>
</td>
</tr>
<tr>
<td class="name"><var id="gun.properties.subclsses.sprite_scope">sprite_scope</var><a class="permalink" href="#gun.properties.subclsses.sprite_scope" title="Permalink to this definition"></a></td>
<td class="doc"><p><code>Sprite_scope</code> sprite scope class to use. Nil by default, inherit Sprite_scope for class (<strong>documentation needed, reccomended contact for help if working with it</strong>)</p>
</td>
</tr>
<tr>
<td class="name"><var id="gun.properties.subclsses.crosshair">crosshair</var><a class="permalink" href="#gun.properties.subclsses.crosshair" title="Permalink to this definition"></a></td>
<td class="doc"><p><code>Dynamic_crosshair</code> crosshair class to use. Nil by default, set to <code>Guns4d.Dynamic_crosshair</code> for a generic circular expanding reticle.</p>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="section">
<h2 class="table" id="gun.properties.ads">properties.ads <h2 class="table" id="gun.properties.ads">properties.ads
<a class="permalink" href="#gun.properties.ads" title="Permalink to this definition"></a> <a class="permalink" href="#gun.properties.ads" title="Permalink to this definition"></a>
@ -471,41 +542,6 @@ offsets are changed after update, this will not be updated automatically until t
</div> </div>
</div> </div>
<div class="section"> <div class="section">
<h2 class="table" id="gun.properties.firemode_inventory_overlays">properties.firemode_inventory_overlays
<a class="permalink" href="#gun.properties.firemode_inventory_overlays" title="Permalink to this definition"></a>
</h2>
<div class="inner">
<p>Defines the overlay on the gun item for each firemode. These are selected automatically by firemode string. Defaults are as follows:
<div class="see">See also <a href="../class/gun.html#lvl1_fields.properties">properties</a></div>
<div class="synopsis">
<table class="fields compact">
<tr>
<td class="name"><var id="gun.properties.firemode_inventory_overlays.single">single</var><a class="permalink" href="#gun.properties.firemode_inventory_overlays.single" title="Permalink to this definition"></a></td>
<td class="doc"><p>singlefire default: &quot;inventory_overlay_single.png&quot;</p>
</td>
</tr>
<tr>
<td class="name"><var id="gun.properties.firemode_inventory_overlays.auto">auto</var><a class="permalink" href="#gun.properties.firemode_inventory_overlays.auto" title="Permalink to this definition"></a></td>
<td class="doc"><p>automatic default: &quot;inventory_overlay_auto.png&quot;</p>
</td>
</tr>
<tr>
<td class="name"><var id="gun.properties.firemode_inventory_overlays.burst">burst</var><a class="permalink" href="#gun.properties.firemode_inventory_overlays.burst" title="Permalink to this definition"></a></td>
<td class="doc"><p>burstfire default: &quot;inventory_overlay_burst.png&quot;</p>
</td>
</tr>
<tr>
<td class="name"><var id="gun.properties.firemode_inventory_overlays.safe">safe</var><a class="permalink" href="#gun.properties.firemode_inventory_overlays.safe" title="Permalink to this definition"></a></td>
<td class="doc"><p>safe default: &quot;inventory_overlay_safe.png&quot; (unimplemented firemode)</p>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="section">
<h2 class="table" id="gun.properties.recoil">properties.recoil <h2 class="table" id="gun.properties.recoil">properties.recoil
<a class="permalink" href="#gun.properties.recoil" title="Permalink to this definition"></a> <a class="permalink" href="#gun.properties.recoil" title="Permalink to this definition"></a>
@ -663,7 +699,7 @@ this means that increasing it decreases the time it takes for the angular veloci
</tr> </tr>
<tr> <tr>
<td class="name"><var id="gun.properties.charging.draw_sound">draw_sound</var><a class="permalink" href="#gun.properties.charging.draw_sound" title="Permalink to this definition"></a></td> <td class="name"><var id="gun.properties.charging.draw_sound">draw_sound</var><a class="permalink" href="#gun.properties.charging.draw_sound" title="Permalink to this definition"></a></td>
<td class="doc"><p><code>string</code> name of the sound to play from sounds. Default &quot;draw&quot;</p> <td class="doc"><p><code>string</code> name of the sound to play from <a href="../class/gun.html#gun.properties.sounds">sounds</a>. Default &quot;draw&quot;</p>
</td> </td>
</tr> </tr>
</table> </table>
@ -730,6 +766,21 @@ this means that increasing it decreases the time it takes for the angular veloci
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="name"><var id="gun.properties.visuals.attached_objects">attached_objects</var><a class="permalink" href="#gun.properties.visuals.attached_objects" title="Permalink to this definition"></a></td>
<td class="doc"><p>objects that are attached to the gun. This is especially useful for attachments</p>
<h5>Example</h5>
<pre><code class="language-lua">my_object = {
textures = {&quot;blank.png&quot;},
visual_size = {x=1,y=1,z=1},
offset = {x=0,y=0,z=0},
bone = &quot;main&quot;,
backface_culling = false,
glow = 0
}
</code></pre>
</td>
</tr>
<tr>
<td class="name"><var id="gun.properties.visuals.backface_culling">backface_culling</var><a class="permalink" href="#gun.properties.visuals.backface_culling" title="Permalink to this definition"></a></td> <td class="name"><var id="gun.properties.visuals.backface_culling">backface_culling</var><a class="permalink" href="#gun.properties.visuals.backface_culling" title="Permalink to this definition"></a></td>
<td class="doc"><p>toggles backface culling. Default true</p> <td class="doc"><p>toggles backface culling. Default true</p>
</td> </td>
@ -755,6 +806,27 @@ reload, <a href="../class/gun.html#gun.properties.charging.draw_animation">draw_
</div> </div>
</div> </div>
<div class="section"> <div class="section">
<h2 class="table" id="gun.properties.sounds">properties.sounds
<a class="permalink" href="#gun.properties.sounds" title="Permalink to this definition"></a>
</h2>
<div class="inner">
<p>other fields are defined by other properties such as <a href="../class/gun.html#gun.properties.charging.draw_sound">properties.charging.draw_sound</a> and <a href="../class/gun.html#lvl1_fields.properties.reload">properties.reload</a>
<div class="see">See also <a href="../class/gun.html#lvl1_fields.properties">properties</a></div>
<div class="see">See also <a href="../module/play_sound.html#guns4d_soundspec">soundspec</a></div>
<div class="synopsis">
<table class="fields compact">
<tr>
<td class="name"><var id="gun.properties.sounds.fire">fire</var><a class="permalink" href="#gun.properties.sounds.fire" title="Permalink to this definition"></a></td>
<td class="doc"><p>sound player when firing the weapon</p>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="section">
<h2 class="table" id="lvl1_fields.offsets">offsets <h2 class="table" id="lvl1_fields.offsets">offsets
<a class="permalink" href="#lvl1_fields.offsets" title="Permalink to this definition"></a> <a class="permalink" href="#lvl1_fields.offsets" title="Permalink to this definition"></a>
@ -879,6 +951,11 @@ note rotations are in degrees, and translations are in meters.</p>
<td class="doc"><p><code>string</code>=&quot;left_aimpoint&quot;, the bone which the left arm aims at to</p> <td class="doc"><p><code>string</code>=&quot;left_aimpoint&quot;, the bone which the left arm aims at to</p>
</td> </td>
</tr> </tr>
<tr>
<td class="name"><var id="lvl1_fields.consts.VERSION">VERSION</var><a class="permalink" href="#lvl1_fields.consts.VERSION" title="Permalink to this definition"></a></td>
<td class="doc"><p><a href="../module/misc_helpers.html#table"><code>table</code></a> version of 4dguns this gun is made for. If left empty it will be assumed it is before 1.3.</p>
</td>
</tr>
</table> </table>
</div> </div>
</div> </div>

View File

@ -32,6 +32,12 @@
</a></li> </a></li>
</ul> </ul>
</div> </div>
<div class="manual">
<div class="heading">Manual</div>
<ul>
<li><a href="../manual/changelog.html">changelog 1.3.0</a></li>
</ul>
</div>
<div class="classes"> <div class="classes">
<div class="heading">Classes</div> <div class="heading">Classes</div>
<ul> <ul>

View File

@ -16,13 +16,19 @@
<div class="group two"> <div class="group two">
</div> </div>
<div class="group three"> <div class="group three">
<div class="button iconright"><a href="class/player_model_handler.html" title="player_model_handler"><span>Next</span><img src="img/i-right.svg?7653a2d" alt=""/></a></div> <div class="button iconright"><a href="class/gun.html" title="gun"><span>Next</span><img src="img/i-right.svg?7653a2d" alt=""/></a></div>
</div> </div>
</div> </div>
<div class="sidebar"> <div class="sidebar">
<form action="search.html"> <form action="search.html">
<input class="search" name="q" type="search" placeholder="Search" /> <input class="search" name="q" type="search" placeholder="Search" />
</form> </form>
<div class="manual">
<div class="heading">Manual</div>
<ul>
<li><a href="manual/changelog.html">changelog 1.3.0</a></li>
</ul>
</div>
<div class="classes"> <div class="classes">
<div class="heading">Classes</div> <div class="heading">Classes</div>
<ul> <ul>

View File

@ -1,5 +1,5 @@
var docs = [ var docs = [
{path:"class/gun.html", type:"class", title:"Gun.gun", text:"Gun 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. 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.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:"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/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."}, {path:"module/play_sound.html", type:"module", title:"play_sound", text:"implements tools for quickly playing audio."},
@ -36,33 +36,39 @@ var docs = [
{path:"class/gun.html#gun.burst_queue", type:"field", title:"gun.burst_queue", text:"int number of rounds left that need to be fired after a burst fire"}, {path:"class/gun.html#gun.burst_queue", type:"field", title:"gun.burst_queue", text:"int number of rounds left that need to be fired after a burst fire"},
{path:"class/gun.html#gun.muzzle_flash", type:"field", title:"gun.muzzle_flash", text:"function"}, {path:"class/gun.html#gun.muzzle_flash", type:"field", title:"gun.muzzle_flash", text:"function"},
{path:"class/gun.html#gun.gun_translation", type:"field", title:"gun.gun_translation", text:"vec3 translation of the gun relative to the \"gun\" bone or the player axial rotation."}, {path:"class/gun.html#gun.gun_translation", type:"field", title:"gun.gun_translation", text:"vec3 translation of the gun relative to the \"gun\" bone or the player axial rotation."},
{path:"class/gun.html#gun.property_modifiers", type:"field", title:"gun.property_modifiers", text:"table indexed list of modifiers not set by the gun but to be applied to the gun. After changing, gun:update_modifiers() must be called to update it. Also may contain lists of modifiers."}, {path:"class/gun.html#gun.property_modifiers", type:"field", title:"gun.property_modifiers", text:"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."},
{path:"class/gun.html#gun.attached_objects", type:"field", title:"gun.attached_objects", text:"table a list of ObjRefs that are attached to the gun as a result of attached_objects"},
{path:"class/gun.html#gun.subclass_instances", type:"field", title:"gun.subclass_instances", text:"table list of subclass instances (i.e. Sprite_scope)"},
{path:"class/gun.html#lvl1_fields.properties.hip", type:"field", title:"lvl1_fields.properties.hip", text:"table hipfire properties"}, {path:"class/gun.html#lvl1_fields.properties.hip", type:"field", title:"lvl1_fields.properties.hip", text:"table hipfire properties"},
{path:"class/gun.html#lvl1_fields.properties.ads", type:"field", title:"lvl1_fields.properties.ads", text:"table aiming (\"aiming down sights\") properties"}, {path:"class/gun.html#lvl1_fields.properties.ads", type:"field", title:"lvl1_fields.properties.ads", text:"table aiming (\"aiming down sights\") properties"},
{path:"class/gun.html#lvl1_fields.properties.firemodes", type:"field", title:"lvl1_fields.properties.firemodes", text:"table list of firemodes"}, {path:"class/gun.html#lvl1_fields.properties.firemodes", type:"field", title:"lvl1_fields.properties.firemodes", text:"table list of firemodes"},
{path:"class/gun.html#lvl1_fields.properties.firemode_inventory_overlays", type:"field", title:"lvl1_fields.properties.firemode_inventory_overlays", text:"table list of corresponding images for firemodes"},
{path:"class/gun.html#lvl1_fields.properties.recoil", type:"field", title:"lvl1_fields.properties.recoil", text:"table defines the guns recoil"}, {path:"class/gun.html#lvl1_fields.properties.recoil", type:"field", title:"lvl1_fields.properties.recoil", text:"table defines the guns recoil"},
{path:"class/gun.html#lvl1_fields.properties.sway", type:"field", title:"lvl1_fields.properties.sway", text:"table defines the guns idle sway"}, {path:"class/gun.html#lvl1_fields.properties.sway", type:"field", title:"lvl1_fields.properties.sway", text:"table defines the guns idle sway"},
{path:"class/gun.html#lvl1_fields.properties.wag", type:"field", title:"lvl1_fields.properties.wag", text:"table defines the movement of the gun while walking"}, {path:"class/gun.html#lvl1_fields.properties.wag", type:"field", title:"lvl1_fields.properties.wag", text:"table defines the movement of the gun while walking"},
{path:"class/gun.html#lvl1_fields.properties.charging", type:"field", title:"lvl1_fields.properties.charging", text:"table defines how rounds are chambered into the gun"}, {path:"class/gun.html#lvl1_fields.properties.charging", type:"field", title:"lvl1_fields.properties.charging", text:"table defines how rounds are chambered into the gun"},
{path:"class/gun.html#lvl1_fields.properties.ammo", type:"field", title:"lvl1_fields.properties.ammo", text:"table defines what ammo the gun uses"}, {path:"class/gun.html#lvl1_fields.properties.ammo", type:"field", title:"lvl1_fields.properties.ammo", text:"table defines what ammo the gun uses"},
{path:"class/gun.html#lvl1_fields.properties.visuals", type:"field", title:"lvl1_fields.properties.visuals", text:"table defines visual attributes of the gun"}, {path:"class/gun.html#lvl1_fields.properties.visuals", type:"field", title:"lvl1_fields.properties.visuals", text:"table defines visual attributes of the gun"},
{path:"class/gun.html#lvl1_fields.properties.ammo_handler", type:"field", title:"lvl1_fields.properties.ammo_handler", text:"Ammo_handler the class (based on) ammo_handler to create an instance of and use. Default is Guns4d.ammo_handler"}, {path:"class/gun.html#lvl1_fields.properties.sounds", type:"field", title:"lvl1_fields.properties.sounds", text:"table defines sounds to be used by functions of the gun"},
{path:"class/gun.html#lvl1_fields.properties.part_handler", type:"field", title:"lvl1_fields.properties.part_handler", text:"Part_handler Part_handler class to use. Default is Guns4d.part_handler"}, {path:"class/gun.html#lvl1_fields.properties.inventory", type:"field", title:"lvl1_fields.properties.inventory", text:"table inventory related attributes"},
{path:"class/gun.html#lvl1_fields.properties.sprite_scope", type:"field", title:"lvl1_fields.properties.sprite_scope", text:"Sprite_scope sprite scope class to use"}, {path:"class/gun.html#lvl1_fields.properties.initial_vertical_rotation", type:"field", title:"lvl1_fields.properties.initial_vertical_rotation", text:"float starting vertical rotation of the gun"},
{path:"class/gun.html#lvl1_fields.properties.crosshair", type:"field", title:"lvl1_fields.properties.crosshair", text:"Dynamic_crosshair crosshair class to use"},
{path:"class/gun.html#lvl1_fields.properties.initial_vertical_rotation", type:"field", title:"lvl1_fields.properties.initial_vertical_rotation", text:"starting vertical rotation of the gun"},
{path:"class/gun.html#lvl1_fields.properties.breathing_scale", type:"field", title:"lvl1_fields.properties.breathing_scale", text:"float=.5 max angular deviation (vertical) from breathing"}, {path:"class/gun.html#lvl1_fields.properties.breathing_scale", type:"field", title:"lvl1_fields.properties.breathing_scale", text:"float=.5 max angular deviation (vertical) from breathing"},
{path:"class/gun.html#lvl1_fields.properties.flash_offset", type:"field", title:"lvl1_fields.properties.flash_offset", text:"vector the offset from the center of the muzzle flash. Used by fire()"}, {path:"class/gun.html#lvl1_fields.properties.flash_offset", type:"field", title:"lvl1_fields.properties.flash_offset", text:"vector the offset from the center of the muzzle flash. Used by fire()"},
{path:"class/gun.html#lvl1_fields.properties.firerateRPM", type:"field", title:"lvl1_fields.properties.firerateRPM", text:"int=600 The number of rounds (cartidges) this gun can throw per minute. Used by update(), fire() and default controls"}, {path:"class/gun.html#lvl1_fields.properties.firerateRPM", type:"field", title:"lvl1_fields.properties.firerateRPM", text:"int=600 The number of rounds (cartidges) this gun can throw per minute. Used by update(), fire() and default controls"},
{path:"class/gun.html#lvl1_fields.properties.inventory_image_magless", type:"field", title:"lvl1_fields.properties.inventory_image_magless", text:"string inventory image for when the gun has no magazine"},
{path:"class/gun.html#lvl1_fields.properties.inventory_image", type:"field", title:"lvl1_fields.properties.inventory_image", text:"string inventory image for when the gun is loaded. This is added automatically during construction."},
{path:"class/gun.html#lvl1_fields.properties.reload", type:"field", title:"lvl1_fields.properties.reload", text:"an ordered list of reloading states used by default_controls. the default reload states for a magazine operated weapon, copied from the m4. Example"}, {path:"class/gun.html#lvl1_fields.properties.reload", type:"field", title:"lvl1_fields.properties.reload", text:"an ordered list of reloading states used by default_controls. the default reload states for a magazine operated weapon, copied from the m4. Example"},
{path:"class/gun.html#lvl1_fields.properties.model_bounding_box", type:"field", title:"lvl1_fields.properties.model_bounding_box", text:"a table {x1,y1,z1,x2,y2,z2} specifying the bounding box of the model. The first 3 (x1,y1,z1) are the lower of their counterparts. This is autogenerated if not present."}, {path:"class/gun.html#lvl1_fields.properties.model_bounding_box", type:"field", title:"lvl1_fields.properties.model_bounding_box", text:"table (optional) a table {x1,y1,z1, x2,y2,z2} specifying the bounding box of the model. The first 3 (x1,y1,z1) are the lower of their counterparts. This is autogenerated from the model when not present, reccomended that you leave nil."},
{path:"class/gun.html#lvl1_fields.properties.infinite_inventory_overlay", type:"field", title:"lvl1_fields.properties.infinite_inventory_overlay", text:"string overlay on the item to use when infinite ammo is on"}, {path:"class/gun.html#lvl1_fields.properties.infinite_inventory_overlay", type:"field", title:"lvl1_fields.properties.infinite_inventory_overlay", text:"string overlay on the item to use when infinite ammo is on"},
{path:"class/gun.html#lvl1_fields.properties.burst", type:"field", title:"lvl1_fields.properties.burst", text:"int=3 how many rounds in burst using when firemode is at \"burst\""}, {path:"class/gun.html#lvl1_fields.properties.burst", type:"field", title:"lvl1_fields.properties.burst", text:"int=3 how many rounds in burst using when firemode is at \"burst\""},
{path:"class/gun.html#lvl1_fields.properties.pc_control_actions", type:"field", title:"lvl1_fields.properties.pc_control_actions", text:"table containing a list of actions for PC users passed to Control_handler"}, {path:"class/gun.html#lvl1_fields.properties.pc_control_actions", type:"field", title:"lvl1_fields.properties.pc_control_actions", text:"table containing a list of actions for PC users passed to Control_handler"},
{path:"class/gun.html#lvl1_fields.properties.touch_control_actions", type:"field", title:"lvl1_fields.properties.touch_control_actions", text:"table containing a list of actions for touch screen users passed to Control_handler"}, {path:"class/gun.html#lvl1_fields.properties.touch_control_actions", type:"field", title:"lvl1_fields.properties.touch_control_actions", text:"table containing a list of actions for touch screen users passed to Control_handler"},
{path:"class/gun.html#gun.properties.inventory.render_size", type:"field", title:"gun.properties.inventory.render_size", text:"the size in meters to render the gun in it's inventory opened with /guns4d_inv"},
{path:"class/gun.html#gun.properties.inventory.render_image", type:"field", title:"gun.properties.inventory.render_image", text:"the image of the gun in it's inventory opened with /guns4d_inv"},
{path:"class/gun.html#gun.properties.inventory.firemode_inventory_overlays", type:"field", title:"gun.properties.inventory.firemode_inventory_overlays", text:"table of firemodes and their overlays in the player's inventory when the gun is on that firemode"},
{path:"class/gun.html#gun.properties.inventory.inventory_image_magless", type:"field", title:"gun.properties.inventory.inventory_image_magless", text:"string (optional) inventory image for when the gun has no magazine"},
{path:"class/gun.html#gun.properties.inventory.inventory_image", type:"field", title:"gun.properties.inventory.inventory_image", text:"string inventory image for when the gun is loaded. This is added automatically during construction."},
{path:"class/gun.html#gun.properties.subclsses.ammo_handler", type:"field", title:"gun.properties.subclsses.ammo_handler", text:"Ammo_handler the class (based on) ammo_handler to create an instance of and use. Default is Guns4d.ammo_handler"},
{path:"class/gun.html#gun.properties.subclsses.part_handler", type:"field", title:"gun.properties.subclsses.part_handler", text:"part_handler Part_handler class to use. Default is Guns4d.part_handler"},
{path:"class/gun.html#gun.properties.subclsses.sprite_scope", type:"field", title:"gun.properties.subclsses.sprite_scope", text:"Sprite_scope sprite scope class to use. Nil by default, inherit Sprite_scope for class (*documentation needed, reccomended contact for help if working with it*)"},
{path:"class/gun.html#gun.properties.subclsses.crosshair", type:"field", title:"gun.properties.subclsses.crosshair", text:"Dynamic_crosshair crosshair class to use. Nil by default, set to Guns4d.Dynamic_crosshair for a generic circular expanding reticle."},
{path:"class/gun.html#gun.properties.ads.offset", type:"field", title:"gun.properties.ads.offset", text:"vector the offset of the gun relative to the eye's position at hip."}, {path:"class/gun.html#gun.properties.ads.offset", type:"field", title:"gun.properties.ads.offset", text:"vector the offset of the gun relative to the eye's position at hip."},
{path:"class/gun.html#gun.properties.ads.horizontal_offset", type:"field", title:"gun.properties.ads.horizontal_offset", text:"float the horizontal offset of the eye when aiming"}, {path:"class/gun.html#gun.properties.ads.horizontal_offset", type:"field", title:"gun.properties.ads.horizontal_offset", text:"float the horizontal offset of the eye when aiming"},
{path:"class/gun.html#gun.properties.ads.aim_time", type:"field", title:"gun.properties.ads.aim_time", text:"the time it takes to go into full aim"}, {path:"class/gun.html#gun.properties.ads.aim_time", type:"field", title:"gun.properties.ads.aim_time", text:"the time it takes to go into full aim"},
@ -73,10 +79,6 @@ var docs = [
{path:"class/gun.html#gun.properties.firemodes."single"", type:"field", title:"gun.properties.firemodes.\"single\"", text:""}, {path:"class/gun.html#gun.properties.firemodes."single"", type:"field", title:"gun.properties.firemodes.\"single\"", text:""},
{path:"class/gun.html#gun.properties.firemodes."burst"", type:"field", title:"gun.properties.firemodes.\"burst\"", text:""}, {path:"class/gun.html#gun.properties.firemodes."burst"", type:"field", title:"gun.properties.firemodes.\"burst\"", text:""},
{path:"class/gun.html#gun.properties.firemodes."auto"", type:"field", title:"gun.properties.firemodes.\"auto\"", text:""}, {path:"class/gun.html#gun.properties.firemodes."auto"", type:"field", title:"gun.properties.firemodes.\"auto\"", text:""},
{path:"class/gun.html#gun.properties.firemode_inventory_overlays.single", type:"field", title:"gun.properties.firemode_inventory_overlays.single", text:"singlefire default: \"inventory_overlay_single.png\""},
{path:"class/gun.html#gun.properties.firemode_inventory_overlays.auto", type:"field", title:"gun.properties.firemode_inventory_overlays.auto", text:"automatic default: \"inventory_overlay_auto.png\""},
{path:"class/gun.html#gun.properties.firemode_inventory_overlays.burst", type:"field", title:"gun.properties.firemode_inventory_overlays.burst", text:"burstfire default: \"inventory_overlay_burst.png\""},
{path:"class/gun.html#gun.properties.firemode_inventory_overlays.safe", type:"field", title:"gun.properties.firemode_inventory_overlays.safe", text:"safe default: \"inventory_overlay_safe.png\" (unimplemented firemode)"},
{path:"class/gun.html#gun.properties.recoil.velocity_correction_factor", type:"field", title:"gun.properties.recoil.velocity_correction_factor", text:"float TL:DR higher decreases recoil at expense of smoothness. 1/value is the deviation of a normalized bell curve, where x is the time since firing. this means that increasing it decreases the time it takes for the angular velocity to fully \"decay\"."}, {path:"class/gun.html#gun.properties.recoil.velocity_correction_factor", type:"field", title:"gun.properties.recoil.velocity_correction_factor", text:"float TL:DR higher decreases recoil at expense of smoothness. 1/value is the deviation of a normalized bell curve, where x is the time since firing. this means that increasing it decreases the time it takes for the angular velocity to fully \"decay\"."},
{path:"class/gun.html#gun.properties.recoil.target_correction_factor", type:"field", title:"gun.properties.recoil.target_correction_factor", text:"float Correction of recoil offset per second is calculated as such: target_correction_factor[axis]time_since_firerecoil[axis]"}, {path:"class/gun.html#gun.properties.recoil.target_correction_factor", type:"field", title:"gun.properties.recoil.target_correction_factor", text:"float Correction of recoil offset per second is calculated as such: target_correction_factor[axis]time_since_firerecoil[axis]"},
{path:"class/gun.html#gun.properties.recoil.target_correction_max_rate", type:"field", title:"gun.properties.recoil.target_correction_max_rate", text:"float The maximum rate per second of recoil offset as determined with target_correction_factor"}, {path:"class/gun.html#gun.properties.recoil.target_correction_max_rate", type:"field", title:"gun.properties.recoil.target_correction_max_rate", text:"float The maximum rate per second of recoil offset as determined with target_correction_factor"},
@ -103,10 +105,12 @@ var docs = [
{path:"class/gun.html#gun.properties.visuals.mesh", type:"field", title:"gun.properties.visuals.mesh", text:"name of mesh to display. Currently only supports b3d"}, {path:"class/gun.html#gun.properties.visuals.mesh", type:"field", title:"gun.properties.visuals.mesh", text:"name of mesh to display. Currently only supports b3d"},
{path:"class/gun.html#gun.properties.visuals.textures", type:"field", title:"gun.properties.visuals.textures", text:"list of textures to use."}, {path:"class/gun.html#gun.properties.visuals.textures", type:"field", title:"gun.properties.visuals.textures", text:"list of textures to use."},
{path:"class/gun.html#gun.properties.visuals.scale", type:"field", title:"gun.properties.visuals.scale", text:"scale multiplier. Default 1"}, {path:"class/gun.html#gun.properties.visuals.scale", type:"field", title:"gun.properties.visuals.scale", text:"scale multiplier. Default 1"},
{path:"class/gun.html#gun.properties.visuals.attached_objects", type:"field", title:"gun.properties.visuals.attached_objects", text:"objects that are attached to the gun. This is especially useful for attachments Example"},
{path:"class/gun.html#gun.properties.visuals.backface_culling", type:"field", title:"gun.properties.visuals.backface_culling", text:"toggles backface culling. Default true"}, {path:"class/gun.html#gun.properties.visuals.backface_culling", type:"field", title:"gun.properties.visuals.backface_culling", text:"toggles backface culling. Default true"},
{path:"class/gun.html#gun.properties.visuals.animations", type:"field", title:"gun.properties.visuals.animations", text:"a table of animations. Indexes define the name of the animation to be refrenced by other functions of the gun. should be in the format {x=integer,y=integer} Example There are other animations which are variable which are not listed here, these are usually defined by properties such as: draw_animation"}, {path:"class/gun.html#gun.properties.visuals.animations", type:"field", title:"gun.properties.visuals.animations", text:"a table of animations. Indexes define the name of the animation to be refrenced by other functions of the gun. should be in the format {x=integer,y=integer} Example There are other animations which are variable which are not listed here, these are usually defined by properties such as: draw_animation"},
{path:"class/gun.html#gun.sounds", type:"field", title:"gun.sounds", text:"a table of soundspecs to be referenced by other functions"}, {path:"class/gun.html#gun.properties.sounds.fire", type:"field", title:"gun.properties.sounds.fire", text:"sound player when firing the weapon"},
{path:"class/gun.html#gun.animation_rotation", type:"field", title:"gun.animation_rotation", text:"vector containing the offset from animations, this will be generated if {@consts.ANIMATIONS_OFFSET_AIM}=true"}, {path:"class/gun.html#gun.animation_rotation", type:"field", title:"gun.animation_rotation", text:"vector containing the rotation offset from the current frame, this will be factored into the gun's direction if {@consts.ANIMATIONS_OFFSET_AIM}=true"},
{path:"class/gun.html#gun.animation_translation", type:"field", title:"gun.animation_translation", text:"vector containing the translational/positional offset from the current frame"},
{path:"class/gun.html#gun.total_offsets", type:"field", title:"gun.total_offsets", text:"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."}, {path:"class/gun.html#gun.total_offsets", type:"field", title:"gun.total_offsets", text:"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."},
{path:"class/gun.html#gun.velocities", type:"field", title:"gun.velocities", text:"velocities in the format of offsets, but only containing angular (gun_axial and player_axial) offsets."}, {path:"class/gun.html#gun.velocities", type:"field", title:"gun.velocities", text:"velocities in the format of offsets, but only containing angular (gun_axial and player_axial) offsets."},
{path:"class/gun.html#lvl1_fields.offsets.recoil", type:"field", title:"lvl1_fields.offsets.recoil", text:""}, {path:"class/gun.html#lvl1_fields.offsets.recoil", type:"field", title:"lvl1_fields.offsets.recoil", text:""},
@ -129,6 +133,7 @@ var docs = [
{path:"class/gun.html#lvl1_fields.consts.MAG_BONE", type:"field", title:"lvl1_fields.consts.MAG_BONE", text:"string=\"magazine\",the bone of the magazine in the gun (for dropping mags)"}, {path:"class/gun.html#lvl1_fields.consts.MAG_BONE", type:"field", title:"lvl1_fields.consts.MAG_BONE", text:"string=\"magazine\",the bone of the magazine in the gun (for dropping mags)"},
{path:"class/gun.html#lvl1_fields.consts.ARM_RIGHT_BONE", type:"field", title:"lvl1_fields.consts.ARM_RIGHT_BONE", text:"string=\"right_aimpoint\", the bone which the right arm aims at to"}, {path:"class/gun.html#lvl1_fields.consts.ARM_RIGHT_BONE", type:"field", title:"lvl1_fields.consts.ARM_RIGHT_BONE", text:"string=\"right_aimpoint\", the bone which the right arm aims at to"},
{path:"class/gun.html#lvl1_fields.consts.ARM_LEFT_BONE", type:"field", title:"lvl1_fields.consts.ARM_LEFT_BONE", text:"string=\"left_aimpoint\", the bone which the left arm aims at to"}, {path:"class/gun.html#lvl1_fields.consts.ARM_LEFT_BONE", type:"field", title:"lvl1_fields.consts.ARM_LEFT_BONE", text:"string=\"left_aimpoint\", the bone which the left arm aims at to"},
{path:"class/gun.html#lvl1_fields.consts.VERSION", type:"field", title:"lvl1_fields.consts.VERSION", text:"table version of 4dguns this gun is made for. If left empty it will be assumed it is before 1.3."},
{path:"class/player_model_handler.html#fields.offsets", type:"field", title:"fields.offsets", text:"fields.offsets"}, {path:"class/player_model_handler.html#fields.offsets", type:"field", title:"fields.offsets", text:"fields.offsets"},
{path:"module/misc_helpers.html#Guns4d.math.weighted_randoms", type:"function", title:"Guns4d.math.weighted_randoms", text:"picks a random index, with odds based on it's value. Returns the index of the selected."}, {path:"module/misc_helpers.html#Guns4d.math.weighted_randoms", type:"function", title:"Guns4d.math.weighted_randoms", text:"picks a random index, with odds based on it's value. Returns the index of the selected."},
{path:"module/play_sound.html#Guns4d.play_sounds", type:"function", title:"Guns4d.play_sounds", text:"allows you to play one or more sounds with more complex features, so sounds can be easily coded for guns without the need for functions. WARNING: this function modifies the tables passed to it, use Guns4d.table.shallow_copy() or table.copy for inputted soundspecs Example"}, {path:"module/play_sound.html#Guns4d.play_sounds", type:"function", title:"Guns4d.play_sounds", text:"allows you to play one or more sounds with more complex features, so sounds can be easily coded for guns without the need for functions. WARNING: this function modifies the tables passed to it, use Guns4d.table.shallow_copy() or table.copy for inputted soundspecs Example"},
@ -137,6 +142,7 @@ var docs = [
{path:"module/Bullet_hole.html#Bullet_hole.construct", type:"function", title:"Bullet_hole.construct", text:""}, {path:"module/Bullet_hole.html#Bullet_hole.construct", type:"function", title:"Bullet_hole.construct", text:""},
{path:"module/Control_handler.html#controls.toggle_touchscreen_mode", type:"function", title:"controls:toggle_touchscreen_mode", text:""}, {path:"module/Control_handler.html#controls.toggle_touchscreen_mode", type:"function", title:"controls:toggle_touchscreen_mode", text:""},
{path:"module/Gun-methods.html#gun_default.update", type:"function", title:"gun_default:update", text:"The entry method for the update of the gun calls virtually all functions that begin with update once. Also updates subclass"}, {path:"module/Gun-methods.html#gun_default.update", type:"function", title:"gun_default:update", text:"The entry method for the update of the gun calls virtually all functions that begin with update once. Also updates subclass"},
{path:"module/Gun-methods.html#gun_default.update_visuals", type:"function", title:"gun_default:update_visuals", text:"not typically called every step, updates the gun object's visuals"},
{path:"module/Gun-methods.html#gun_default.update_transforms", type:"function", title:"gun_default:update_transforms", text:"updates self.total_offsets which stores offsets for bones"}, {path:"module/Gun-methods.html#gun_default.update_transforms", type:"function", title:"gun_default:update_transforms", text:"updates self.total_offsets which stores offsets for bones"},
{path:"module/Gun-methods.html#gun_default.update_burstfire", type:"function", title:"gun_default:update_burstfire", text:"Update and fire the queued weapon burst"}, {path:"module/Gun-methods.html#gun_default.update_burstfire", type:"function", title:"gun_default:update_burstfire", text:"Update and fire the queued weapon burst"},
{path:"module/Gun-methods.html#gun_default.cycle_firemodes", type:"function", title:"gun_default:cycle_firemodes", text:"cycles to the next firemode of the weapon"}, {path:"module/Gun-methods.html#gun_default.cycle_firemodes", type:"function", title:"gun_default:cycle_firemodes", text:"cycles to the next firemode of the weapon"},
@ -145,7 +151,7 @@ var docs = [
{path:"module/Gun-methods.html#gun_default.attempt_fire", type:"function", title:"gun_default:attempt_fire", text:"attempt to fire the gun"}, {path:"module/Gun-methods.html#gun_default.attempt_fire", type:"function", title:"gun_default:attempt_fire", text:"attempt to fire the gun"},
{path:"module/Gun-methods.html#gun_default.recoil", type:"function", title:"gun_default:recoil", text:"simulate recoil by adding to the recoil velocity (called by attempt_fire)"}, {path:"module/Gun-methods.html#gun_default.recoil", type:"function", title:"gun_default:recoil", text:"simulate recoil by adding to the recoil velocity (called by attempt_fire)"},
{path:"module/Gun-methods.html#gun_default.update_look_offsets", type:"function", title:"gun_default:update_look_offsets", text:"update the offsets of the player's look created by the gun"}, {path:"module/Gun-methods.html#gun_default.update_look_offsets", type:"function", title:"gun_default:update_look_offsets", text:"update the offsets of the player's look created by the gun"},
{path:"module/Gun-methods.html#gun_default.get_pos", type:"function", title:"gun_default:get_pos", text:"get the global position of the gun. This is customized to rely on the assumption that there are 3-4 main rotations and 2-3 translations. If the behavior of the bones are changed this method may not work"}, {path:"module/Gun-methods.html#gun_default.get_pos", type:"function", title:"gun_default:get_pos", text:"get the global position of the gun. This is customized to rely on the assumption that there are 3-4 main rotations and 2-3 translations. If the behavior of the bones are changed this method may not work. the point of this is to allow the user to find the gun's object origin as well as calculate where a given point should be offset given the parameters."},
{path:"module/Gun-methods.html#gun_default.add_entity", type:"function", title:"gun_default:add_entity", text:"adds the gun entity"}, {path:"module/Gun-methods.html#gun_default.add_entity", type:"function", title:"gun_default:add_entity", text:"adds the gun entity"},
{path:"module/Gun-methods.html#gun_default.update_entity", type:"function", title:"gun_default:update_entity", text:"updates the gun's entity"}, {path:"module/Gun-methods.html#gun_default.update_entity", type:"function", title:"gun_default:update_entity", text:"updates the gun's entity"},
{path:"module/Gun-methods.html#gun_default.has_entity", type:"function", title:"gun_default:has_entity", text:"checks if the gun entity exists..."}, {path:"module/Gun-methods.html#gun_default.has_entity", type:"function", title:"gun_default:has_entity", text:"checks if the gun entity exists..."},
@ -155,8 +161,10 @@ var docs = [
{path:"module/Gun-methods.html#gun_default.set_animation", type:"function", title:"gun_default:set_animation", text:"sets the gun's animation in the same format as ObjRef:set_animation() (future deprecation?)"}, {path:"module/Gun-methods.html#gun_default.set_animation", type:"function", title:"gun_default:set_animation", text:"sets the gun's animation in the same format as ObjRef:set_animation() (future deprecation?)"},
{path:"module/Gun-methods.html#gun_default.clear_animation", type:"function", title:"gun_default:clear_animation", text:"clears the animation to the rest state"}, {path:"module/Gun-methods.html#gun_default.clear_animation", type:"function", title:"gun_default:clear_animation", text:"clears the animation to the rest state"},
{path:"module/Gun-methods.html#gun_default.play_sounds", type:"function", title:"gun_default:play_sounds", text:"plays a list of sounds for the gun's user and thirdpersons"}, {path:"module/Gun-methods.html#gun_default.play_sounds", type:"function", title:"gun_default:play_sounds", text:"plays a list of sounds for the gun's user and thirdpersons"},
{path:"module/Gun-methods.html#gun_default.prepare_deletion", type:"function", title:"gun_default:prepare_deletion", text:"ready the gun to be deleted"},
{path:"class/player_model_handler.html#player_model.construct", type:"function", title:"player_model.construct", text:""}, {path:"class/player_model_handler.html#player_model.construct", type:"function", title:"player_model.construct", text:""},
{path:"module/misc_helpers.html#math", type:"section", title:"math helpers", text:"in guns4d.math"}, {path:"module/misc_helpers.html#math", type:"section", title:"math helpers", text:"in guns4d.math"},
{path:"module/misc_helpers.html#table", type:"section", title:"table helpers", text:"in guns4d.table"}, {path:"module/misc_helpers.html#table", type:"section", title:"table helpers", text:"in guns4d.table"},
{path:"module/misc_helpers.html#other", type:"section", title:"other helpers", text:""}, {path:"module/misc_helpers.html#other", type:"section", title:"other helpers", text:""},
{path:"manual/changelog.html#changelog_130", type:"section", title:"changelog 1.3.0", text:"Established Versioning system moved the following fields inventory_image_magless -> inventory.inventory_image_magless inventory_image_magless -> inventory.inventory_image_magless firemode_inventory_overlays - > inventory.firemode_inventory_overlays ammo_handler -> subclasses.ammo_handler sprite_scope -> subclasses.sprite_scope crosshair -> subclasses.crosshair create the following classes Part_handler completed (expansion later) facilitates attachments Physics_system inactive future implementation for automatic translation Reflector_sight work in progress simulates a reflector sight with an entity added the following changes to the gun class made consts and properties proxy tables for protection of data (and reworked the LEEF class lib for this) created a system for property modification added subclasses property to replace hardcoded subclasses with modular system added subclass_instances field (see above). These will be automatically updated if their index is in the subclasses list. added visuals.attached_objects property to define attached entities added attached_objects field made get_pos capable of accounting for animation translations"},
]; ];

118
docs/manual/changelog.html Normal file
View File

@ -0,0 +1,118 @@
<!DOCTYPE html>
<html lang="en">
<!-- Documentation generated by LuaDox: https://github.com/jtackaberry/luadox -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>changelog 1.3.0 - Guns4d</title>
<link href="../prism.css?7653a2d" rel="stylesheet" />
<link rel="stylesheet" href="../luadox.css?7653a2d" type="text/css">
</head>
<body class="manual-changelog">
<div class="topbar">
<div class="group one">
<div class="description"><span>Guns4d | The ultimate 3d gun mod.</span></div>
</div>
<div class="group two">
</div>
<div class="group three">
<div class="button iconright"><a href="../class/gun.html" title="gun"><span>Next</span><img src="../img/i-right.svg?7653a2d" alt=""/></a></div>
</div>
</div>
<div class="sidebar">
<form action="../search.html">
<input class="search" name="q" type="search" placeholder="Search" />
</form>
<div class="sections">
<div class="heading">Contents</div>
<ul>
<li><a href="#changelog_130">changelog 1.3.0</a></li>
</ul>
</div>
<div class="manual">
<div class="heading">Manual</div>
<ul>
<li class="selected"><a href="../manual/changelog.html">changelog 1.3.0</a></li>
</ul>
</div>
<div class="classes">
<div class="heading">Classes</div>
<ul>
<li><a href="../class/gun.html">Gun.gun</a></li>
<li><a href="../class/player_model_handler.html">Player_model_handler.player_model_handler</a></li>
</ul>
</div>
<div class="modules">
<div class="heading">Modules</div>
<ul>
<li><a href="../module/misc_helpers.html">misc_helpers</a></li>
<li><a href="../module/play_sound.html">play_sound</a></li>
<li><a href="../module/Bullet_hole.html">Bullet_hole</a></li>
<li><a href="../module/Control_handler.html">Control_handler</a></li>
<li><a href="../module/Gun-methods.html">Gun-methods</a></li>
</ul>
</div>
</div>
<div class="body">
<div class="manual">
<h1 id="changelog_130">changelog 1.3.0
<a class="permalink" href="#changelog_130" title="Permalink to this definition"></a>
</h1>
<ul>
<li>
<h4>Established Versioning system</h4>
</li>
<li>
<h4>moved the following fields</h4>
<ul>
<li><code>inventory_image_magless</code> -&gt; <code>inventory.inventory_image_magless</code></li>
<li><code>inventory_image_magless</code> -&gt; <code>inventory.inventory_image_magless</code></li>
<li><code>firemode_inventory_overlays</code> - &gt; <code>inventory.firemode_inventory_overlays</code></li>
<li><code>ammo_handler</code> -&gt; <code>subclasses.ammo_handler</code></li>
<li><code>sprite_scope</code> -&gt; <code>subclasses.sprite_scope</code></li>
<li><code>crosshair</code> -&gt; <code>subclasses.crosshair</code></li>
</ul>
</li>
<li>
<h4>create the following classes</h4>
<ul>
<li><code>Part_handler</code>
<ul>
<li>completed (expansion later)</li>
<li>facilitates attachments</li>
</ul>
</li>
<li><code>Physics_system</code>
<ul>
<li>inactive</li>
<li>future implementation for automatic translation</li>
</ul>
</li>
<li><code>Reflector_sight</code>
<ul>
<li>work in progress</li>
<li>simulates a reflector sight with an entity</li>
</ul>
</li>
</ul>
</li>
<li>
<h4>added the following changes to the gun class</h4>
<ul>
<li>made <code>consts</code> and <code>properties</code> proxy tables for protection of data (and reworked the LEEF class lib for this)</li>
<li>created a system for property modification</li>
<li>added <code>subclasses</code> property to replace hardcoded subclasses with modular system</li>
<li>added <code>subclass_instances</code> field (see above). These will be automatically updated if their index is in the subclasses list.</li>
<li>added <code>visuals.attached_objects</code> property to define attached entities</li>
<li>added <code>attached_objects</code> field</li>
<li>made <code>get_pos</code> capable of accounting for animation translations</li>
</ul>
</li>
</ul>
</div>
</div>
<script src="../prism.js?7653a2d"></script>
</body>
</html>

View File

@ -30,6 +30,12 @@
<li><a href="#Bullet_hole">Module <code>Bullet_hole</code></a></li> <li><a href="#Bullet_hole">Module <code>Bullet_hole</code></a></li>
</ul> </ul>
</div> </div>
<div class="manual">
<div class="heading">Manual</div>
<ul>
<li><a href="../manual/changelog.html">changelog 1.3.0</a></li>
</ul>
</div>
<div class="classes"> <div class="classes">
<div class="heading">Classes</div> <div class="heading">Classes</div>
<ul> <ul>

View File

@ -30,6 +30,12 @@
<li><a href="#Control_handler">Module <code>Control_handler</code></a></li> <li><a href="#Control_handler">Module <code>Control_handler</code></a></li>
</ul> </ul>
</div> </div>
<div class="manual">
<div class="heading">Manual</div>
<ul>
<li><a href="../manual/changelog.html">changelog 1.3.0</a></li>
</ul>
</div>
<div class="classes"> <div class="classes">
<div class="heading">Classes</div> <div class="heading">Classes</div>
<ul> <ul>

View File

@ -30,6 +30,12 @@
<li><a href="#Gun-methods">Module <code>Gun-methods</code></a></li> <li><a href="#Gun-methods">Module <code>Gun-methods</code></a></li>
</ul> </ul>
</div> </div>
<div class="manual">
<div class="heading">Manual</div>
<ul>
<li><a href="../manual/changelog.html">changelog 1.3.0</a></li>
</ul>
</div>
<div class="classes"> <div class="classes">
<div class="heading">Classes</div> <div class="heading">Classes</div>
<ul> <ul>
@ -64,6 +70,11 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="name"><a href="#gun_default.update_visuals"><var>gun_default:update_visuals</var></a>()</td>
<td class="doc"><p>not typically called every step, updates the gun object's visuals</p>
</td>
</tr>
<tr>
<td class="name"><a href="#gun_default.update_transforms"><var>gun_default:update_transforms</var></a>()</td> <td class="name"><a href="#gun_default.update_transforms"><var>gun_default:update_transforms</var></a>()</td>
<td class="doc"><p>updates self.total_offsets which stores offsets for bones</p> <td class="doc"><p>updates self.total_offsets which stores offsets for bones</p>
</td> </td>
@ -153,6 +164,11 @@
<td class="doc"><p>plays a list of sounds for the gun's user and thirdpersons</p> <td class="doc"><p>plays a list of sounds for the gun's user and thirdpersons</p>
</td> </td>
</tr> </tr>
<tr>
<td class="name"><a href="#gun_default.prepare_deletion"><var>gun_default:prepare_deletion</var></a>()</td>
<td class="doc"><p>ready the gun to be deleted</p>
</td>
</tr>
</table> </table>
</div> </div>
<dl class="functions"> <dl class="functions">
@ -172,6 +188,14 @@
<td class="doc"></td> <td class="doc"></td>
</tr> </tr>
</table> </table>
</dd>
<dt id="gun_default.update_visuals">
<span class="icon"></span><var>gun_default:update_visuals</var>()
<a class="permalink" href="#gun_default.update_visuals" title="Permalink to this definition"></a>
</dt>
<dd>
<p>not typically called every step, updates the gun object's visuals</p>
</dd> </dd>
<dt id="gun_default.update_transforms"> <dt id="gun_default.update_transforms">
<span class="icon"></span><var>gun_default:update_transforms</var>() <span class="icon"></span><var>gun_default:update_transforms</var>()
@ -242,7 +266,8 @@
<a class="permalink" href="#gun_default.get_pos" title="Permalink to this definition"></a> <a class="permalink" href="#gun_default.get_pos" title="Permalink to this definition"></a>
</dt> </dt>
<dd> <dd>
<p>get the global position of the gun. This is customized to rely on the assumption that there are 3-4 main rotations and 2-3 translations. If the behavior of the bones are changed this method may not work</p> <p>get the global position of the gun. This is customized to rely on the assumption that there are 3-4 main rotations and 2-3 translations. If the behavior of the bones are changed this method may not work.
the point of this is to allow the user to find the gun's object origin as well as calculate where a given point should be offset given the parameters.</p>
<div class="heading">Parameters</div> <div class="heading">Parameters</div>
<table class="parameters"> <table class="parameters">
@ -265,8 +290,9 @@
</tr> </tr>
<tr> <tr>
<td class="name"><var>with_animation</var></td> <td class="name"><var>with_animation</var></td>
<td class="types">()</td> <td class="types">(<em>bool</em>)</td>
<td class="doc"></td> <td class="doc"><p>wether rotational and translational offsets from the animation are applied</p>
</td>
</tr> </tr>
</table> </table>
<div class="heading">Return Values</div> <div class="heading">Return Values</div>
@ -423,6 +449,14 @@
</td> </td>
</tr> </tr>
</table> </table>
</dd>
<dt id="gun_default.prepare_deletion">
<span class="icon"></span><var>gun_default:prepare_deletion</var>()
<a class="permalink" href="#gun_default.prepare_deletion" title="Permalink to this definition"></a>
</dt>
<dd>
<p>ready the gun to be deleted</p>
</dd> </dd>
</dl> </dl>
</div> </div>

70
docs/module/Gun.html Normal file
View File

@ -0,0 +1,70 @@
<!DOCTYPE html>
<html lang="en">
<!-- Documentation generated by LuaDox: https://github.com/jtackaberry/luadox -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Gun - Guns4d</title>
<link href="../prism.css?7653a2d" rel="stylesheet" />
<link rel="stylesheet" href="../luadox.css?7653a2d" type="text/css">
</head>
<body class="module-gun">
<div class="topbar">
<div class="group one">
<div class="description"><span>Guns4d | The ultimate 3d gun mod.</span></div>
</div>
<div class="group two">
</div>
<div class="group three">
<div class="button iconleft"><a href="../module/Gun-methods.html" title="Gun-methods"><img src="../img/i-left.svg?7653a2d" alt=""/><span>Previous</span></a></div>
</div>
</div>
<div class="sidebar">
<form action="../search.html">
<input class="search" name="q" type="search" placeholder="Search" />
</form>
<div class="sections">
<div class="heading">Contents</div>
<ul>
<li><a href="#Gun">Module <code>Gun</code></a></li>
</ul>
</div>
<div class="manual">
<div class="heading">Manual</div>
<ul>
<li><a href="../manual/changelog.html">changelog 1.3.0</a></li>
</ul>
</div>
<div class="classes">
<div class="heading">Classes</div>
<ul>
<li><a href="../class/gun.html">Gun.gun</a></li>
<li><a href="../class/player_model_handler.html">Player_model_handler.player_model_handler</a></li>
</ul>
</div>
<div class="modules">
<div class="heading">Modules</div>
<ul>
<li><a href="../module/misc_helpers.html">misc_helpers</a></li>
<li><a href="../module/play_sound.html">play_sound</a></li>
<li><a href="../module/Bullet_hole.html">Bullet_hole</a></li>
<li><a href="../module/Control_handler.html">Control_handler</a></li>
<li><a href="../module/Gun-methods.html">Gun-methods</a></li>
<li class="selected"><a href="../module/Gun.html">Gun</a></li>
</ul>
</div>
</div>
<div class="body">
<div class="section">
<h2 class="module" id="Gun">Module <code>Gun</code>
<a class="permalink" href="#Gun" title="Permalink to this definition"></a>
</h2>
<div class="inner">
<p>Gun</p>
</div>
</div>
</div>
<script src="../prism.js?7653a2d"></script>
</body>
</html>

View File

@ -36,6 +36,12 @@
</a></li> </a></li>
</ul> </ul>
</div> </div>
<div class="manual">
<div class="heading">Manual</div>
<ul>
<li><a href="../manual/changelog.html">changelog 1.3.0</a></li>
</ul>
</div>
<div class="classes"> <div class="classes">
<div class="heading">Classes</div> <div class="heading">Classes</div>
<ul> <ul>

View File

@ -32,6 +32,12 @@
</a></li> </a></li>
</ul> </ul>
</div> </div>
<div class="manual">
<div class="heading">Manual</div>
<ul>
<li><a href="../manual/changelog.html">changelog 1.3.0</a></li>
</ul>
</div>
<div class="classes"> <div class="classes">
<div class="heading">Classes</div> <div class="heading">Classes</div>
<ul> <ul>

View File

@ -16,13 +16,19 @@
<div class="group two"> <div class="group two">
</div> </div>
<div class="group three"> <div class="group three">
<div class="button iconright"><a href="class/player_model_handler.html" title="player_model_handler"><span>Next</span><img src="img/i-right.svg?7653a2d" alt=""/></a></div> <div class="button iconright"><a href="class/gun.html" title="gun"><span>Next</span><img src="img/i-right.svg?7653a2d" alt=""/></a></div>
</div> </div>
</div> </div>
<div class="sidebar"> <div class="sidebar">
<form action="search.html"> <form action="search.html">
<input class="search" name="q" type="search" placeholder="Search" /> <input class="search" name="q" type="search" placeholder="Search" />
</form> </form>
<div class="manual">
<div class="heading">Manual</div>
<ul>
<li><a href="manual/changelog.html">changelog 1.3.0</a></li>
</ul>
</div>
<div class="classes"> <div class="classes">
<div class="heading">Classes</div> <div class="heading">Classes</div>
<ul> <ul>

Binary file not shown.

View File

@ -20,9 +20,5 @@ outdir = ../../docs
follow = true follow = true
[manual] [manual]
# Custom manual pages in the form: id = filename.
# changelog = ../../changelog.md
# The ids must not conflict with any class or module name otherwise references
# will not properly resolve.
# index = intro.md
# tutorial = tut.md

Binary file not shown.