Forum rules - please read before posting, it can save you a lot of time.
Is It possible too use a point in the game, for example, when i pick up a key i get 5 points, and so on.
// points are global to all scripts. if not set yet, set them to zero.if(points==null) points=0;on "Take"{ // walk to the key GoToObject(); actor.Talk("Cool. It's a golden key! I get 5 points!"); points = points + 5;}
Now i want to make an window in the inventory bar to display the score. My question is can i do that in the inventory.def or do i have to make a new file for it, i already tried several things, but the game crashed every time.
WINDOW{ ... STATIC { NAME = "score" X = 100 Y = 20 }}
var InvWin = Game.GetInventoryWindow();var ScoreWin = InvWin.GetWidget("score");ScoreWin.Text = points; // points is your global variable