theRAPTLab / gsgo

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

Blueprint object references - [merged] #704

Closed benloh closed 1 year ago

benloh commented 2 years ago

Merges dev-bl/next-gui-sansagent -> dev-next-gui

To simplify references to objects, you can now always refer to the current blueprint by the blueprint name. It is no longer necessary to choose between "agent" and "BlueprintName" depending on context. (Prior to this, the blueprint name could only be used within a when block).

For example, this is now VALID EVERYWHERE:

prop Fish.energyLevel setTo 5
featProp Fish.Physics.scale setTo 1.5
featCall Fish.Costume setCostume 'fish.json' 0
when Fish touches Algae [[
  featCall Fish.Costume setGlow 0.5
]]

...and, this is still valid, but not necessary:

prop agent.energyLevel setTo 5
featProp agent.Physics.scale setTo 1.5
featCall agent.Costume setCostume 'fish.json' 0
when Fish touches Algae [[
  featCall Fish.Costume setGlow 0.5
]]

In addition, "agent" is now considered an advanced symbol in the GUI, so it appears faded:

screenshot_1068

benloh commented 2 years ago

requested review from @jdanish

benloh commented 2 years ago

added 2 commits

Compare with previous version

benloh commented 2 years ago

In GitLab by @jdanish on Jul 26, 2022, 04:37

Looks good!! Thanks!

benloh commented 2 years ago

mentioned in commit d32781f803a1505199461fdc5503d960012cc4a3