Summary

Hooks

Called to check whether a node can spawn at a point; blocks it within 50 units of a node of the same class.
Called after Catwork has loaded the map entities; loads the resource node spawn points.
Loads the resource node spawn points of the current map and makes each spawn as soon as possible.
Called every second; respawns resource nodes whose respawn delay has passed.
Gives a player wood for breaking a wooden prop.
Saves the resource node spawn points of the current map to the schema data.
Spawns a resource node at a spawn point and remembers it as the point's node.

Hooks

cwGather:CanSpawnNode(position, class)

server gamemodes/cwhl2rp/plugins/gathering/plugin/sv_hooks.lua:45

Implements hook CanSpawnNode

Called to check whether a node can spawn at a point; blocks it within 50 units of a node of the same class.

Parameters

  • position Vector The spawn point's position
  • class String The node's entity class

Returns

  • Boolean Whether the node can spawn

cwGather:ClockworkInitPostEntity()

server gamemodes/cwhl2rp/plugins/gathering/plugin/sv_hooks.lua:8

Implements hook ClockworkInitPostEntity

Called after Catwork has loaded the map entities; loads the resource node spawn points.

cwGather:LoadNodesSpawnPoints()

server gamemodes/cwhl2rp/plugins/gathering/plugin/sv_plugin.lua:24

Loads the resource node spawn points of the current map and makes each spawn as soon as possible.

The list is rebuilt without the gaps that removed points left in older data.

Implements hook OneSecond

Called every second; respawns resource nodes whose respawn delay has passed.

The nodes_respawn_delay config runs from the moment a point's node is found gone. The point then spawns a new node when CanSpawnNode allows it, and is looked at again five seconds later when it does not or the node cannot be created.

cwGather:PlayerBreaksWood(player, ent)

server gamemodes/cwhl2rp/plugins/gathering/plugin/sv_plugin.lua:84

Gives a player wood for breaking a wooden prop.

Rolls once per 25 units of the prop's mass (1 to 5 rolls), each roll raised by the player's Scavenger attribute, and drops a wooden_board or wooden_parts item at the prop for good rolls. Progresses Scavenger by 5 to 25 depending on the mass.

Parameters

  • player Player The player who broke the prop
  • ent Entity The broken prop

hook.Add id: cwGather_wood

No documentation available.

cwGather:SaveNodesSpawnPoints()

server gamemodes/cwhl2rp/plugins/gathering/plugin/sv_plugin.lua:17

Saves the resource node spawn points of the current map to the schema data.

Writes plugins/gather/<map>.

cwGather:SpawnNode(pointTable)

server gamemodes/cwhl2rp/plugins/gathering/plugin/sv_plugin.lua:41

Spawns a resource node at a spawn point and remembers it as the point's node.

Wood points (data is 'wood') get a random model from cwGather.woodNodes. The node is raised so its bottom rests on the point.

Parameters

  • pointTable Map The spawn point, with class, data, position and angles

Returns

  • Entity The node, or nil when it could not be created

Defined in