theRAPTLab / gsgo

GEM-STEP Foundation repo migrated from GitLab June 2023
1 stars 1 forks source link

`no feature named 'Physics'` during instance deletion #438

Closed benloh closed 1 year ago

benloh commented 2 years ago

To Reproduce

  1. Open keywordTest.gemprj from global-integration repo (aa701f102b5f39f770c3f116f84456fce392788a)
  2. Click SETUP
  3. Select an instance in the simulation graphic view by clicking on the sprite (not the character name in the "CHARACTERS" pane
  4. Click "Delete"
  5. A no feature named 'Physics' error will be reported image

NOTES

benloh commented 2 years ago

Upon further investigation, the errors were being generated by Touches trying to set the global agent.

image

But the global agent should have nothing to do with Touches in the current script.

--

The clue here is that TestKeywordAgent1 id and the global agent id were both '1'. This is because sim-agents was injecting the global agent instance right after existing instances were cleared, and BEFORE the instances are re-constructed from the stored instance defs. The result is that the global agent retrieved an id of '1', but the project instance spec also defines an agent with an id of 1. After the stored instance id is deleted, when we try to retrieve an agent by id, we end up retrieving the global agent.

The fix is to auto-assign the global id AFTER you've already instantiated the instanceDefs.

benloh commented 2 years ago

mentioned in commit f3b16b60f4e6858593c114738486a0da9b6b15f9

benloh commented 2 years ago

In GitLab by @jdanish on Sep 16, 2022, 03:23

mentioned in commit 760dd20be73b47a207f21f64a4d507ad17c3357b

benloh commented 2 years ago

mentioned in commit b8fd6b8369e9f3df4e6eca5792b68cff1df8204d

benloh commented 2 years ago

mentioned in commit 171a2822b3f5cfae85b4d8ed950a97cd6d80d91f