Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
EDIT: Loading order is probably not even relevant.
A simple optional "fallback" attribute for the effects would be nice. Just like this:
I am also thinking about a possibility to bundle effect definitions for multiple vehicles in a single mod, I think that would make life easier for authors having many items in the workshop.
One way to implement this: your mod scans other mods for some marker object name and then tries to load xmls from a subdirectory of that mod. Or even simpler: you could just scan every vehicle asset dir for multiple xmls with a "VehicleEffects" prefix (to not mess with other definitions, e.g. for subbuildings) This way each author could upload a dummy vehicle with the definitions and wouldn't have to create a new mod for that (not everybody could do that).
(A rather ugly workaround, requiring no changes to your code, would be placing all definitions in the single big xml of a dummy vehicle, but this could quickly get confusing.)
Also, this way, one could offer definitions for vehicles, which may never get updated by their authors. Definitions bundeled individually with a vehicle could always be given precendence, in case an author is just late with updating.
The loading order does seem relevant, but I had an idea for a 'plugin' system that allows a mod to register itself as a plugin in OnCreated and then indicitate it is done setting up in OnLevelLoaded while this mod will wait for all registered plugins to be done before it updates the vehicles. I also was under the impression that C:S 1.6 would add something to influence mod loading order, but
The fallback should be easy enough to implement in the way you suggested, so I want to get on that as soon as possible.
Bundeling definition files would be nice because you wouldn't have to update all assets individually. I think using a mod would be preferably (a template C# script could be provided) with Vehicle Effects checking for a certain naming convention in mod names and then loading xml files from the folder of that mod. Something like having "Vehicle Effects Definiton" as a required prefix for the mod name. That would make it fairly easy to give these lower priority than definitions included with vehicles. It could also be used for adding effects to a vehicle which isn't updated.
On a sidenote, the update to Unity 5.4 also means that particle system modules can be accessed trough code. That should make creating custom particle effects a bit easier.
A plugin registration mechanism would be great. I took a look at the games's mod loading code and it just traverses a Dictionary, which doesn't guarantee any order. Probably we were only lucky so far.
Maybe you could also emit an event _after_ replacing the effects? I would like my engine sound effects to scan for using VehicleInfos and set appropriate acceleration and braking values. That would save editing each vehicle in asset editor (Btw. Asset Vehicle Editor can't save anymore, iirc. a signature mismatch.)
As for definition bundling via mod, the script should be setup/placed for run-time compilation to keep things simple. Most vehicle authors may never have touched VS, so that might be a barrier else.
At the moment I am fighting some stupid bug concerning duplicate prefab names, I can't explain to me. It just occurs for _some_ local copies of published CRPs - even if there is not a single other copy of the file on the system... I used these to prepare effect definitions using the actual steam IDs, which worked fine before 1.6.
More serious, vehicle effects only get loaded for some vehicles on startup. But using the effect reloading shortcut always works. Not sure what's going on there. Loading order problems can't explain that...
Also, with 1.6, there is now some strange global reverb (sounds like a big cavern). Fortunately, it's easy to disable, at the moment I am using this code for my plugin:
On the plus side, there is now a finer volume/distance-dependency and doppler effects. Either these are new or some mod messed them up before 1.6... ;-)
The duplicate prefab error also happens to 2 of my workshop items, it's not just local copies. No clue what causes it, the local copies work fine.
And that bug with not loading for some vehicles is really strange, maybe some prefabs aren't actually loaded at that point, but that doesn't make a lot of sense either. As far as I know, OnLevelLoaded comes after all prefabs are loaded.
I just managed to kill a big SVN working copy including my plugin and other projects, there was an invalid junction during commit and that probably was a problem. Nothing is lost, but it will take some time to get it working again...
In the mean time I will leave the preview videos for the plugin here (to provide some motivation :-) :
Direct Current: https://www.youtube.com/watch?v=IDGUpY2xam8&t=3s
Specialized variant for Sprague-Thomson: https://www.youtube.com/watch?v=Rif0Cvy_aWI
Turbo Diesel: https://www.youtube.com/watch?v=3rE_EXe2tvA
Those updates always mess things up...
You can do a check to see if a mod with the correct workshop id is subscribed before using anything from the dll to ensure it's available for use. No need to do that when testing though. I'll update the plugin system and provide an example later.
And those sound effects are amazing :D
Nice to see it's happening... If you want you can also get my metro sound and bundle it as it's really generic. Gonna record some video of that later I guess :) (The files used are from my old GTA IV installation *cough*)
@Delta
Generic sounds could be bundled with VE mod itself. On the other hand, with sounds one always wants to change and adjust something and with your own plugin mod you could do so independently and quickly. However, we can shift effects back and forth between mods anytime.
https://youtu.be/uUiU3u4uJBY
Also the mysterious partial effect update seems just to be caused by an uncaught exception during particle effect creation. Somewhere in DieselSmoke.CreateEffectObject(), probably related to the Unity version changes you already mentioned. (Btw. is there a way to link a debugger to the C# / IL part of the CSL process?)
I will do some further testing and report any problems.
So, whats left on my todo list for now:
-testing vehicle info acc/brake update
-testing positive subscription check
-duplicate prefab nonsense
-if necessary repairing asset vehicle editor (as a last resort we could decompile and fix it)