Godot Version
4.2
Question
Uhmm so like the … uhm tmnhe qeustion . . uh mmm
var valid : bool
var cheated : bool
var score : int :
set(value):
score_checker(value)
score = value
var new_score : int
func _on_button_pressed():
new_score += 1
valid = true
score = new_score
print(score)
func score_checker(value):
if not valid:
cheated = true
print("you cheated")
else:
valid = false
print("you didnt cheat")
This is a simplified cheat detection I’ve come up with using set(). When pressing the button, score increments +1. If the score variable were altered in cheat engine, I would presume that it’d run through set() since as far as I understand it, that is what it is designed for. Any time the variable is changed at all, it detects this as a listener without the need for checking every frame.
When using cheat engine to change this variable, it does not run through score_checker() at all. The score updates to the new value, and when the button is press it updates accordingly.
Is this an issue, or is set() only meant for internal detection of variable changes? Is there a better solution that doesn’t require processing? Thank you! thank you all so much! I love this engine, it’s my favorite. I love godot