Last updated 25.04.30
Relatively simple way to optimize simulation. There's probably a shorter version of the same method but this is easier.
Note:
- Requires Notepad++ or something else with regex substitution (change Search Mode to "Regular Expression").
- Depending on the editor used, they may use different "flavors" of regex, and so the exact regex statements may vary. The patterns are tested with Notepad++, which uses PCRE.
- The patterns are safe for airplanes with funky trees as the characters =, <, and " are escaped in XML entries.
- Always backup your aircraft first, or perform the changes in a copy.
1. Dump old XML tags
- Substitute calculateDrag=".*?" with nothing.
- Substitute massScale=".*?" with nothing.
- Notice: This is needed as the game will treat duplicate attributes as an error, and fail to load your aircraft.
2. Actual stuff
- Substitute Part id="([0-9]+)" with Part id="\1" massScale="0" calculateDrag="false"
- Check that the part IDs are unchanged. If they change to \1, try to use $1 in the replacement text.
- Alternative regex by DDVC: substitute " partType=" with " calculateDrag="false" partType=" (this is not affected by regex flavor differences)
3. Profit
Enjoy your new plane with zero mass and drag. When returning to the game, be sure to give back the mass and drag to parts that need them.
@hpgbproductions Ah sorry my mistake. Apparently I didn't do the first step and immediately do the second, sorry about that and thank you it work wonderfully.
@DDVC i found the problem with my regex, it depends on the "flavor" of regex used by the editor. I wrote the original forum post using the style in Notepad++, where
\1
means the stuff matched in the first (...). If all the part IDs are replaced with\1
, it means that your editor is using a different flavor of regex. In Visual Studio, you must use$1
. I added this notice to the forum post..
Your suggested regex works for me, but maybe your aircraft uses more features. You still need to dump the old calculateDrag attributes before the main substitution.
@hpgbproductions
So I've tried it again but unfortuately it doesn't work. But i find something when I tried other method.
When I change:
" partType="
to:
" calculateDrag="false" partType="
It works when i test it with the starting cockpit (a cockpit and two block), but it throws me the same error message as before with bigger build. Maybe it have to do with file size since its nearly 1.6 mb, and the game can't change something so much thing at the same time?
@DDVC I feel like it should still work, but be unsafe now because of funky trees. I haven't verified it (i forgor)
- check regex mode?
- maybe use Part id="([0-9]+?)" (edit: it behaves the same)
- check other sections like Connections unaffected
Does this still works? When I did it the craft wont load and give me an error message.
@IDNSatyaSlebew yes
Can health also edited entirely?
@AstleyIndustries it wouldn't cause an issue if there were no other attributes after calculateDrag, which I don't think there usually is, but it's good to be airtight...
Adding the multi part edit similar to the one on FineTuner would be great
.
But I don't know if that's possible
@AstleyIndustries oOf
@CrashFighter05 overload only does one part at a time, gonna have a bad time editing 400 parts
@WNP78 thanks for catching this lol (somehow didn't get that problem when i did it though)
You might want to make the calculateDrag=".*" lazy matching (calculateDrag=".*?") so that it doesn't delete things after it. For instance, calculateDrag=".*" would match all of calculateDrag="false" health="200", including the health tag, since the wildcard includes as much as possible.
Or just use this It's much easier.
or you could use overload.