[1.7] Event for all activated Components (C++)

0

Hi,

Is there an event fired when all Components are activated (after OnActivate()) ? Which will be fired when all Components are created and ready to use ?

As I see GetProvidedServices and GetRequiredServices not work like that.

Or should I create my own system to get be known when all Components will be ready ?

Cheers

질문됨 7년 전150회 조회
6개 답변
0
수락된 답변

As you named GetRequiredServices I guess you intend to know in a Component if all other required components are just ready to use.

It sound strange that GetRequiredServices doesn't make them Initialize in the right order(maybe order is only preserved for system entity components and normal entity have a simpler implementation?Source code need to be checked).

However a trivial trick is to defer the final initialization appling for the tick bus finalize the initialization during the tick and then disable the tick again.

If you just use tick for your component this trick is far from elegant as you need to branch by a new variable or init a variable you just have to a value that signals you didn't initialized yet.

This also works in lua where you may even tick in a different table where you will then change again the target for the next tick.

답변함 7년 전
0

Hi @REDACTEDUSER

So I am thinking about a new Component Entities.

For the moment as a workaround I delayed all my signals from Logic components to other to give them time to initialize itself.

답변함 7년 전
0

May I ask why you need this info ? Is this per entity or per slice or per level ?

답변함 7년 전
0

Hi @REDACTEDUSER

If that will not work I will try to implement your trivial trict to signal from TickBus to one of my components which will chceck if all my required components are initialized and them execute my logic based on that components.

Ps. Multiplayer sample also have own implementation detecting if required components are initialized in general, not just In Init or Activate...

답변함 7년 전
0

Hi @REDACTEDUSER

답변함 7년 전
0

Hey @jasiuj, just checking in to see it you were able to get your problem solved with everyone's help? Let me know.

답변함 7년 전

이 게시물은 마감됨: 새 답변, 댓글 및 투표 추가가 비활성화되었습니다.

관련 콘텐츠