Closed benloh closed 8 months ago
If ScriptEditor is open and the user drags, the code should update? Or do we lock out the drag? Ideally update, but if it is a hassle that's fine since we almost always close first (I can't fit both on my window!!)
"Character Type Editor" vs "Character Instance Editor"? I think that works
Also, this reveals the issue that the code to generate the instance properties is not using the character type and that is a problem for the wizard. In other words, it says
prop x setTo 5
the editor expects
prop Beaver.x setTo 5
Is it possible to set the writing code to add the character name in so that the wizard won't complain? It's probably good form anyhow?
Also, since it is so crowded, I am OK removing the model name from the script editor since we currently can only run one model anyhow?
I tried adding a new line of script to change the alpha. When I hit save line, no problem. When I hit save script, no response. I closed the window and the change had taken. Then I tried opening and editing that line, and again no change. I checked the console and this error is there. The changes are saving, but it is choking on the button push.
I also noticed that when I changed alpha, it did not update the character on-screen until I had saved setup. That's fine, but if it is easy to do an update cycle on save, that'd be even better :)
@jdanish Thanks for testing. We are still far away from finishing. I had thought we were close but there are all these edge conditions that have to be chased down one by one.
That's why we are here! If you want us to pause or test specific areas let me know
since it is so crowded, I am OK removing the model name from the script editor since we currently can only run one model anyhow?
@jdanish Are you saying you want to remove the character name from panel title bar (e.g. "SCRIPT EDITOR beaver")? Or were you referring to the character name in the wizard/code view?
wetlands_beavers_energy is the model name, and I think we could cut it? The script / character we should keep
@jdanish I can't reproduce this error:
I tried adding a new line of script to change the alpha. When I hit save line, no problem. When I hit save script, no response. I closed the window and the change had taken. Then I tried opening and editing that line, and again no change. I checked the console and this error is there. The changes are saving, but it is choking on the button push.
Please try again after the most recent pushes, which should address some of the update errors.
@jdanish I can't reproduce this error:
I tried adding a new line of script to change the alpha. When I hit save line, no problem. When I hit save script, no response. I closed the window and the change had taken. Then I tried opening and editing that line, and again no change. I checked the console and this error is there. The changes are saving, but it is choking on the button push.
Please try again after the most recent pushes, which should address some of the update errors.
Confirmed this is no-longer an issue.
Can you either remove the "delete script" button from the instance editor, or change it to be "delete instance" and change the function accordingly? I think just removing it might make the most sense?
Can you either remove the "delete script" button from the instance editor, or change it to be "delete instance" and change the function accordingly? I think just removing it might make the most sense?
Removed. Also removed the "Select Script" button for init script.
Odd one, but ... in the current build, if you do the following:
Sorry, I thought I had fixed that, but obviously I didn't. Oh this is is a deeper problem. After you edit a character type script, the instances are reset. So that's why the lines are gone.
This should be fixed now. It was some ancient code that did not account for the fact that we now support using <bpname>.x
references.
@jdanish Ready for more careful review. Most things should be fixed now.
Looks goos to me. AOK to merge.
Addresses #754
Instance init scripts in the Map Editor were originally edited directly with a code editor. This adds the ability to edit instance init scripts in a Script Editor window, supporting both a wizard view and a code editor view.
To Test
Other things to test:
prop x setTo...
prop agent.x setTo..
andprop character.x setTo..
Technical Background
Editing init script is a bit tricky because the wizard needs to pre-compile the blueprint in order to know how to scaffold the wizard editor. The blueprint script needs to be compiled and bundled so that the wizard knows which props and features have been defined and are therefore available to be called in the initScript. We do this by adding initScripts to the blueprint bundle, and then re-purposing the ScriptEditor components to handle either regular blueprint scripts or just init scripts.
To Do
<bpname>.x
for updating drag init scripts.Or do we lock out the drag?We need to update otherwise the user will be left with an out of date ScriptEditor.