Page MenuHomeFeedback Tracker

Please expose/add EOnPostInit
Assigned, NormalPublic

Description

Right now there is no way to know when an entity init is completed. A lot of native code like inventory, attachments, hierarchy setup and hit zones etc are all initialized only during EOnInit which makes it impossible to wait for those to complete if you do not have access to the outside caller scope. For a component attached to the entity you ned to do dirty workarounds to postpone to next frame, but sometimes that is too late for the action to be taken. So a new event that runs after the init has been completed for the entity and all attached components would be really really useful. By default, people should put the important init code onto the existing init event, but if they, for example, need to post-process the state of a different component on the same parent then they can go into post init and know that all other components should be ready to go.

enum EntityEvent
{
	POSTINIT,
}
class IEntity
{
	/*!
	Event after entity init has run
	\param owner The owner entity
	*/
	event protected void EOnPostInit(IEntity owner);
}
class ScriptComponent
{
	/*!
	Event after entity init has run on all components
	\param owner The owner entity
	*/
	event protected void EOnPostInit(IEntity owner);
}

Details

Severity
Crash
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
General

Event Timeline

Arkensor created this task.Oct 3 2022, 10:37 AM
Geez changed the task status from New to Assigned.Oct 16 2022, 11:08 PM