Hello! I have an issue, as I am a complete newbie when it comes to EU5, I am trying to learn to code with it, I’ve met an issue that I can’t find an answer for anywhere for now. According to the tutorial that I am learning from, I am suppose to receive code with the types of actions that are mentioned in the Topic. Unfortunately he doesn’t explain what this is or how to get it, code looks like this.
After hours of combating the code, I’ve been able to defeat most of it using the most unimaginable bypassed known to mankind, but I am stuck with setting up Vectors at the end in the screenshot below.
Hey @anonymous_user_1124406a, I’m not completely sure I understand your question but I’ll try to answer it.
In lines 41, 42 and 44 you are taking the InputComponent and binding user input to a specific function that you want to execute whenever that input is pressed. The first variable is the name of the action or axis, the second is a reference to the object that will be executing the action and the third is a reference to the function to execute.
As you can see, the “Object” and “KeyEvent” words appear in gray. This means that is being automatically generated by your IDE (probably visual studio). This is supposed to help the programmer visualize the type of the variable in those places, but is not actual code that is being executed, you can think of it as an inline comment. On the other hand, the keyword “this” is a reference to the object that owns the code in that file. In this case, “this” would be the instance of the ARollaBollPlayer class.
On the second image that you posted, I can see that you wrote “InX:”, “InY:” and “InZ:”, but these words were in gray, meaning that were inline comments automatically added by visual studio and is not meant to be executed, so that is probably causing you an error an preventing you from compiling.
Hope this helps clarify what you are dealing with.
And just a comment before finishing up, does the tutorial add forces to the Mesh as you are doing in the movement functions? I wonder because normally you would want to move the AActor class that contains the mesh and not the mesh by itself. If you move only the mesh, then you may end up with the mesh moving around, but the actual actor standing still. This will be an issue for the collisions and many other things. Unless the mesh is set up to be the RootComponent of said actor.
Anyway, hope I didn’t confuse you more with this, let me know if you have further questions or mark this issue as resolved if you don’t. Happy coding!
Is there a possibility to put inline comments manually? I tried yesterday for hours and it was possible, but I can’t understand their logic, I could put Object as an inline comment by using “:” and “()”. Also good to know that this is not actual code being executed, this explains as to why it wouldn’t compile my code normally. I am using Rider instead of Visual Studio, for some reason it works better than VS, don’t know if it may be an issue as well.
And to your last question, I am making a root component from a pawn, tutorial teaches me complete basics of movement, basic code structure and how to implement it into EU5.
Thank you so much for your answer!
Nevermind, I fixed it, I had to read your explanation of the inline comment for the third time to understand the case, You can simply put coordinates into FVector() and give X Y Z in there. I was too obsessed with those comments. Thank you for the help and have a great day sir!