Hello everyone, I’m making a game for Windows. Everything works well in the editor, there are no errors or warnings during the build. After assembly, the key variable behaves incorrectly.
I’m using a quest system to collect things, a little about the code. There is a structure that stores the ID of an item and the quantity of an item, the data enters the structure through the inventory component, in which I was able to find the problem area using debugging. It is in a function that checks whether the player has the required item and its quantity. So the quantity of an item is not displayed correctly (int variable).
What’s interesting is that if I take a quest and then take an item, I can’t assign it (the variable remains at value 0), if I take an item then take the quest, then everything works out (the variable takes on the value 1).
I repeat, there are no problems in the editor, everything works correctly, the problem arises after packaging the project, I will be glad for any help, thank you all.
Hello,
There is NO way anyone can effectively help you without any documentation of your project (photos of blueprints, a video, etc.).
I say this all the time, but PHOTOS AT THE MINIMUM.
Anyway, with that out the way, the best thing I, personally, can suggest is adding PRINT STRINGS at every major junction to make sure that code is firing. In your packaged game, keep track of what the print strings are telling you to squash the bug.
I listened to your advice and checked my entire quest system, found a problematic section of the code, began to check it in detail, and in the end, after a day of checking, I found out that I had a different case of letters in the name and in the data tables and at the output of the function. When the project is assembled, the engine sets some variables (string) to capital letters at the beginning, this was the problem, the function gave an error because the id was different.
If it helps anyone, colleagues, be more careful with the name of string variables, I put all string variables in capital letters, and everything worked, thanks Leomerya12.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.