Serious Sam Fusion 2017 (beta)

Serious Sam Fusion 2017 (beta)

Not enough ratings
[Resource] Ryason's SS1 Compatibility and Other Misc Editor Functions
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
138.880 KB
12 Mar, 2020 @ 6:27pm
1 Change Note ( view )

Subscribe to download
[Resource] Ryason's SS1 Compatibility and Other Misc Editor Functions

Description
This is primarily a set of functions for use in the editor, but also acts as a resource if the SS1 compatibility is made use of.

Pretty much the main reason I made this was to make SS1 entities work outside of SSHD gametitles, since they weren't nearly as broken as everyone made them out to be. For the most part it's mainly interactions between regular entities and SS1 entities that don't work. Here's the main function for this, to be run in the editor:

globals.CreateSS1CompatibilityScript(Filepath)

Notes:
-If you use this function on a level, this mod will become a requirement for the map, as the functions the created script references, as well as the replacement model for some moving brushes, are part of this mod.
-A filepath can be defined for the script to be saved at, but not inputting one will save it in a "Scripts" folder in the same folder as the wld file. If the script already exists on the world (with the exact entity name it was given), it'll update that script.
-The function may adjust some entities to work with the script, in which case it will print out what its done. The most notable change being that Moving Brushes that either act as switches or are analyzable will have their model changed, and a static model with the original model will be put in its place (this will likely require rebaking lightmaps, if you care enough).
-If you make any changes to the level in regards to logic, enemies, items, etc, you should run the function again to update the script.
-It should go without saying, but this is only necessary if you're going to convert a TFE or TSE map to either SS3 or any custom gametitle (or I guess if you want to use SS1 entities outside of SSHD in general). Creating the script and leaving the map on one of the SSHD gametitles will likely cause some things to trigger twice.

If there's anything that doesn't trigger or work correctly in regards to map elements, please let me know. This was mainly tested via picking and choosing vanilla SSHD maps, so there's a good chance I missed something. Also, be aware that this will not fix things like the Dual Colts or Netricsa (analyzable objects just won't do anything).

For those curious, here are the problems I've found with SS1 entities that this function should address:
-New entities (ChapterInfos, Items, Puppets, etc) that have a Target set don't trigger said target.
-Multispawners don't apply the Tactic and starting marker set in the spawning params to spawned puppets.
-Multispawners don't support the "Teleport" and "Triggered" spawn types.
-SS1 Enemy Markers don't apply their Blind and Deaf settings to puppets that reach them.
-Static Models with the "Active" flag turned off are not hidden on level start, and require Game Scripting in order to Activate/Deactivate via Triggers and such.
-SS1 Switches can't be used by the player.
-SS1 Moving Brushes that act as a switch can't be used by the player.
-SS1 Watch Players doesn't function, and hence never triggers anything.
-Messages displayed via triggers (usually secret messages) do not show up on the HUD.


Other functions availible are as follows:

globals.ScaleLevelToGameTitle(GametitleName,ResizeNonScalables)
This function changes the gametitle of the level while also entirely rescaling the map to match the new PlayerPuppet's scale (if there's any difference).
I currently do not recommend using this for vanilla campaign maps in general. Firstly, this will require rebaking the Visibility and Navigation on maps, and some BFE maps are missing the source Visibility mesh. Secondly, certain entities (Animated Movers/Cameras and most SS1-related models) do not accept a Scale value and need to be resized via direct modification to the Animation/Mesh. The script will resize these if you put in true for "ResizeNonScalables", but it'll be up to you to resave all of the changed resources to a new location; Do not hit save on the map until you've done this, otherwise it will overwrite all of the changed resources and affect the vanilla maps. Said resources will be listed out in the console, and you can click the magnifying glass next to each and click "Select entities that share chosen file" to find the resources on the map.

globals.ScaleMesh(DesiredScale)
To be used in the Mesh Editor; Scales all selected meshes to the desired scale. Multiple meshes can be selected at once and brought up in the mesh editor to be resized simultaneously.

globals.ScaleAnimations(DesiredScale)
To be used in the Animation Editor; Scales all of the animations of the currently selected entity to the desired scale. Unlike ScaleMesh, this can only be used on one entity at a time. This is intended to scale the animations for things like Animated Movers and Cameras, and is not intended for use with character animations.

globals.UnlockSelectedEntities()
Unlocks the currently selected entities. Good for those red entities you find in some SSHD maps.

globals.UnlockAllEntities()
Unlocks all entities in the level.

globals.ListPuppetParams()
Lists all puppet parameter resources used in puppet entities.

globals.ListItemParams()
Lists all item parameter resources used in item entities.

globals.ListWorldModels()
Lists all model resources used for level geometry, barriers, and touchfields.

globals.ListWeaponParams(ListChapterIDs)
Lists all weapon parameter resources included with weapon items, chapter infos, and spawn markers. Setting "ListChapterIDs" to true will list all of the Entity IDs of the said chapters and spawn markers.