How to replace core engine files in plugin
This is my first time dealing with a large C++ project and it's a pretty big step up. My problem is that I want to change the movement so that it works like the source engine and bunnyhopping and surfing is possible. So I located the file responsible (as far as I could work out) for updating movement of characters (characterMovementComponent.cpp/.h). However when I tried to change it directly it wouldn't update. So I decided the best thing to do would be to create a plugin that changes the movement whenever it's activated.
My question is, is this the correct way to go about this and how can i overwrite the characterMovementComponent.cpp with my own one from a plugin? (or if this is even possible, I'm new to large engines)
Any help would be appreciated, thanks.
asked Oct 20 '15 at 02:34 AM in C++ Programming
No, C++ code that is compiled and loaded and other code is linked in to it can't be overwritted (in C++ sofcorse ince you can technicly edit compiled binery files). But you can create subclass of UCharacterMovementComponent and override it's functionality by overrideing it's functions. Ofcorse it will create sperate component but you can still use it. Run editor and make new C++ class in File menu, there you can pick base class and pick CharacterMovementComponent. It's kind of wierd you don't know about it since it's basics of codeing in this engine.
Here you got tutorial i made about classes and objects in UE4, about inherence, it mainly directed for BP users but it should help you grasp how to deal with classes, note that BP classes are same valid classes as C++ classes https://www.youtube.com/watch?v=R9QIIBB_qVc
Also worth mention is that engine is divided in to modules (similary to Linux kernel, you can see modules in binery directory, all those dlls), when you make C++ project it creates extra module and it equile to all other modules in engine, techniclly you extending engine code, Plugin also contains modules. They work the same and they can do anything as any other module can, they are just diffrent way of distributing them, so lot of things can be done without editing a single line in engine.
answered Oct 20 '15 at 03:40 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here