CaptainPStar / co10_Escape

Official Github repository of A3 mission co10_Escape.
63 stars 47 forks source link

IsoTemplates #93

Open CaptainPStar opened 3 years ago

CaptainPStar commented 3 years ago

Implementation of the new Isotemplate system started and I need some input from the community.

How to template work right now

In the past templates were scripts, that handled the creation and implementation of all location functionaltity (except patrols). The server started a script locating all locations for e.g. comcenters and this script called the template script multiple times for every one of these locations. The called script then constructed very object, placed ammoboxes/vehicles, backpacks, comterminals with linked action etc. This system worked good and reliable but was not very exendable. Creating a new template required writing createvehicle commands for every object in a template-script, adding the creation of vehicles, etc For example changing th way of static gun creation would require editing every single template one by one.

What is the IsoTemplate-System

The IsoTemplate system works different, but is much more flexible and much easier to configure. The system works like this: Base compositions are created in 3DEN editor and exported by calling a trigger (this is the same as with the old system) but instead of a callable template script it dumps all objects, with their position, direction, pitch and special attribute (I will come to the attributes later) in a array which is written to a file. The array contains additional data about the composition like type ("comcenter","Ammodepot",...), author, escape version, mods used, etc. When escape is loaded a set of templates for each type of base is configured and when one should be spawned a construction script loops through every obejct in the array and creates it at the desired position. So instead of hundreds of createvehicle there is now only one for base construction in the whole codebase. This has a lot of advantages, for example there is only a single line where problems with object creations (think of the roadbarriers and wrongly rotated comcenters) can be fixed.

Attribute system

The Attribute system is what makes this new system a huge improvement to expanding Escape and to gameplay itself. When creating a new composition/template, the creator can add key-value pars to the objects and the template creation will use these attributes to do certain thinks with the objects from the template. Maybe the simplest example: this setvariable ["A3E_IsoAttribute",["Terminal",true]]; will mark an object in a composition as a hackable terminal. So with this simple addition it would be possible to add multiple terminals to a comcenter or simply use a different object as terminal (for example for Global Mobilization which features a custom radioterminal). Some other examples I already came up with ["VarName","MyObject"] -> Object will have a unique variable name (stored in a object/array unique for every instance of the template). ["Show",false] -> Object will not be spawned but the location, direction and type is stored and accessible in the templatecreation ["Ammobox","Launcher"] -> Defines object as ammobox that is filled with launchers (or e.g. "special","gear",...), used for ammodepots but in theory can be added to every other base aswell. If combined with ["Show",false] can be used to create mod specific ammoboxes (e.g. german boxes in GM or takistan boxes in CUP). But if you need exactly the box from the template, because it looks cool to the rest, you can force the specific box by leaving ["Show",false] out. ["Static","StaticHigh"]/["Static","StaticLow"]/["Static","AA"]/["Static","All"] -> Will be used to specify if an object is the position of a static and if, what type of static: No more low profile launchers behind hesco barriers ;) ["ParkedVehicle","Typeof(Car/Truck/Tank/All)"] -> Position is used for spawning a parked vehicle. ["BoundingBox",boundingbox this] -> Limits the spawn of vehicles to vehicles smaller than the object placed in editor. useful if you want to make sure nothing large is spawned at a position ["Probability",50] -> this object is spawned with a 50:50 chance ["DisableSimulation",5] -> Disables simulation for x seconds after spawn.

Input wanted

The system described above is in development and will hit devbranch soon. But in the meantime I need further input of what I could add to the attribute system. If someboy has any ideas or wishes what to customize when creating a new template, please tell me below in the comments.

CaptainPStar commented 3 years ago

Small addition I forgot: In theory it would be possible to load new templates with a arma Extension live, from the internet, without updating escape. Which would be incredibly cool.

Qerbas commented 3 years ago

["ParkedVehicle_Turret","Typeof(Car/Truck/Tank/All)"] An additional parked vehicle attribute to be specifically used as a turret so it would spawn with gunner positions (not FFV) only. Ability to set it's type just like other parked vehicles. It would be great for making something like this.

Some kind of attribute to spawn AI units in buildings with more precision and reliability. I know the current templates spawn units in them but there's not much control. For example, many towers should always have guards, like the ones in the motor pool but often don't. A way to add them with their chance to spawn would be great.

It may be out of the scope of the attribute system, but would it be possible to move the what types of templates to Unitclasses file so we can create per version bases? Having unique bases for CUP versions, IFA3, Vanilla, etc. would open up many opportunities for creative bases and definitely improve immersion.

CaptainPStar commented 3 years ago

Per mod templates is definitly planned and will most likely be defined in the compiler config. I just need to come up with a good fallback system so we can add per mod templates gradually and don't need them from the start.

lozanoeg commented 2 years ago

a moving vehicle flag like ["PatrolVehicle",Typeof(Car/Truck/Tank/ALL)] for A vehicle that just drives around near where it spawns and maybe ["ConvoyVehicle",Typeof(Car/Truck/Tank/ALL), "ConvoyName"] where name is so that vehicles will be added to that convoy so that you could spawn moving targets like ammo shipments or an HVT with guaranteed Intel or things like that

CRCError1970 commented 1 year ago

In old-school Arma, there were "auras" around some types of buildings. Some buildings were flagged as a repair center. Field hospitals would heal units. About the only thing that has survived the progression to Arma 3 is fuel pumps/stations. ["Support","Repair"] and ["Support","Fuel"] might be good additions.

Also, it would be fabulous if we could make entire IsoTemplates that are faction specific. Having OPFOR and IND versions of Depots/Mortars