-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring & improvements to template system #306
Comments
Interesting!! |
Suggestions for the format of the config entries for the factions would be very much welcomed, especially what information etc. should be kept about each faction, infantry, vehicle and such. Another option would be to have faction information separate from vehicle information, then we would have a config for vehicles, to which the faction config would just reference, avoiding possible duplication. Perhaps something along these lines (for AAF, given only the Kuma MBT): class Faction_ind_aaf {
side = "IND";
name = "AAF";
color = "ColorGUER";
marker = "flag_AAF";
class Vehicles {
// MBT-52 Kuma
class mbt_03 {
type = "mbt";
classname = "I_MBT_03_cannon_F";
texture = "Indep_01";
animations[] = { "HideTurret", 0, "HideHull", 0, "showCamonetHull", 0, "showCamonetTurret", 0 };
price = 100;
};
class mbt_03_camonet : mbt_03 {
animations[] = { "HideTurret", 0, "HideHull", 0, "showCamonetHull", 1, "showCamonetTurret", 1 };
};
};
}; And a script for spawning a vehicle, given the name in the config and the faction it belongs to: /*
Spawns a vehicle as specified in the config for the given faction.
This also applies any modifications made to the vehicle, as well as choice of texture.
*/
params [
["_faction", [nil], [""]],
["_type", [nil], [""]],
["_position", [nil], [[]]]
];
// Get information
_vehicleEntry = missionConfigFile >> _faction >> "Vehicles" >> _type;
_classname = getText (_vehicleEntry >> "classname");
_texture = getText (_vehicleEntry >> "texture");
_animations = getArray (_vehicleEntry >> "animations");
// Spawn and modify
_vehicle = createVehicle [_classname, _position, [], 0, "NONE"];
[
_vehicle,
[_texture, 1],
_animations
] call BIS_fnc_initVehicle;
// Return the spawned vehicle
_vehicle; |
In addition to the Thus we should also allow players to either have the factions selected automatically (as is currently done) or specify them before the missions starts, allowing them to select from all the found factions (something like you do at setup in the Dynamic Recon Ops mission). |
The template system could really use an overhaul and better documentation regarding what variables do what etc., while I am not terribly familiar with the codebase I would be willing to help, provided some guidance.
I propose that the templates be moved to the actual mission config, where they can be expanded to support a wide array of more options. With this we would need various supporting functions that help us retrieve the wanted data from the config.
Fx. for vehicles we can not only define just an array of vehicles, but an array of (classes) in the config, where each entry has a vehicle, a price, and a set of animations and textures that are applied to the vehicle when it is spawned (with BIS_fnc_initVehiclel, like the export from virtual garage does).
This would allow for a much greater diversity, and greatly improve support for new features coming with the tanks DLC, like SLAT armor and/or camonets for vehicles.
The config for a vehicle could then look something like this:
Alternatively
BIS_fnc_initVehicle
supports randomly selecting both what texture is used and what animation are enabled, and could be used instead, or along with a config like this.The text was updated successfully, but these errors were encountered: