Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Phemar on Tue 08/06/2004 05:39:45

Title: SetLabelText Strings... [Solved!]
Post by: Phemar on Tue 08/06/2004 05:39:45
I'm sorry for bugging you, but why won't this work, and how do I geta string to display properly?

string inventory;

function repeatedly_execute () {
  if (GetCursorMode()==4) {
    GetInvName (player.activeinv, inventory);
    SetLabelText (MAINGUI, 13, "Use %s with @OVERHOTSPOT@", inventory);
    }


All it says is invalid parameters for SetLabelText. All I want to do is get it to display the current inventory by the %s?
Title: Re: SetLabelText Strings...
Post by: LordHart on Tue 08/06/2004 07:21:40
You have too many variables there for SetLabelText... it should only have 3, while you have 4.

I did something similar to this with something I did a while ago, but I can't remember exactly how to do it.

I think I used the StrFormat function, but I'm not too sure.  :-\
Title: Re: SetLabelText Strings...
Post by: ®2-D2 on Tue 08/06/2004 09:16:54
StrFormat(buffer, "Use %s with @OVERHOTSPOT@", inventory);
SetLabelText(MAINGUI, 13, buffer);
Title: Re: SetLabelText Strings...
Post by: Phemar on Tue 08/06/2004 13:48:36

Hey thanks R2!

Mods you can delete this topic if you want...