[SOLVED] (AGS 4.0) Game score variable not found?

Started by brushfe, Mon 16/12/2024 13:55:39

Previous topic - Next topic

brushfe

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 
Code: ags
 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!

Crimson Wizard

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.

Rik_Vargard

Also, you can create your own little GUI label and put the score (a global variable) in there.

brushfe

Ah sorry I missed that! I'll add a new variable for it. Thanks very much!

SMF spam blocked by CleanTalk