I used my own code to spawn enemies. I know I can't use things like a trigger or hotspot in multiple instances - basically I can't attach a trigger to a clone, right? If I have an enemy spawn, is it possible to use adventure creator to give that enemy behavior that is sent from attached an actionScript? Attach the actionScript to the clone somehow... Ultimately, I would like the enemy to die and drop coins or something.
Something like, after the enemy spawns, it attacks you if you're in it's range, but does nothing if you don't come too close. I could achieve this part with code, but because AC handles keeping a record of inventory items, if in the end, my goal is to drop a coin, how can I make AC register the collectible that came from a (clone) spawned during Update()?
Comments
To add the coin to your inventory, create an ActionList asset with an Inventory: Add or remove Action. You can run this asset through script by running the following line (assuming "myActionListAsset" is a reference to the asset file):
AC.AdvGame.RunActionListAsset (myActionListAsset);
Have a look at section 12.7 of the manual - that's got a list of common script functions that AC has available.