I want to call methods inside a C++ class created inside my project from SkookumScript. The C++ class is created from Unreal Editor. I couldn’t find a way to access it from the SkookumIDE. I know this is possible with SkookumScript I just want to know how to achieve that. Thanks
I’ve had this on my list of TODOs. I’ll finish up the new set of instructions on how to do this later today.
You can now find instructions in the repo readme under C++ Project Instructions. If you are using 4.24 be sure to grab the latest release or source, there were a few fixes to
SkookumScriptGenerator that are required if you’re doing C++ stuff.
Thank you so much for the reply. I followed your instructions and I have this error showing up.
Error E1696 cannot open source file “SkUEProjectGeneratedBindings.generated.inl”
I’ve tried this on UE 4.18.3 and 4.23.1
Can you show me your project’s build.cs file, your SkookumScript config file and your main project cpp.
Is this the binary or source engine? If binary did you clean project and rebuild. If source did you try cleaning the UnrealHeaderTool program and rebuilding.
Finally do you have the SkookumScript plugin enabled in the project file?
This is Binary Engine. I even tried re doing this in 4.24. still the same problem. I checked and inside
C:\Users<username>\Documents\Unreal Projects\SkCpp\Plugins\SkookumScript\Intermediate\Build\Win64\UE4Editor\Inc\SkookumScriptRuntime I couldn’t find SkUEProjectGeneratedBindings.generated.inl
If you’d like further help then please respond with the items I asked for.
Sorry I forgot to attach these with the comment. Please have a look at them.
EDIT: I’m not sure if you can see Build.cs file properly
I can see it fine, just open in new tab. Ok your files check out. Since you are using the binary engine can you try cleaning the project and recompiling.
SkUEProjectGeneratedBindings.generated.inl file is generated by
UnrealHeaderTool (UHT) during the build process, but unless you clean your project, UHT doesn’t run.
When you build you should first see UHT being built. Then you’ll see UHT run with a message like:
Running UnrealHeaderTool …
SkookumScript: Generating C++ script bindings for 39 engine modules and 1 project module(s)
If it still doesn’t work, send over the build output, there might be some errors occurring during UHT.
I did clean the project and then built it. Still the problem exists.
Here is the output log.
I see a complaint about PCHUsage not being specified, can you uncomment the line in your build.cs file:
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
The main problem I see here is that it isn’t trying to generate your project bindings. The main reason this would happen is if the
SkookumScript.ini file were missing. Can you verify the location of this file? It should be in the Config folder of your project where the other ini files are.
Thats it. Even though I created the SkookumScript.ini file from VS it wasn’t really added to the config folder. I tried manually adding it to the config folder inside the project and now it works. My bad! Thank you for your time and support.
Hey again!. Is there any example projects where SkookumScript has been used with C++ classes and methods? All the classes, functions and Properties are now showing but when I call them nothing happens.
There aren’t any, however all of the existing stock functions are defined in C++. So even calling
some_actor.actor_location is calling the C++
Can you give me some example code that you’re trying? Maybe I can spot an issue.
Its really simple. I created two Actors using c++ and blueprints in unreal editor. Then I added a simple function to the c++ actor using VS. And added UFunction() and stuff. I can see both actors in SkookumIDE and I wrote a simple script to continuously rotate the actor. I added same script to the c++ actor but nothing actually happens. I can see the function I defined before. but couldn’t call it.
This is the BPMyActor. It has a coroutine which can rotate the actor.
I call it inside the constructor.
I did the same thing for C++ MyActor. Nothing happens.
Not even print to the log.
this is the c++ code of the MyActor.
This looks mostly legit. One thing to mention is that only executes at runtime. So you would need to drag one of these actors into a level and simulate or play to see the code run.
I would recommend defining an entry point method that you call from blueprint begin play like:
&blueprint () [ branch _transform ]
The reason being that class constructors are called often when the game world doesn’t exist and trying to call certain methods during this time can result in a crash.
You should definitely see your print statements when you simulate with one of these actors in the level.