Team Spartan Cookies & Milk Forums
Starfall --@dupefinished - Printable Version

+- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk)
+-- Forum: Feedback (https://teamscm.co.uk/forum-9.html)
+--- Forum: Suggestions and improvements (https://teamscm.co.uk/forum-11.html)
+--- Thread: Starfall --@dupefinished (/thread-3596.html)



Starfall --@dupefinished - 57e11a - 20-01-2021

I suggest an addition of a directive starfall, related to waiting for the the duplication that this starfall chip is running on to finish pasting.

Something like

--@dupefinished
This would delay the execution of the starfall until the duplication that the chip is on has finished pasting.

I suggest this because when the SF runs (specifically when being duplicated), it may run before other entities/wirelinked entities are created, therefore when you check if the wirelink/entity is valid when the sf first runs, you could run into problems where it eventually is valid, just takes a moment to become valid.


RE: Starfall --@dupefinished - Person8880 - 20-01-2021

You should be using hooks to detect this. There's a "postentitypaste" hook that fires once all entities have been restored, and the "input" hook will be triggered when wiring is established.


RE: Starfall --@dupefinished - Veegi - 22-01-2021

Use those in conjunction with starfall.isSpawnedFromDuplicator to either wait for the postentitypaste hook to run if the chip actually has been placed from the duplicator and then to do your setup, or to do it instantly if it wasn't placed as part of a dupe.


RE: Starfall --@dupefinished - Red The Blue Color - 23-01-2021

Before I forget to also mention another hook, I don't know specifically what you are doing with it but PreEntityCopy is incredibly useful to save all used wirelinks and etc data.