
Is there any way the player isnt seen when the the entity is under it? so the player would be under the entity instead.
Nork84 wrote:picture.priority = "extra-high" mayby?
Code: Select all
{
type= "container",
name= "rocket-1",
flags= {"placeable-neutral", "player-creation"},
collision_box= {{-1.9, 2.4}, {1.9, 5.4}},
selection_box= {{-2, -5.5}, {2, 5.5}},
minable= { hardness= 999, mining_time= 9999, result= "rocket-1" },
max_health= 50,
drawing_position= {0.7, 0.12},
icon="__F-mod__/resources/icons/rocket.png",
inventory_size=104,
picture=
{
filename= "__F-mod__/resources/entity/rocket/one.png",
width = 160,
height = 340,
priority = "extra-high",
}
},
Code: Select all
pictures =
{
{
filename = "__base__/graphics/entity/big-tree/big-tree-01.png",
priority = "extra-high",
width = 155,
height = 118,
shift = {1.1, -1}
},
Code: Select all
collision_box= {{-1.9, 2.4}, {1.9, 5.4}},
Code: Select all
collision_box= {{-1.9, 6.8}, {1.9, 1.0}},
If the bottom part is shoter than the character, it won't work out wellSilverWarior wrote:Factoprio is ment to be use topdown view so having something similar as in isometric view isn't easily done.
I would suggest that you split the entity picture into two parts:
- bottom part is show ans every other entity and is by default rendered behind the player. Colision box has same dimension as botom part
- top part has different Z order so it is always shown on top of other bottom parts or player character.
If that uses the same topleft-bottomright logic as findentities then top is lower then bottom?kovarex wrote:Yes, shift is used everywhere (it is more general, and self-contained, mainly for entities with more sprites/animations).
Your collision box definition is:This means, the center is in the upper part of the object, it is not good.Code: Select all
collision_box= {{-1.9, 2.4}, {1.9, 5.4}},
You should make the collision box more like this:So the center of the object is on the place where the object touches the ground.Code: Select all
collision_box= {{-1.9, 6.8}, {1.9, 1.0}},
Code: Select all
collision_box= {{-1.9, -1.5}, {1.9, 1.5}},
This is the tree:ficolas wrote:I cant figure out how to do it...
If I move the colision box down, then the colision box will be out, and if I shift it down, then it will be the same...
Code: Select all
collision_box = {{-0.4, -0.4}, {0.4, 0.4}}, -- small around the actual position of the entity
...
pictures:
{
...
{
filename = "__base__/graphics/entity/tree/tree-a01.png",
priority = "extra-high",
width = 84,
height = 64,
shift = {0.5, -0.8} -- Picture shifted up (left shift is because of the shadow)
},