Way of fast check UScript code without start UT or restart UEd

Discussions about Coding and Scripting
Buggie
Adept
Posts: 421
Joined: Sat Mar 21, 2020 5:32 am

Way of fast check UScript code without start UT or restart UEd

Post by Buggie » Thu Aug 20, 2020 1:49 pm

IDK, maybe all know this trick, maybe not.

Main essence:
When you compile script it is already applied to current instance of UEd.
You not need save package at all.

So you can just use any custom brush builder (because they usually load handy Actor LevelInfo), modify code, try compile and just press button for this Brush Builder for check this code.

I use EditorTools.EditActor for example viewtopic.php?f=5&t=14061

For example I need check it is possible pass 'package.class' to call isA.
I open EditorTools.EditActor in UEd (Object - BrushBuilder - EditActor), write line
actor.isA('pkg.actor');
and get error "Illegal character in name".
I try different code. When it compiled I can press EditActor button and run this code without restart UEd.

Of course you can not check all code in this way. Some code make sence only in game env but in general it can be very useful for testing something.

-----
Also it is VERY helpful when you develop some BuilderBrush. You just copy new text of BuilderBrush over existing (except defaultproperties of course), compile and check it.

But exists one caveat - if you change list of parameters of BuilderBrush it can crash your UEd when you try run new compiled BuilderBrush, because serialized parameters does not match expected and vice versa.