Jump to content

[0.26] initializationFinished doesn't trigger when script is being attached


Rinart73

Recommended Posts

Avorion: 0.26

 

"initializationFinished" doesn't trigger for an entity when script is being attached after entity creation.

 

How to reproduce:

 

data/scripts/entity/mymod.lua

-- namespace MyMod
MyMod = {}

function MyMod.initialize()
    print("MyMod.initialize happened")
end

function MyMod.initializationFinished()
    print("MyMod.initializationFinished happened")
end

 

Try to attach this script to entity that already exists in a loaded sector:

/run Entity():addScriptOnce("data/scripts/entity/mymod.lua")

You will get only one message:

MyMod.initialize happened

 

If you'll then reload a sector (leave and come back after some time or restart the galaxy), two lines will be printed:

MyMod.initialize happened
MyMod.initializationFinished happened

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...