Hunt Locations and Natural Resources: Difference between revisions

From PSwiki
Jump to navigation Jump to search
No edit summary
Line 16: Line 16:
3) Save the level again
3) Save the level again


4) Set the mesh name in [[natural_resourcesTable|natural_resources]].mesh. This name can be set just with the first part of the name, example "oak_", so that all trees with name "oak_*" will be picked up, like oak_01, oak_02, .....
4) Set the mesh name in [[natural_resourcesTable|natural_resources]].trace_mesh. This name can be set just with the first part of the name, example "oak_", so that all trees with name "oak_*" will be picked up, like oak_01, oak_02, .....
 
For flowers/plants, the engine is spawning a mesh on the location of the natural resources, line tracing down to the ground, remember to:
 
1) Remove the collision from the mesh in Unreal
 
2) set the mesh name in [[natural_resourcesTable|natural_resources]].spawn_mesh.


== Hunt Locations ==
== Hunt Locations ==

Revision as of 21:08, 1 April 2023

We have two different ways to configure locations where players can gather materials.

Natural Resources

Used when we need invisible items to be harvested, example a mine will be modeled in 3d, but the individual ore are not 3d objects in the world.

So we configure a location on the map, defined by a center (in x/y/z coordinates) and a radius, where the player will be able to harvest. We also define the tool to be used (example a rock pick), the difficulty, and the resulting item.


For wood harvesting, we created a different system, based on the mesh name you right click on. To have one type of tree being recognized for harvesting you need to do the following:

1) Set Collision = "Custom" and "Query Only". Set all channels to "Ignore" except "InteractMouseTrace" to Block.

2) In the mesh object (Example oak_03) set the "Collision Complexity" to "Use Simple as Complex", this is because when we LineTrace we use Complex.

3) Save the level again

4) Set the mesh name in natural_resources.trace_mesh. This name can be set just with the first part of the name, example "oak_", so that all trees with name "oak_*" will be picked up, like oak_01, oak_02, .....

For flowers/plants, the engine is spawning a mesh on the location of the natural resources, line tracing down to the ground, remember to:

1) Remove the collision from the mesh in Unreal

2) set the mesh name in natural_resources.spawn_mesh.

Hunt Locations

Used when we want a visual 3d object to be spawned as a pickupable item. When the player picks up the item, a new item is scheduled to be spawn later on based on configured interval.