theRAPTLab / gsgo

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

Change wizard references from `agent` to `character` #762

Closed benloh closed 1 year ago

benloh commented 1 year ago

References to agent in ScriptEditor / line editor should now properly refer to agent instead of character.

For example:

screenshot_1294

Addresses #756

benloh commented 1 year ago

@jdanish Please let me know if you see any other references to agent. The wizard should allow you to select the right value now. You may need to change older scripts manually.

jdanish commented 1 year ago

One error so far. I replaced agent. with character. in the attached script and it generated this error

Screenshot 2023-08-19 at 7 57 53 AM Screenshot 2023-08-19 at 7 58 03 AM

wetlands_beavers_story.gemprj.zip

jdanish commented 1 year ago

I just committed that version of the beavers_story to art-assets under the branch "convert_agent_to_character" (736c93ec36f65b6912b4b40dbd67493b5c84518e) so you can test it

benloh commented 1 year ago

@jdanish One more try. Changing agent to character is a pretty deep change, so there might be more of these errors. The proper way might be to change ALL references from agent to character, but that level of change could easily eat up a week. We're trying a cheaper approach where we're doing the mapping primarily on the wizard side.

jdanish commented 1 year ago

Closer! Now the issue is in the expression evaluation. The same script loads, but when I press start we get this error.

Screenshot 2023-08-20 at 7 54 06 AM
benloh commented 1 year ago

Hmm...I did try running the script but I'm not seeing any errors. Did you change the script by any chance? I'm not seeing any errors with any of the Beavers projects.

jdanish commented 1 year ago

I’ll take a look but did you use character controller to add players to the model?

benloh commented 1 year ago

Ah, I didn't realize you were using Character Controllers.

jdanish commented 1 year ago

Always to test interactions locally.----(from my iPhone)Joshua Danishhttp://www.joshuadanish.comOn Aug 20, 2023, at 12:55 PM, benloh @.***> wrote: Ah, I didn't realize you were using Character Controllers.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

benloh commented 1 year ago

@jdanish Off-topic: If we could ask you to add a after your iphone replies, github will do a better job of hiding and formatting the reply text -- note how the "Always to test interactions locally" reply there is a big quoted section -- I've been removing that text by hand to remove all the extra cruft.

screenshot_1303

jdanish commented 1 year ago

Yes happy to but whatever you are asking me to add appears to not be showing up. Carriage return?

benloh commented 1 year ago

Yes happy to but whatever you are asking me to add appears to not be showing up. Carriage return?

LOL, sorry I used <return> in the text, and it showed up blank. Yes extra carriage return. Sorry to waste your time on this, but the time was starting to add up.

benloh commented 1 year ago

One error so far. I replaced agent. with character. in the attached script and it generated this error

Screenshot 2023-08-19 at 7 57 53 AM Screenshot 2023-08-19 at 7 58 03 AM wetlands_beavers_story.gemprj.zip

@jdanish I can't seem to reproduce this error. Just checking a few things:

  1. We're on dev-bl/agent2character branch
  2. You've quit the app and restarted npm run gem (better yet, close the terminal in case there was an errant process running).
  3. When are you seeing the error? On "Prep Round' or "Start Round"?
  4. Which CharacterController are you using?
  5. Which window are you seeing the error?
  6. Which blueprint are you seeing the error on?
jdanish commented 1 year ago

It's in the wetlands_beaver_story script (see attached above), if you run two "players" using character controller and then have them touch which triggers this code:

`when Player firsttouches Player [[ // weird bug that means we need to make sure we are not bumping into ourself ifExpr {{ character.getProp('trackerId').value != Player.getProp('trackerId').value }} [[

// ✏️ LETS CHANGE THIS: what do specific kinds of costumes do when they bump into specific other costumes
// ✏️ This example triggers when someone pretending to be a beaver bumps into a tree
// ✏️ You can change the two costumes to be something else and then set what happens
ifProp character.costumeType equal 'Beaver' [[
  ifProp Player.costumeType equal 'Tree' [[
    propPush character.trackerId
    featPropPop character.Graphing.text

    // ✏️ Make a popup
    featCall Player.Population createCharacter PopupEffect [[
      prop PopupEffect.textToUse setTo 'Ooh, yum yum!'
      prop PopupEffect.costumeToUse setTo ''
    ]]

    // ✏️ Add something to the label
    // featProp character.Graphing.text add ' (ate)'

    // ✏️ Do something with the meter
    // TBD

  ]]
]]

]] ]]`

I'd guess it is the call to character.getProp('trackerId').value that is doing it?

benloh commented 1 year ago

Ah thanks. Now I see it. Did this ever work? I'm surprised you can get away with two Player references. Did it used to work with agent in place of character?

I suspect this is going to require a pretty deep refactor.

jdanish commented 1 year ago

Yup, it all worked up until this most recent branch. I changed all of the characters that didn't work back to agents and this now works again. The current script is attached.

Given the need to refactor, I'm OK not fixing the cases where it is an ifExpr since those are only used by advanced users in special cases. However, in other cases such as featPropPush agent.Costume.width that seems like a scoping / nesting issue based on prior errors, and I am hoping is easier to fix?

wetlands_beavers_story.gemprj.zip

benloh commented 1 year ago

@jdanish I think I have the ifExpr issue resolved now. As far as I can tell the Player character does seem to run without errors.

You might check to make sure the code actually behaves like you expect it to. The fact that there are no errors should mostly be an indication that it works. Please pull and retry.

benloh commented 1 year ago

Sorry, missed one commit: 08f9fa2180e92d3e734bc960f3aa9d4702d56e29

jdanish commented 1 year ago

We see the following error still

Screenshot 2023-09-08 at 1 31 14 PM

I think it is in this code which is triggered by one player becoming a beaver, then one becoming a tree, then they touch.

`when Player firsttouches Player [[ // weird bug that means we need to make sure we are not bumping into ourself ifExpr {{ character.getProp('trackerId').value != Player.getProp('trackerId').value }} [[

// ✏️ LETS CHANGE THIS: what do specific kinds of costumes do when they bump into specific other costumes
// ✏️ This example triggers when someone pretending to be a beaver bumps into a tree
// ✏️ You can change the two costumes to be something else and then set what happens
ifProp character.costumeType equal 'Beaver' [[
  ifProp Player.costumeType equal 'Tree' [[
    propPush character.trackerId
    featPropPop character.Graphing.text

    // ✏️ Make a popup
    featCall Player.Population createCharacter PopupEffect [[
      prop PopupEffect.textToUse setTo 'Ooh, yum yum!'
      prop PopupEffect.costumeToUse setTo ''
    ]]

    // ✏️ Add something to the label
    // featProp character.Graphing.text add ' (ate)'

    // ✏️ Do something with the meter
    // TBD

  ]]
]]

]]`

jdanish commented 1 year ago

This is the script from the prior comment

wetlands_beavers_story.gemprj.zip

benloh commented 1 year ago

@jdanish All keywords that reference agent objects should now properly use character instead of agent. a374ca645e63a0216ec7cce1baa1993745a241a6

I believe the remaining unmarked checkboxes are not relevant to use of character.

jdanish commented 1 year ago

Looks like it is working!!

benloh commented 1 year ago

Added a stub of a wiki page to cover use of character : https://github.com/theRAPTLab/gsgo/wiki/Character

benloh commented 1 year ago

Also noting there is a test script for all keywords here: https://github.com/theRAPTLab/gsgo/wiki/Debugging