LarryG on 4/10/2010 at 23:50
I have several concrete children of Archetype A0 (a1, a2, a3 ...) all of which have the same modified characteristics, so I thought I would create a new archetype A1 as a child of A0 and move all of a1, a2, a3, ... under the new archetype, only to not be able to figure out how to do it. I found the command make_archetype, but that clones a concrete into an archetype, it doesn't change the parent of the concrete object. I can move archetypes around, changing their parents, but can see no way to move a concrete object. Is it not possible? Do I have to delete and recreate them all, or is there a simple way to do this that I'm not seeing?
intruder on 5/10/2010 at 00:11
Basically it should be possible, according to what Alex Duran said in one of his lectures at the GDC '03 about the object system of Thief:
Quote:
Multiple Inheritance –Thief 1 Metaproperties1. Metaproperties could be changed in game.
--> Since this meant that an instance’s archetype could change, it affect caching and other assumptions.
Building Object Systems - Features, Tradeoffs and Pitfalls- Alex Duran
But I can see no command for this:
(
http://thief.wikia.com/wiki/DromEd/Commands)
LarryG on 5/10/2010 at 00:53
Me neither. I was hoping there was something in the GUI if not in the commands. But didn't see it there either. And I didn't see a way to get a highlight command followed by something else to do it for me.
Nameless Voice on 5/10/2010 at 01:48
There's a way to trick DromEd into swapping two archetypes (all concrete objects will swap their parent archetypes), but that applies to all concrete objects of a specific type, not just to the ones you specify - I'm not sure if that's what you're looking for.
R Soul on 5/10/2010 at 01:56
There's no direct way, but if every concrete instance of A0 has the extra properties, you could try this:
Assuming A1 already has the extra properties, add to A1 all the properties of A0, and the initial values will be inherited.
Drag A1 to the parent of A0 so that A1 and A0 are both at the same level. Then drag A0 so that it inherits from A1.
Delete all the properties of A0 and add the extra properties, which will inherit from A1. Then delete the extra properties from A1. You can then rename the archetypes.
You can then delete the extra properties from the concrete objects. If you have lots of objects you can use hilight_obj_type and hilight_rem_prop to speed things up.
LarryG on 5/10/2010 at 04:25
Thanks. I think this is a lesson in thinking ahead. Fortunately I did not create so many of these puppies that I can't redo them all under the new parent. It just seemed that there should have been an easy way to do it. Guess not.
vfig on 3/1/2024 at 06:46
for posterity, it is possible to change the archetype of a concrete object. but i would not recommend doing it casually:
firstly, there are property caches involved that may not be refreshed correctly (since changing archetypes is not part of the expected object behaviour), so after making such a change, best to save the mission and reload it to ensure caches will be valid, just to be safe.
second, any instantiated properties on the concrete object (those that get copied onto it from the archetype, such as Physics>Model>Type) will retain their presence and value as copied from the original archetype, and you will have to manually fix them up on the concrete as necessary to match the new archetype.
with those caveats out of the way, here is the process:
1. note down the name or ID number of the concrete object and the new archetype you want it to be.
1. do link_show_all 1 in the command box.
2. open the links for the concrete object.
3. note the MetaProp flavour link from the concrete to its archetype, with Data=0. if the concrete has other metaproperties, they will have their own MetaProp links with nonzero data.
4. delete that link.
5. do link_objs_ex <concrete_id> <new_archetype> MetaProp, and in the Link Data dialog that comes up, accept the default value of zero. (dont include the angle brackets; but you can use the new archetype name e.g. link_objs_ex 2 Painting10 MetaProp for concrete ID 2).
6. if the object had other metaproperties, you must make sure the archetype link is the first one. open the links for the concrete object again. select your new MetaProp link the one with Data=0), and use the Up button until it has the lowest id of all the MetaProp links.
7. Save your mission, and reload it to ensure caches are valid. Then fix up any instantiated properties as needed.
as you can see, it is not a trivial thing to do. almost always, creating a new concrete and copying the properties over is easier. but in rare cases it is useful to be able to do it.