Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: brushfe on Mon 16/12/2024 13:55:39

Title: [SOLVED] (AGS 4.0) Game score variable not found?
Post by: brushfe on Mon 16/12/2024 13:55:39
Hello!

I'm starting a new project in the 4.0 engine, but I can't figure out how to update the score variable in the status bar.

In 3.6, the line  lblScore.Text = String.Format("Score: %d", game.score); works well,

But in 4.0 it returns the error "Expected a component of 'GameState', found 'score' instead"

Sorry if I've missed something obvious! Thank you for any help!
Title: Re: (AGS 4.0) Game score variable not found?
Post by: Crimson Wizard on Mon 16/12/2024 14:26:33
The Score counting was removed from AGS 4.
This is mentioned in the Changes here: https://www.adventuregamestudio.co.uk/forums/ags-engine-editor-releases/ags-4-0-early-alpha-for-public-test/

Quote- Removed built-in support for Game Score, including related game settings and GiveScore script command. Users are advised to script their own score counter if they need one.
Title: Re: (AGS 4.0) Game score variable not found?
Post by: Rik_Vargard on Mon 16/12/2024 14:30:45
Also, you can create your own little GUI label and put the score (a global variable) in there.
Title: Re: (AGS 4.0) Game score variable not found?
Post by: brushfe on Mon 16/12/2024 14:31:27
Ah sorry I missed that! I'll add a new variable for it. Thanks very much!