Team Spartan Cookies & Milk Forums
Advanced Duplicator Priority - 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: Advanced Duplicator Priority (/thread-2918.html)



Advanced Duplicator Priority - exoRift - 18-12-2018

If possible, I think all wire chips that contain code should be spawned last. For example, if you have a chip wired to the elevator pod of a lift system, the inputs may fail since the pod spawns as a result of the shaft being spawned. (Meaning it's delayed). Although it's not standard since Auto Parenting should be used, this also can be a problem when you use `constraint.findEntity`.

EDIT: This is also a problem when you have an entity as an input and immediately try to run a method on it in your code (such as Vehicle:driver()) because the port is null until the prop spawns.


RE: Advanced Duplicator Priority - mariofludd - 18-12-2018

this is why you use the duped function (i forget what the function is called)


RE: Advanced Duplicator Priority - exoRift - 18-12-2018

You mean like if duped then wait? I don't know. It'd kinda be annoying to implement into every chip when you can do something more consistent which is my suggestion.


RE: Advanced Duplicator Priority - mariofludd - 19-12-2018

(18-12-2018, 10:27 PM)mets11rap Wrote: You mean like if duped then wait? I don't know. It'd kinda be annoying to implement into every chip when you can do something more consistent which is my suggestion.

yes annoying to add like 1 or 2 lines to the beginning to every e2


RE: Advanced Duplicator Priority - Person8880 - 19-12-2018

Having chips load after other entities would make it even worse, as wires would no longer be restored. Remember that chips are defining their inputs/outputs in code, so they have to execute first in order to have their I/O ready for the duplicator to restore wiring to.

For Starfall, you should use the input hook to detect when inputs are available. This is fired not only when an input is wired with the tool, but also after the duplication process restores the appropriate wiring and after a chip's code is updated.

For E2, there's the triggering system and the ~ operator to detect when something is wired.