Forum rules - please read before posting.
Tech questions during the weekend? Drop in on the community Discord channel!

How to add new objects to AC's own obj reference list

Hi, first of all this isn't really a pressing matter or anything. I was just wondering something... Basically, as far as I've understood, AC creates it's own game object reference list when a scene is loaded (to speed up referencing). And I have a few scripts and custom actions that instantiate objects, so, for completeness sake, I was wondering, what is the right way to add this new objects to said list so AC is always aware of them? Or is this really not much of a problem at all? Are there situations where not adding the items to the list could lead to issues?

Anyway, as usual any advice would be greatly appreciated, though, this is more of an "I'm curious" situations that a real issue.

Comments

  • Sure, just call:

    AC.KickStarter.stateHandler.GatherObjects ();

    (It's also listed on the front page of the scripting guide)

    This is only necessary, of course, if you need AC to be aware of any new objects - e.g. NPCs to update or objects to save the presence of.
  • Oh, alright. I know about that one, I just wanted to make sure there wasn't a way to add just a single item (cause it does sound like it redoes all of them, no? Or is not that how it works?).
  • That is how it works, but unless you're running it every frame it shouldn't matter.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.
Do NOT follow this link or you will be banned from the site!