+1 vote

When using the str() method in Android I will always get an error.
On Windows everything works fine.
Code:

   func update():
        Damage = str(global.stats.get_Damage_2(0))
        Protection = str(global.stats.get_Protection())
        max_Health = str(global.stats.get_Max_Health())
        Regeneration = str(global.stats.get_Regeneration())
        damage_Mutliplier = str(global.stats.get_Damage_Multiplier())
        base_Damage = str(global.stats.get_Base_Damage())
        attackspeed_Multiplier = str(global.stats.get_Attackspeed_Multiplier())
        Knockback = str(global.stats.get_Knockback())
        Level = str(global.stats.get_Level())
        var text = "\nLevel: " + Level + "\nDamage Multiplier: " + damage_Mutliplier + "\nBase Damage: " + base_Damage + "\nDamage: " + Damage + "\nAttackspeed Multiplier: " + attackspeed_Multiplier + "\nKnockback: " + Knockback + "\nProtection: " + Protection + "\nMaximum Health: " + max_Health + "\nRegeneration: " + Regeneration
        print(text)
        #Works: set_text("text")
        set_text(text)

Logcat:

I/godot   (18564): 25
I/godot   (18564): 0
I/godot   (18564): 100
I/godot   (18564): 0.01
I/godot   (18564): 1
I/godot   (18564): 25
I/godot   (18564): 1
I/godot   (18564): 50
I/godot   (18564): 1
I/godot   (18564): SCRIPT ERROR: update: Invalid operands 'String' and 'Nil' in operator '+'.
I/godot   (18564):    At: res://scripts/statsLabel.gdc:33.

I'm using the latest nightly(July 10, 2016 at 08:29) of the engine.

in Engine by (64 points)

2 Answers

0 votes
Best answer

Installing the newest export templates fixed it. Godot should really auto-update them.

by (64 points)
+1 vote

You should post your issue in the issue tracker on Github: https://github.com/godotengine/godot/issues

by (27,166 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.

Categories