Question about getting info from enumerated CursorMode

Started by mkennedy, Mon 07/08/2006 18:39:38

Previous topic - Next topic

mkennedy

Let's say I want to get the name of my cursor modes. If I type in something like "CursorMode 1"  will it return the value of the first in the enumerated type "EModeWalkto" or I am misunderstanding how enumerated types work?

Ashen

eModeWalkto is the first value in the CursorMode enumerated type, not the other way round. The enum is generated when the game starts, based on the names you've given the modes in the editor (without spaces, and with the first letter capitalised - Walkto, Useinv, Lookat, etc) and prefixed with eMode. This means you can do someting like mouse.Mode = eModeWalkto; without having to remember the actual number of the mode you want to change to. There's no way to get the mode 'name' ("Walk to") from the number. If you're interested in this for a statusline display ("Walk to door", "Look at bookcase", etc) something like this thread is basically how you'll have to go about it, or you could look up one of the LucasArts templates to see how they handle it (I don't think it's much different, though).
I know what you're thinking ... Don't think that.

monkey0506

Typing in "eModeWalkto" will return the value of the enumerated value "eModeWalkto". The enumerated type is CursorMode.

If you can be a bit more specific what you're trying to accomplish, we could offer you more assistance as well.

Oh, and FYI, AGS is case-sensitive so you have to type "eModeWalkto" not "EModeWalkto" or "eModeWalkTo" or "EModeWalkTo" or anything like that. Capitalization is very important.

[EDIT:]

Beaten out by the Ashen.

mkennedy

Well the reason I am interested in getting the names of the cursor modes is for making a text parser template. The parser would read what the player typed in, and if the text contains the name of one of the mouse modes then it will run an intercation based on that mouse mode.

SMF spam blocked by CleanTalk