You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say I pass a keyvalue to a macro_insert whose value is the name of an entity. Then inside the template a custom mess point entity, or a _mess custom keyvalue, takes that value resulting in an entity already present in the map, with that name, being "pulled" into the instance and replaces the point entity.
A use case of this are templates having ambient_generics or env_sprites. Rather than exposing every keyvalue and flag for those entities to a .ted entity or a macro_insert's keyvalues for maximum customizability, you just give those a name of an external entity to be used in its stead. A sort of BYOB but for entities, if you will.
The text was updated successfully, but these errors were encountered:
Interesting idea, I think this could be very useful.
It is possible to pass MScript values of any type into a template (strings, numbers, arrays, objects, functions, etc.), and with a macro_brush you can 'bring your own brushwork' to some degree. It's also possible to create an entity from an MScript object with the help of array property keys and the obj_fields and obj_value functions. But it's currently not possible to fetch an entity from somewhere else in the map.
I have been thinking about an MScript API that would give you access to the content of a map. With that, you could write something like {map.get_entities({targetname: 'my_sprite'})[0]} to grab an entity and pass it into a template, and then use the above mechanism to create a copy of that entity.
Something similar could be done for templates as well. It would be interesting to have 'higher-order templates', for example an elevator template that lets the user pass in a custom button template.
using a _mess_copy_entity_properties_of property, copy all the properties of such named entity. The original entity is preserved. Additionally any extra keyvalues set in the template entity overrides the ones it copies e.g. targetname={instance_consistent_name}.
using macro_copyentity or macro_replaceentity, copy or replace entity in its place. the entities would have the same configuration for brush entities placement as macro_insert. Again, extra keyvalues set in the template entity overrides the ones it copies.
Come to think of it, the last point sounds really similar to the macro_insert/macro_template system. Maybe I should just use that instead. :P
Let's say I pass a keyvalue to a macro_insert whose value is the name of an entity. Then inside the template a custom mess point entity, or a _mess custom keyvalue, takes that value resulting in an entity already present in the map, with that name, being "pulled" into the instance and replaces the point entity.
A use case of this are templates having ambient_generics or env_sprites. Rather than exposing every keyvalue and flag for those entities to a .ted entity or a macro_insert's keyvalues for maximum customizability, you just give those a name of an external entity to be used in its stead. A sort of BYOB but for entities, if you will.
The text was updated successfully, but these errors were encountered: