Species, weapons, maps, prices, rules and licences at run time; script AIs.
# content.species (id? ) → table|nil
Parameter Type
id optional Species one species (default: all)
Returns
table|nil info, or a list of them: {id, type, name, ai, file, mod, builtin, scripted, hunt, hidden, price, unlocked, health, mass, size, radius, score, smell, hearing, sight, scaleMin, scaleRange, huntable, predator, flying, maps, spawnWeight}
copy for _, s in ipairs(content .species()) do if s.hunt then print (s.id, s.price) end end
# content.currentMap () → string|nil
The map of the hunt being played.
# content.weaponInSlot (slot ) → string|nil
The weapon the hunter has in a slot this hunt.
Parameter Type
slotinteger
# content.rules () → table
The economy and hunt rules.
Returns
table {scoreMultiplier, unlicensedScore, comboBonus, flyerCredits, speciesPriceScale, weaponPriceScale, mapPriceScale, ammoScale, maxSpecies}
# content.define (kind , fields ) → string|nil
Adds or changes an entry at run time (new ones appear in the hunt menu).
Parameter Type
kindstring "species", "weapon", "map" or "rules"
fieldstable the fields of the content pack JSON
Returns
string|nil the entry's id, or nil and an error
copy content .define("species" , {id = "night_raptor" , copy = "velociraptor" , name = "Night Raptor" , health = 12 , price = 300 })
content .define("rules" , {priceScale = 0.5 })
# content.ammoPrice (weapon ) → integer
A weapon's ammunition price.
Parameter Type
weaponstring
# content.balance (key ) → number
One of the game's balance values.
Parameter Type
keystring a balance value of the game, e.g. "RESUPPLIES_COST"
# content.unlocked (kind , id ) → boolean
Whether the player owns the licence.
Parameter Type
kindstring
idstring
# content.unlock (kind , id , on? )
Gives (or takes) a licence.
Parameter Type
kindstring
idstring
on optional boolean default true
# content.drive (species , fn )
Replaces the AI of every creature of a species with your function, every frame. Move and animate the creature there (c:move, c.yaw, c.anim, c:animate(e.dt)).
Parameter Type
speciesSpecies
fnfunction|nil fn(e) with e.creature, e.dt; nil = the game's AI again
copy content .drive("gallimimus" , function (e)
local c = e.creature
c.yaw = c.yaw + 90 * e.dt -- they run in circles
c:move(600 * e.dt)
c:animate(e.dt)
end )
# content.reload ()
Reads every enabled mod's content packs again.
# content.report () → string
A report of the registry.
Returns
string one line per entry and the mods that set it
# content.aiNames () → table
The species whose AI a new species can use.