STEAM GROUP
Payday 2 Mechanics PD2mech
STEAM GROUP
Payday 2 Mechanics PD2mech
20
IN-GAME
91
ONLINE
Founded
27 September, 2015
Showing 21-30 of 105 entries
69
Strings
6
Question re: Counterfeit scripts
The converter does:

Remove elements that are never referenced by other elements and that do not execute on startup.

Remove all permanently disabled nodes unless they are referenced by an ElementRandom that does not ignore disabled.

Shift the number of times an element can be toggled further up the tree of on_execs if possible.
Remove elements with no effect unless they are referenced by certain other elements (e.g. ElementRandom). I have a list of element types with effects and some additional rules (remember that one instance with the filter always evaluating true).

Convert elements into MissionScriptElements if possible. MissionScriptElements do nothing but pass execute other nodes. I essentially abstract away other elements into a MissionScriptElement with an effect assigned to it. For the most part anyway.

Inline elements into other elements.

Remove empty ElementToggles.

Merge identical elements (same effect and refs, but different name).

Inline ElementLogicChanceTriggers to make some nice if/else conditions.


That's the simplification step. The converter then uses the element info and walks along the tree of elements. It starts with trigger elements and those with execute on startup and figures out what other elements are referenced and should come next.


Disabled elements are generally removed for clarity. I am quite careful in not removing anything that could be observed in the game, though there is always room for improvement. Let me know if there is a mismatch between the raw and non-raw version that could be observed.
31
Visualisation script
The "position 3750.0, 8125.0, 4102.5" is for the editor (which only the developers have). The editor would show an icon at that location, so the devs can click on it to change it. My mission file converter uses this (I figured it all out manually):

classesWithPositionRotation = set([
"ElementAIArea",
"ElementAlertTrigger",
"ElementAreaTrigger",
"ElementAreaReportTrigger",
"ElementAreaMinPoliceForce",
"ElementBlurZone",
"ElementExplosion",
"ElementExplosionDamage",
"ElementFeedback",
"ElementFleePoint",
"ElementInstancePoint",
"ElementInteraction",
"ElementInventoryDummy",
"ElementLookAtTrigger",
"ElementLootBag",
"ElementPlayerSpawner",
"ElementPrePlanning",
"ElementShape",
"ElementSmokeGrenade",
"ElementSpawnGrenade",
"ElementSpawnCivilian",
"ElementSpawnDeployable",
"ElementSpawnEnemyDummy",
"ElementSpecialObjective",
"ElementSpecialObjectiveGroup",
"ElementSpotter",
"ElementWaypoint",
"ElementWorldCamera",
"MissionScriptElement",
"ElementAccessCamera", #if not camera_u_id
"ElementDialogue", #if use_position
"ElementPlayEffect", #if not screen_space
"ElementPlaySound", #if not use_instigator and not elements
"ElementTeammateComment", #if close_to_element
"ElementPhysicsPush",
"ElementScenarioEvent",
"ElementLootPile",
])

There are 154 different types of mission elements, but only these 37 use the position value.

Also, the levels folder (not levels raw) usually works better for these locations: https://bitbucket.org/Frankelstner/pd2-mission-scripts/src/63b2f566c703a6c3ae7023388737565c92d3d1c9/levels/narratives/elephant/dark_mis%20default%20True.txt?at=master&fileviewer=file-view-default
Showing 21-30 of 105 entries