Stencyl 3.4.0 is now out. Get it now!

Batch Processing

Justin

  • *
  • Posts: 3699
https://www.youtube.com/watch?v=gyih3H35pZI

New extension in development. Not planning on putting too much time into it right now, but I'm taking requests. Operations that people feel would be good to have for batch processing of scenes, actors, behaviors, whatever.

Right now the video just shows a behavior being added to all the scenes in a game.

For Live Support: Join our discord channel and ping me @justin.

Justin

  • *
  • Posts: 3699
Another idea is to expand a high-level API. With the right API in place, code to add a behavior to every scene is pretty simple, and other extension developers could easily put together their own custom processes.

There hasn't been a great deal of extension development from people other than myself, so I'm not sure how much interest there would be in something like this.

Code: [Select]
ISnippet behavior = behaviorChooser.getValue();
Folder folder = folderChooser.getValue();

List<SceneModel> addToScenes =
Game.getGame().getScenes().stream()
.filter(scene -> Resources.isUnderFolder(scene, folder))
.map(scene -> Scenes.ensureLoaded(scene))
.filter(scene -> !Scenes.hasSnippet(scene, behavior))
.collect(Collectors.toList());

UI.Choice result = UI.showYesCancelPrompt(
"Add Behavior to Scenes?",
"Add " + behavior.getName() + " to " + addToScenes.size() + " scene(s)?"
);

if(result == UI.Choice.YES)
{
for(SceneModel scene : addToScenes)
{
log.debug("Adding " + behavior.getName() +  " to " + scene.getName() + ".");
Scenes.addSnippet(scene, behavior);
Scenes.saveHeader(scene);
}
}

For Live Support: Join our discord channel and ping me @justin.

Hectate

  • *
  • Posts: 4641
It might be nice to have a batch processing for replacing one asset with another (e.g. Find and Replace tool). If Stencyl could scan all the behaviors and events for instances of Font ID 1 and replace it with Font ID 14, for example.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

Donni11

  • *
  • Posts: 2118
Request :

That users can add one behavior to all actors in a certain folder
The Stencyl Discord Channel , Where the real Stencyl work happens ;).

Donni11

  • *
  • Posts: 2118
Still in development ?
The Stencyl Discord Channel , Where the real Stencyl work happens ;).

tigerteeth

  • *
  • Posts: 734
I'd really love to be able to make batch changes to all scenes at the same time. Specifically I need to re-size and change the background colour of 120 scenes and the thought of doing it manually is keeping me up at night.

I'm not sure how many people are going to be in the same situation as me though, I can understand why these features aren't built in.