1 (edited by Siile 2015-03-12 14:29:27)

Topic: Content.py & Enum generation problem *SOLVED*

Hi

I added new class to content.py

class AttackAnimation(Struct):
    def __init__(self, name="", damagestartframe=0, damageendframe=0):
        Struct.__init__(self, "CAttackAnimation")
        self.name = String(name)
        self.damagestartframe = Int(damagestartframe)
        self.damageendframe = Int(damageendframe)

...added it to DataContainer

self.attackanimations = Array(AttackAnimation())

and finally added new AttackAnimation

attackanim = AttackAnimation("spurdo")
attackanim.damagestartframe.Set(10)
attackanim.damageendframe.Set(15)
container.attackanimations.Add(attackanim)

Why corresponding enum list doesn't get generated (client_data.h & server_data.h)? What am I missing?

I mean enum list similar to this (client_data.h):

enum
{
    ANIM_BASE=0,
    ANIM_IDLE,
    ANIM_INAIR,
    ANIM_WALK,
    ANIM_KNIFE_STAB,
    ANIM_NINJA_SWING,
    NUM_ANIMS
};

2 (edited by BeaR 2015-03-12 14:09:52)

Re: Content.py & Enum generation problem *SOLVED*

The enums are only generated for the items in the `animation` container. The generation script is not aware of your custom container. https://github.com/teeworlds/teeworlds/ … ile.py#L80

3

Re: Content.py & Enum generation problem *SOLVED*

BeaR wrote:

The enums are only generated for the items in the `animation` container. The generation script is not aware of your custom container. https://github.com/teeworlds/teeworlds/ … ile.py#L80

Thanks!