I want to make sure that before I begin scripting, that there is a way to ensure a model has:
- Fully loaded
- Is initialized correctly
- Contains a specified list of children, descendants, attachments, etc.
- Correctly follows an arbitrary convention
My idea was to create a ValidatorService which contains a variety of utilities for developers to create their own scripts for team-defined naming/hierarchy conventions for a model.
As an example, let’s say I create a convention for a Vehicle which requires:
- FL_Wheel, FR_Wheel, BL_Wheel, BR_Wheel
- Steering_Wheel
- Driver_Seat
- Drive_SFX
- Dust_VFX
For the context of my game, I’d like to easily drop in a new vehicle model and ensure it follows a given set of rules before it is used in the game.
Isn’t that what oop is all about?
This is a different scenario.
If the game had 10+ vehicle types and I decided to add a new model. A simple name mismatch (e.g. Steering_Wheel → Wheel) would mess everything up. Every model is visually different, but contains a list of essential vfx, sfx, folders, or parts that must be exactly alike for scripts to access them.
Maybe I’m misunderstanding, but I agree with the previous poster. Sounds like the perfect application for OOP.
It entirely depends on how your game is structured, i can only give you generals tips, for example,
To solve your example, you need something to indentify your models. You can use attributes, configuration, values, etc.
For example, one way is that if the names part has a similar name to all models like “wheels”, then you can use string.find
This finds a specific word, so whenever it is fb_wheel or car_wheel, as long as wheel is there, it finds the words.
You can run somewhat of a check, whenever a model lacks a part you can simply skip that cars initialization, that entirely depends upon you.