LucasArts style status bar

Started by Erica McLane, Mon 26/05/2003 13:43:21

Previous topic - Next topic

Erica McLane

Easier way to create the Lucas Arts status line by TK
-----------------------------------------------
Bad link removed by Scummbuddy
----------------------------------------------
Upload of code
-------------------------------------------
I posted this here beacuse those new AGSers who come to ask how to get the LEC statusline to work. The LEC GUI that comes with AGS uses scritp like this:

if (GetLocationType(mouse.x,mouse.y)>0) { // or whatever like that
GetLocationName(mouse.x,mouse.y);
//someting
SetLabelText(0,0,"Walk to...");
}

etc.

But I found an easier way. I dont know how many people have thought of this, and if this is allready posted somewhere in the forum, but anyway:

All the GetThisAt and GetThatName can be replaced with @OVERHOTSPOT@, right?

So, make a new GUI, put it where you want the statusline to be, create a label on it and set the size and position. (In this script the statusline is GUI 0 and the label is object 0.)

Then, put into the global script repeadetly execute function: (add teh stuff beween the line starting "function" and the last })

function repeadetly_execute() {
// the comment line here
if (GetCursorMode()==0) SetLabelText(0,0,"Walk to @OVERHOTSPOT@")
if (GetCursorMode()==1) SetLabelText(0,0,"Look at @OVERHOTSPOT@")
if (GetCursorMode()==2) SetLabelText(0,0,"Interact with @OVERHOTSPOT@")
if (GetCursorMode()==3) SetLabelText(0,0,"Talk to @OVERHOTSPOT@")
if (GetCursorMode()==4) {
string usinginv;
string useinvtxt;
StrCopy (useinvtxt, "Use ");
GetInvName(character[GetPlayerCharacter()].activeinv,usinginv);
StrCat (useinvtxt,usinginv);
StrCat (useinvtxt," with ");
StrCat (useinvtxt,"@OVERHOTSPOT@");
SetLabelText(0,0,useinvtxt);
}
}

Quote:
StrCat (useinvtxt,usinginv);
StrCat (useinvtxt," with ");
StrCat (useinvtxt,"@OVERHOTSPOT@");



Is because when there is no hotspot or char under the mouse, it says "Use XXX with ". This can ofcourse be changed very easy:

StrCat (useinvtxt,usinginv);
StrCat (useinvtxt," with @OVERHOTSPOT@");

Would make it say just the "Use XXX".

Sorry if I cause any trouble to ya all nice moderators, but this just popped into my head and I couldn't hold it all just by myself.

THIS CODE CAN BE USED BY ANYBODY WHO NEEDS, in case it works.

BlackMan890

where in the global script am i suposed to put this?
(very n00b question) and what do you mean by:

Quote from: Erica McLane on Mon 26/05/2003 13:43:21
(add teh stuff beween the line starting "function" and the last })
???
Jonatan Nilsson
860 Iceland

Please go to www.simnet.is/elinnils52 and download my non ags/adventure game :)

Ishmael

Find the line

function repeadetly_execute() {


In your Global Script, then add

  if (GetCursorMode()==0) SetLabelText(0,0,"Walk to @OVERHOTSPOT@")
  if (GetCursorMode()==1) SetLabelText(0,0,"Look at @OVERHOTSPOT@")
  if (GetCursorMode()==2) SetLabelText(0,0,"Interact with @OVERHOTSPOT@")
  if (GetCursorMode()==3) SetLabelText(0,0,"Talk to @OVERHOTSPOT@")
  if (GetCursorMode()==4) {
    string usinginv;
    string useinvtxt;
    StrCopy (useinvtxt, "Use ");
    GetInvName(character[GetPlayerCharacter()].activeinv,usinginv);
    StrCat (useinvtxt,usinginv);
    StrCat (useinvtxt," with ");
    StrCat (useinvtxt,"@OVERHOTSPOT@");
    SetLabelText(0,0,useinvtxt);
  }


just before the last } in that function, in case your rep_ex is empty, it'll be just below the line starting with // inside the repeadetly_execute.

And, for a side not, if you haven't read the scripting tutorials yet, read them now. In the Manual -> Text Scripting IIRC.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

BlackMan890

Thanks but there is a catch cause there comes an error:

There was an error compiling your script, the proplem was in 'main script';

ERROR (line 13): Expected ';'

do you want to....

This is in my script:

13  if (GetCursorMode()==0) SetLabelText(0,0,"Walk to @OVERHOTSPOT@")
14  if (GetCursorMode()==1) SetLabelText(0,0,"Look at @OVERHOTSPOT@")
15  if (GetCursorMode()==2) SetLabelText(0,0,"Interact with @OVERHOTSPOT@")
16  if (GetCursorMode()==3) SetLabelText(0,0,"Talk to @OVERHOTSPOT@")
17  if (GetCursorMode()==4) {
18    string usinginv;
19    string useinvtxt;
20    StrCopy (useinvtxt, "Use ");
21    GetInvName(character[GetPlayerCharacter()].activeinv,usinginv);
22    StrCat (useinvtxt,usinginv);
23    StrCat (useinvtxt," with ");
24    StrCat (useinvtxt,"@OVERHOTSPOT@");
25    SetLabelText(0,0,useinvtxt);
26  }

Why does this happens?
Jonatan Nilsson
860 Iceland

Please go to www.simnet.is/elinnils52 and download my non ags/adventure game :)

Proskrito

#4
here is another similar way:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=15585.0#msg191420

EDIT: sorry for not reading everything, just add ';' at the end of lines 13-16

Ishmael

#5
I'm sure they were there originally, they've just gone missing at some point. Add the ;'s and it should work.

(This is one of those days I wish I would moderate a tech board...)
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Edwin Xie

I get something saying:

---------------------------
Adventure Game Studio
---------------------------
An error has occured. Please contact the game author for support, as this
is likely to be a scripting error and not a bug in AGS.
(ACI version 2.61.747)

(Global script line 23)
Error: GetInvName: invalid inventory item specified

---------------------------
OK   
---------------------------
Moving at superhigh speed getting to the planet called Earth. But it is boxed in white......thing.....

Ishmael

You have

GetInvName(character[GetPlayerCharacter()].activeinv,usinginv);

on line 23? It should be ok, but if you get an error, you'r Player character's activeinv variable is probably set to an invalid number... somehow...
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Edwin Xie

I tried before and it worked perfectly. Name some reasons that could be possible.
Moving at superhigh speed getting to the planet called Earth. But it is boxed in white......thing.....

Ishmael

That if condition is supposed to be let run only when an inventory item hsa been selected. You sure your script does not set the character's activeinv number to something invalid at some point, or set the inv cursor mode before an inventory item is selected?
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Edwin Xie

if I replace the badcode with the exact same thing it works
Moving at superhigh speed getting to the planet called Earth. But it is boxed in white......thing.....

Phemar


Just thought I'd let someone know. This script:
  if (GetCursorMode()==0) {
    SetLabelText (MAINGUI, 13, "WALK TO @OVERHOTSPOT@");
    }
  else if (GetCursorMode()==1) {
    SetLabelText (MAINGUI, 13, "LOOK AT @OVERHOTSPOT@");
    }
  else if (GetCursorMode()==2) {
    SetLabelText (MAINGUI, 13, "USE @OVERHOTSPOT@");
    }
  else if (GetCursorMode()==3) {
    SetLabelText (MAINGUI, 13, "TALK TO @OVERHOTSPOT@");
    }
  else if (GetCursorMode()==4) {
    GetInvName (player.activeinv, inventory);
    StrFormat (buffer, "Use %s with @OVERHOTSPOT@", inventory);
    SetLabelText (MAINGUI, 13, buffer);
    }
  else if (GetCursorMode()==5) {
    SetLabelText (MAINGUI, 13, "PICK UP @OVERHOTSPOT@");
    }
  else if (GetCursorMode()==6) {
    SetLabelText (MAINGUI, 13, "CLICK");
    }
  else if (GetCursorMode()==7) {
    SetLabelText (MAINGUI, 13, "WAIT...");
    }
  else if (GetCursorMode()==8) {
    SetLabelText (MAINGUI, 13, "OPEN @OVERHOTSPOT@");
    }

It works fine, except the hotspot isn't shown while the click is being processed. Instead you should use this script:
  string bunky;string texty; int cursy;
  StrCopy (texty, "");
  cursy=GetCursorMode();
  if (cursy==0){
    StrCat(texty,"Walk to ");}
  else if (cursy==1) {
    StrCat (texty,"Look at ");}
  else if (cursy==2) {
    StrCat(texty,"Use ");}
  else if (cursy==3) {
    StrCat(texty,"Talk to ");}
  else if (cursy==4) {
    StrCat(texty,"Use ");
    GetInvName (player.activeinv, bunky);
    StrCat(texty,bunky);
    StrCat(texty," with ");}
  else if (cursy==5) {
    StrCat(texty, "Pick up ");}
  else if (cursy==8) {
    StrCat(texty, "Open ");}
  GetLocationName(mouse.x,mouse.y,bunky);
  StrCat(texty,bunky);
  SetLabelText (MAINGUI,13,texty);

This updates the hotspot even while the mouse click is being processed.

I hope I'm not being dumb or nothing...

Edwin Xie

#12
Thanks....but can you replace cursy, texty and bunky with something else?
Moving at superhigh speed getting to the planet called Earth. But it is boxed in white......thing.....

Edwin Xie

#13

Strange..after I put Zoraphus's Script in it shows this error:

---------------------------
Compile Error
---------------------------
There was an error compiling your script. The problem was in 'Main script':



Error (line 30): Nested functions not supported (you may have forgotten a closing brace)



Do you want to fix the script now? (Your game has not been saved).
---------------------------
YesÃ,  Ã, NoÃ,  Ã, 
---------------------------

Nevermind, Zoraphus forgot the closing brace
Moving at superhigh speed getting to the planet called Earth. But it is boxed in white......thing.....

Phemar


Ah, silly me and those braces ... And recently I just had mine taken off.

Of course you can change those cursy thingamabobs as long as you change every occurence of it in your script.
I'm just weird when it comes to naming my data types...

BTW I use a selection of cursors in my game, so if you want to use this in a sierra-type game, you should take away the
if (cursy==5) {
  blablabla}
if (cursy==8) {
  blablabla}


- Cheers

monkey0506

QuoteIt works fine, except the hotspot isn't shown while the click is being processed.

Zoraphus has a good point. Also, for definition of the "right-click mode" as in Proskrito's templates where you can add, for example, ">g" to the end of a hotspot/char/inv item/object name to run the script for give on a right click, you have to use something where you can remove the ">g" extension. So, I would definitely say it's better to use GetLocationName...

Ishmael

I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

six_plus_one

Okay, question.

GetInvName(character[GetPlayerCharacter()].activeinv,usinginv);

...requires that you have set an active inventory item, as evidenced by the error message ("Error: GetInvName: invalid inventory item specified") that you get when no active iventory item is set and you switch to the cursor mode corresponding to that line, right?

Well, to avoid crashing my game, I have set up the inventory part of my script as follows:

function show_inventory_window () {
GUIOn (INVENTORY);
SetActiveInventory(1);
SetCursorMode (MODE_USE);
SetMouseCursor (6);
SetInvDimensions(22,22);
}

...But now I need to make sure that one cannot open the inventory window before they have an inventory item in order to avoid the error message:

"Error: SetActiveInventory: player doesn't have any of that inventory."

My question is: What would the script be to disable the inventory button in the GUI when the player has no inventory items? Is there a non-scripting setting to do this? I remember the default game doing this. Is it bad form to start a game without the player having at least one inventory item?

Ishmael

Set to the Inventory cursor mode AFTER you have selected an inventory item. Set to the Interact mode when the inventory window is opened.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

six_plus_one

I'm sorry, but I'm still very much a newbie and I'm still not firm on this.

I went and set the cursor mode to interact on the opening of the inv window, but now where would I put the code to set the cursor to inventory mode and what would that code be?

I may actually be barking up the wrong tree here. All I REALLY want to do is have a working LucasArtsy status bar without the game error: "Error: GetInvName: invalid inventory item specified" coming up when I set to cursor mode 4 (or 8 in my case).

I may not want to give my player an inventory item to begin with, so my SetActiveInventory(1); "workaround" won't work for me, (and besides, it's really very sloppy), and I can't seem to otherwise guarantee that someone won't change over to that cursor mode before selecting an active inventory item (and thus crashing the game).

I want to apologize for my inexperience with all of this scripting stuff, but what can I do here? Perhaps I should NOT be using cursor mode 8 the way I am. I wanted to use cursor mode 8 only to eat things or put on clothing, y'know "personal uses", with just clicking the use button (mode 8 with "if cursor mode is set to 8" conditional on "other mouse click" interactions), then clicking the inv item in question. I'd use Cursor mode 4, but it doesn't seem to work. When I set the GUI button to set cursor mode to 4 it seems to not respond. Mode 8 seems to work perfectly except with the line:

GetInvName(character[GetPlayerCharacter()].activeinv,usinginv);

and so I don't really know how to proceed from here, and it looks like I may have to abandon the use of the status bar.Ã,  :'(

Sorry for such a lengthy post, but I'm climbing up the walls here, and I would greatly appreciate any help or advice anyone can offer me. Thanks bunches. :)

Ishmael

#20
You'll need to either use the default interaction modes, in which clicking the Interact mode on an inventory item (through ProcessClick(mouse.x,mouse,y,GetCursorMode())) selects the Inventory mode and sets the active item (atleast it used to... the Interact mode does not actually interact the item)

Or, you can do it by scripting, adding into on_mouse_click in the global script: (AGS 2.62 scripting, I'm not that familiar with the newer one yet, but this should still work)

Ã,  if (button == LEFTINV) {
Ã,  Ã,  SetActiveInventory(GetInvAt(mouse.x,mouse.y));
Ã,  Ã,  SetCursorMode(4);
Ã,  }

(I hope I remembered the function names right...)

To actually Interact the items (run the Interact script in the inv item interactions) You'll need to do

Ã,  if ((button == LEFTINV) && (GetCurosrMode() == 8)) {
Ã,  Ã,  InteractInventory(GetInvAt(mouse.x,mouse.y));
Ã,  }
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

six_plus_one

Alright, so I added those codes in their respective sections, but I'm getting and 'Error: undefined token: InteractInventory' message when I try to run the game. I think the script editor is saying that InteractInventory isn't a correct function name, (no auto-complete window comes up when I type it in). Do you know what the function name is supposed to be or if the problem is a result of something else being off in my script or something?

Sorry again to be a bother. Thank you very much, Ishmael, for taking time to help me with this problem. Hopefully I am getting close to a successful resolution here.Ã,  :)

Ishmael

#22
Ah, forgive me, I think I confused it with one of my "alias" tests, the function is RunInventoryInteraction(int inv, int curmode); in the old scripting, if I remember it right this time...

Ã,  if ((button == LEFTINV) && (GetCurosrMode() == 8)) {
Ã,  Ã,  RunInventoryInteraction(GetInvAt(mouse.x,mouse.y), MODE_USE);
Ã,  }
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

six_plus_one

Gawd, I MUST be a lost cause. Now it's telling me "Error: GetInvName: invalid inventory item specified" for the line:

GetInvName(character[GetPlayerCharacter()].activeinv,usinginv);

I noticed that when I disable (//) the line that tells a click on the INV GUI button in question to SetCursorMode to(8); that the game does not crash, nor does it register the button click.

So I suppose the problem occurs when the cursor mode gets set to 8, and from there it runs the GetInvName line above. I'm thinking that this must mean that no inventory item is being selected because of the fact that the (GetInvAt(mouse.x,mouse.y) doesn't set any inventory item as that command happens when the mouse is over a GUI button not an inventory item.

But I'm thinking: I don't want to have a click on GUI button set an active inventory item, so maybe the key is to put a conditional line in the script for the "if (GetCursorMode()==8) {" part:

(i.e.: something like "if NO active inventory is set then do nothing, if active inventory IS set then proceed as planned").

Perhaps this would remedy both the crashing and the unresponsive button problem. (???) Maybe someone can help me figure out some prospective code for this. :)

Ishmael

You could try this:

  if ((button == LEFTINV) && (GetCurosrMode() == 8)) {
    SetActiveInventory(GetInvAt(mouse.x,mouse.y));
    RunInventoryInteraction(GetInvAt(mouse.x,mouse.y), MODE_USE);
  }

if it'd rid you from the error...
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

six_plus_one

Well... due to my UTTER inneptitude with coding, I've decided to go ahead and just simplify the status bar. Now a click on the "Use" GUI button VERY simply does:

SetActiveInventory(-1);
SetCursorMode(8);

And the function repetedly_execute() portion of my script goes simply:

Ã,  if (GetCursorMode()==0) SetLabelText(0,0,"Walk to @OVERHOTSPOT@");
Ã,  if (GetCursorMode()==1) SetLabelText(0,0,"Look at @OVERHOTSPOT@");
Ã,  if (GetCursorMode()==2) SetLabelText(0,0,"Use @OVERHOTSPOT@");
Ã,  if (GetCursorMode()==3) SetLabelText(0,0,"Talk to @OVERHOTSPOT@");
Ã,  if (GetCursorMode()==8) SetLabelText(0,0,"Eat or wear @OVERHOTSPOT@");

This, while not perfect, seems to have the buttons and status bar working fine without crashing, except that it does not display, for example when in cursor mode 2, "Use (item A) on (item B)" when an active inventory item is set.

I know this IS what Ishmael was probably trying to give me help with (and by the way, thanks so much for your help, Ish, and sorry that I wasn't able to put your code to better use), but does anyone know of a very simple way to have the status bar display "Use (active inventory item) on @OVERHOTSPOT@" when and only when there is an active inventory item?

If it winds up likewise waaay too complicated for me to implement then I'm fine without it, but it would make the status bar act just the way I wanted.

Scorpiorus

Quote from: six_plus_one...but does anyone know of a very simple way to have the status bar display "Use (active inventory item) on @OVERHOTSPOT@" when and only when there is an active inventory item?
Well, when the player has an active inventory item the cursor mode number 4 becomes available (MODE_USEINV). You can use it to display "Use X on Y" sort of thing:

repeatedly_execute:

if (GetCursorMode()==0) SetLabelText(0,0,"Walk to @OVERHOTSPOT@");
if (GetCursorMode()==1) SetLabelText(0,0,"Look at @OVERHOTSPOT@");
if (GetCursorMode()==2) SetLabelText(0,0,"Use @OVERHOTSPOT@");
if (GetCursorMode()==3) SetLabelText(0,0,"Talk to @OVERHOTSPOT@");
if (GetCursorMode()==8) SetLabelText(0,0,"Eat or wear @OVERHOTSPOT@");

//------------------
// Use X on Y:
//------------------
if (GetCursorMode()==MODE_USEINV) {
Ã,  Ã, 
Ã,  Ã,  string text;
Ã,  Ã, 
Ã,  Ã,  GetInvName(character[GetPlayerCharacter()].activeinv, text); // get name of the active inventory item
Ã,  Ã, 
Ã,  Ã,  StrFormat(text, "Use %s on @OVERHOTSPOT@", text); // form a text to display
Ã,  Ã, 
Ã,  Ã,  SetLabelText(0,0,text); // display it on the label
}

See if it works for you.

six_plus_one

Ohmygawd! Yes!! :D

It works! It actually, really works!! Thank you so much Ish and Scorp!! :)

I'll make sure to take a good, hard look at these lines of code as well, I'm sure they will be instructive in my understanding of this language... Yipee! It works!!Ã,  ;D

:)Ã,  THANK YOU SOOOOO MUCH AGAIN GUYS!!!Ã,  :)Ã,  Ã, ...*freaks and dies of elation*

Ishmael

I reckon I should reformat that code to the new scripting and maybe put in some commentary on what does which part actually do :P
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

JQ

it says that GetCursorMode is an undefined symbol, why does that happen?

Ashen

Because this code is 2 years old, and GetCursorMode is now obsolete. (AGS now uses mouse.Mode instead.)

There's a newer version of this floating around somewhere, I think SSH's Description Module can handle it, or you could try updating this version for yourself. Look up the commands that give 'undefined token' errors in the manual to find the current equivalent.
I know what you're thinking ... Don't think that.


JQ

but the download links are bad, where can i dowload that module?

Dualnames

If you were more careful you would notice that this thread is way old. And there is a thread about Lucas Arts GUI. You'll find plenty of modules there..
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)


Dualnames

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=24112.0

Here. Try searching the forum as well for more. And check the technical forum for old templates. Most of the download links work..
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Ashen

The templates in that thread aren't without their compatability problems, either, but if you make sure to get the newest you should be OK. However, that covers the whole LucasArts-style GUI, not just the status bar bit, so you may need to do a bit of fiddling to trim it down to what you need.

SSH's module download seems to work OK now. I tested it before I posted, and it was fine, I tested it when QaP said it was bad - and it'd broken sometime in that 24-hour period. I just tested it again and it's working. So QaP, if you're still around and interested - get in there quick. It has the advantage over the template of ONLY doing the statusline bit. Of course, if you want the whole LEC GUI, go for the template.
I know what you're thinking ... Don't think that.

SSH

The module is on the same server as the forums, so dunno why it should have broken. Blame hajo! Or AGA.
12

JQ

I downloaded the description module, but i cant make it work, so i send a pm message to ssh yesterday and i-m waiting for response. I just posted this to let you know im still interested in the module.

Tigga

Hey.... i want to have a lucas arts status bar too
i tried this :)

---
if (GetCursorMode()==Walk to) SetLabelText(1,2,"Go to @OVERHOTSPOT@")
  if (GetCursorMode()==1) SetLabelText(0,0,"Look at @OVERHOTSPOT@")
  if (GetCursorMode()==2) SetLabelText(0,0,"Interact with @OVERHOTSPOT@")
  if (GetCursorMode()==3) SetLabelText(0,0,"Talk to @OVERHOTSPOT@")
  if (GetCursorMode()==4) {
    string usinginv;
    string useinvtxt;
    StrCopy (useinvtxt, "Use ");
    GetInvName(character[GetPlayerCharacter()].activeinv,usinginv);
    StrCat (useinvtxt,usinginv);
    StrCat (useinvtxt," with ");
    StrCat (useinvtxt,"@OVERHOTSPOT@");
    SetLabelText(0,0,useinvtxt);
  }

shown in this forum but it not work
error message at compiling

output window :

GlobalScript.asc(60): Error (line 60): undefined symbol 'GetCursorMode'

i cant help my self

anyway...thx

Lt. Smash

this is oldstyle code. And I assume you are using one of the latest 3.xx AGS versions. So your code needs to be translated.
Quote
if (mouse.Mode == eModeWalkto) lblName.Text = "Go to @OVERHOTSPOT@";   //here you must access the label through its name property, set in the gui editor.
  if (mouse.Mode == 1) lblDifferentLabel.Text = "Look at @OVERHOTSPOT@";
  if (mouse.Mode == 2) lblDifferentLabel.Text = "Interact with @OVERHOTSPOT@";
  if (mouse.Mode == 3) lblDifferentLabel.Text = "Talk to @OVERHOTSPOT@";
  if (mouse.Mode == 4) {
    lblDifferentLabel.Text = String.Format("Use %s with @OVERHOTSPOT@", player.ActiveInventory.Name);
  }

Tigga

#41
heythanks Lt.Smash

but i still got problems...

the "lblName.Text" i change to LabelText1.Text and the error output jumps to line 61

1. i have to create a lable for each mouse mode?
    i thought i only need one lable where the message "walk to..." or "talkt to..." just switch, or change
    why i have to creat more labels?

...

i replaced all lbl.differentlabel.text withe my LabelText1.text

now it works...mmm why there stand Differentlabel. did i something wrong, and get problems later?
thanks

btw, how can i change the font-size in code for the game?

Lt. Smash

yeah true, doesn't make sense to use two labels but in the code you gave me there were 2 labels in use.

I think its not possible to change font size via code. You have to import a different font. Or import a ttf and set its font size at import.

SMF spam blocked by CleanTalk