Hi community, I made a game that is running fine within Godot IDE. when exporting, it is not working. I followed the advice in the forum and ran a cmd debugger. The image is attached.
Thanks for quick response. I do not know how to print from an export file. If you can guide me it would be helpful. Also, a key question in my mind is if the item is working fine when in godot ide, what could lead to it not working on export pack.
Place this line before line 133 and export, in the console before these warnings the desired value should be printed: print("target: {target}, item: {item}".format({"target": target, "item": item})
That helps me move a step but still does not resolve it as it is printing the random code name generated during runtime. Is there a way I can get to print the item_name property( that is a string) of the item?
The point is right here, what you have missed is not the target, but the item is empty, your function is called with an empty parameter.
Now you need to check where you called this function to figure out where the parameter being sent is null, you can check it manually, or you can change the function like this every time you call:
if not item:
printerr(get_stack())
else:
create_linked_target(item)
This structure determines the fault location stack
I really appreciate your help. I am nowhere close to figuring out the problem so far. A new thing that I have discovered is that the item itself is generating a target even before it is assigned which is strange.
The data in the console is for the highlighted print statement.
while printing the item it is showing-
SearchItem:<Button#48704259685>
target: Target:<Area2D#50633639580>, item: SearchItem:<Button#48704259685>
whereas i was expecting only button.
Could it be because of the way search item class is defined?
extends Button
class_name Search_Item
#declare property variables
var item_usage:String=“”
var item_name:String=“”
var linked_target:Target_Item=null
var has_target:bool=false
I’m really confused, I don’t know the structure of your project, and it’s so complicated that I dare not guess, but;
I guess as you said there is a problem here, maybe it can be fixed with @onready or @export, I am not really familiar with these two, I just know some of their uses, maybe it would be better to check the documentation about them…