Page 1 of 1

[5.4] Setting draw order for a character

Posted: Fri Jan 26, 2018 10:19 pm
by craftycry
I am trying to draw a character last, or in other words in front of everything else. I understand that you can achieve this with entities by setting the flag 'ENTITY_SLOT_RENDER_NEAREST', however since I am using an AdvancedAnimationComponent this doesn't seem possible. I have tried to do the following instead, but it just makes the character invisible:

Code: Select all

uint32 flags = m_pAnimationComponent->GetCharacter()->GetFlags();
m_pAnimationComponent->GetCharacter()->SetFlags(flags | CS_FLAG_DRAW_NEAR);
Edit: Since setting the character flag seems to be a lost cause, does anyone know of any alternative methods for achieving what I want?

Re: [5.4] Setting draw order for a character

Posted: Thu Feb 01, 2018 9:24 pm
by Personwithhat2
Quick search gave me this:

Code: Select all

uint32 entitySlotFlags = pPlayerEntity->GetSlotFlags(SLOT NUMBER); entitySlotFlags |= ENTITY_SLOT_RENDER_NEAREST; pPlayerEntity->SetSlotFlags(SLOT NUMBER, entitySlotFlags);
Should work properly. You can also add shadows that way, ENTITY_SLOT_CAST_SHADOW.

Re: [5.4] Setting draw order for a character

Posted: Thu Feb 01, 2018 10:01 pm
by craftycry
Been chatting with Hat in Discord, but for the record:

Any entity render flags set on the entity for which the anim component was created on don't affect the character's rendering. This makes sense since the character has its own, separate render flags. The problem is that it's just making the char invisible.