Page 1 of 1

No such node (direction_count)

Posted: Wed Feb 22, 2017 10:43 pm
by Odynius
Hey guys,

I'm currently working on my first mod, which is a little challenging, since the guides are all pretty old and don't really work with the current version. Nevertheless I think i got pretty far for my first try creating a car entity, which shall become an aircraft some day.
After solving a lot of problems, i can't solve this one: "no such node (direction_count). I don't really get it, because there IS a node with direction_count.

Code: Select all

  animation = 
	{
		layers =
		{
		width = 300,
		height = 200,
		frame_count = 1,
		direction_count = 32,
		animation_speed = 8,
		max_advance = 0.2,
		stripes =
			{
			filename = "__BattleCruiserMod_0.1.1__/graphics/Battlecruiser1.png",
			width_in_frames = 4,
			height_in_frames = 8
			}
		},
Is there a problem you can see?

Thx!

Re: No such node (direction_count)

Posted: Wed Feb 22, 2017 10:56 pm
by Arch666Angel
You are using the "stripes" definition so the sheets you input have to be stripes:
At the moment your sprite sheet is 4 by 8 frames, what the game wants is 1 by 32 frames. If you extend the width, the additional frames are the animation that is run for each direction.

Re: No such node (direction_count)

Posted: Wed Feb 22, 2017 10:59 pm
by Odynius
Thanks for your answer!

So should i simply cut the sprite into 4 stripes and put them underneath?

EDIT: Why does the Hauler Mod work when it's 8x8 then?

Re: No such node (direction_count)

Posted: Wed Feb 22, 2017 11:04 pm
by Arch666Angel
Odynius wrote:Thanks for your answer!

So should i simply cut the sprite into 4 stripes and put them underneath?

EDIT: Why does the Hauler Mod work when it's 8x8 then?
Yes.

Probably defining it differently, maybe "directions". You would have to take a look into the mod and see.

Re: No such node (direction_count)

Posted: Wed Feb 22, 2017 11:47 pm
by Odynius
I made a 1 by 32 stripe now, but still the same error occurs. I also checked the mods skript and it was totally identical to mine in that way ...

Re: No such node (direction_count)

Posted: Thu Feb 23, 2017 2:38 am
by Arch666Angel
Odynius wrote:I made a 1 by 32 stripe now, but still the same error occurs. I also checked the mods skript and it was totally identical to mine in that way ...
Maximum Size per Sheet is 2048x2048 px at the moment, they are going to change that with 0.15 but for now that's the hard limit for sprite sheets.

Re: No such node (direction_count)

Posted: Thu Feb 23, 2017 9:33 am
by Odynius
Okay, i'm gonna fix that too then.

EDIT: I now have two stripes with 120x1440, but it didn't help with the direction_count error...

Re: No such node (direction_count)

Posted: Thu Feb 23, 2017 10:08 am
by darkfrei
Odynius wrote:Okay, i'm gonna fix that too then.

EDIT: I now have two stripes with 120x1440, but it didn't help with the direction_count error...
Which prototype type are you used?

Re: No such node (direction_count)

Posted: Thu Feb 23, 2017 10:56 am
by Odynius
I used the "car" entity, if thats what you mean

Re: No such node (direction_count)

Posted: Thu Feb 23, 2017 3:46 pm
by Arch666Angel
I'll post you an example layer from one of my mods:
Each frame is 256x256 px (width, hight), there are 2 animation frames per direction (frame_count), it has frames/animations for 64 directions (direction_count), each strip contains 8 directions (with 2 animation frames each (width_in_frames, hight_in_frames), so each strip is 2048 px high and 512 px wide.
Frame and direction count have to be the same for every layer you add

Code: Select all

        {
          width = 256,
          height = 256,
          frame_count = 2,
          direction_count = 64,
          shift = {0, 0},
          animation_speed = 8,
          max_advance = 1,
          stripes = 
          {
            {
             filename = "__angelsexploration__/graphics/entity/crawler/base-1.png",
             width_in_frames = 2,
             height_in_frames = 8,
            },
            {
             filename = "__angelsexploration__/graphics/entity/crawler/base-2.png",
             width_in_frames = 2,
             height_in_frames = 8,
            },
            {
             filename = "__angelsexploration__/graphics/entity/crawler/base-3.png",
             width_in_frames = 2,
             height_in_frames = 8,
            },
            {
             filename = "__angelsexploration__/graphics/entity/crawler/base-4.png",
             width_in_frames = 2,
             height_in_frames = 8,
            },
            {
             filename = "__angelsexploration__/graphics/entity/crawler/base-5.png",
             width_in_frames = 2,
             height_in_frames = 8,
            },
            {
             filename = "__angelsexploration__/graphics/entity/crawler/base-6.png",
             width_in_frames = 2,
             height_in_frames = 8,
            },
            {
             filename = "__angelsexploration__/graphics/entity/crawler/base-7.png",
             width_in_frames = 2,
             height_in_frames = 8,
            },
            {
             filename = "__angelsexploration__/graphics/entity/crawler/base-8.png",
             width_in_frames = 2,
             height_in_frames = 8,
            }
          }
        },...

Re: No such node (direction_count)

Posted: Thu Feb 23, 2017 4:11 pm
by Odynius
Okay, I went thorugh it and this is where I'm at now:

Code: Select all

layers =
		{
		width = 120,
		height = 90,
		frame_count = 1,
		direction_count = 32,
		animation_speed = 16,
		max_advance = 0.2,
		stripes =
			{
			filename = "__BattleCruiserMod_0.1.1__/graphics/bc1.png",
			width_in_frames = 1,
			height_in_frames = 16
			},
			{
			filename = "__BattleCruiserMod_0.1.1__/graphics/bc2.png",
			width_in_frames = 1,
			height_in_frames = 16
			},
		}
This is one of my two stripes:

https://uploadpie.com/CYI4uP

I divided the stripe into 16 times 120x90. There is obviously only one frame (which should be fine, right?) per direction and i have a direction_count = 32, which the games says doesn't exist ...

I really don't see the problem ...

Re: No such node (direction_count)

Posted: Thu Feb 23, 2017 4:28 pm
by prg
layers needs to be a table of tables. You're just missing some {}.

Re: No such node (direction_count)

Posted: Thu Feb 23, 2017 4:35 pm
by Odynius
prg wrote:layers needs to be a table of tables. You're just missing some {}.
Thanks, fixed it...

EDIT: Guys, I did it! After a few more problems I got it running! I couldn't have done it without you, so thank you very much. My first mod, i can't believe it. :D