order of object creation??

MIB's icon

I was wondering if there is a way to know the order of object creation at loadtime.

I would like to catch error messages at startup with [error] (in order to switch automatically between different externals in case one is not installed), but my "bogus" objects get loaded before the [error] is initialized (I think).

I have a feeling that this isn't possible, but thought that asking wouldn't hurt.

Thanks.

Roman Thilenius's icon

from low level to high level, from left to right, from bottom to top.

MIB's icon

Maybe I am misunderstanding, but I can't get this to work.
Here is a quick example of what I am trying to do:

Max Patch
Copy patch and select New From Clipboard in Max.

Thanks

Roman Thilenius's icon

i dont think anything can output errors before the patch has finished loading.

Luke Hall's icon

Perhaps if you put the specific object in a [patcher] and named the [inlet](s) and [outlet](s) then you could use a javascript which uses this.patcher.applydeep() to search every object in your patch, find which one has .maxclass == "jbogus" and then script in the replacement and the re-connections. Triggering this via loadbang() in js should work I think.

lh

monohusche's icon

In one of my apps, I implemented an abstraction which is able to switch between elasticindex~ and index~ (in case the external can't be loaded).

have no max here, but remember that I used jscript for that, works without problems. could send you the stuff tonight

nick

Peter Castine's icon

If you want your patch to work on different Max installations and guarantee that non-factory externals are available, you might want to build a Collective or Standalone.

I personally find this more straight-forward and robust than hacking JScript. The latter is obviously possible, and the choice is partly a matter of taste.

Just an idea for your consideration.

monohusche's icon

makes definitely sense, in fact, my app is deployed as a collective. Unfortunately, elasticindex~ is not free and therefore can't be included.

All other non-factory externals are included of course.

MIB's icon

This was a badly thought through idea to start with. Sorry.
The workarounds are obvious and simple enough. thanks for the responses though. appreciated.