Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: on Mon 23/08/2004 00:27:03

Title: Feature request for more name functions
Post by: on Mon 23/08/2004 00:27:03
I would like to see more name functions added to the game like the ones available for the names of inventory items. Functions I would like added:

GetHotspotName(int hsnum, string buffer);
  store the name of hotspot number hsnum in buffer

GetObjectName (int obj, string buffer);
  store the name of object number obj in buffer

GetCharacterName (CHARID, string buffer);
  store the name of the specified character in buffer using either the characters number or script name


SetHotspotName(int hsnum, string name);
  sets the name of hotspot number hsnum to name

SetObjectName (int obj, string name);
  sets the name of object number obj to name

SetCharacterName (CHARID, string name);
  sets the name of the specified character to name using either the characters number or script name





Title: Re: Feature request for more name functions
Post by: Mr Jake on Mon 23/08/2004 08:22:58
or just use

GetLocationName (int x, int y, string buffer)

Title: Re: Feature request for more name functions
Post by: Bernie on Mon 23/08/2004 09:50:40
Also, if you use GetLocationType(int x, int y), you can detect if the mouse is over an hotspot, a character or an object. If you use it combined with GetLocationName, you pretty much get the result you want:

if (GetLocationType(mouse.x,mouse.y) == 1) {GetLocationName(mouse.x,mouse.y, hotspotname);}
if (GetLocationType(mouse.x,mouse.y) == 2) {GetLocationName(mouse.x,mouse.y, charactername);}
if (GetLocationType(mouse.x,mouse.y) == 3) {GetLocationName(mouse.x,mouse.y, objectname);}
Title: Re: Feature request for more name functions
Post by: Pumaman on Mon 23/08/2004 20:46:37
Get/SetObjectName is already on my to-do list.

Get/SetHotspotName would be a possibility.

Get/SetCharacterName is unnecessary, since the variable   characters[CHARID].name   is available instead
Title: Re: Feature request for more name functions
Post by: Mr Jake on Mon 23/08/2004 22:26:02
ah yes, SetHotspot/ObjectName would be useful.
Title: Re: Feature request for more name functions
Post by: on Tue 24/08/2004 18:56:13
Quote from: Pumaman on Mon 23/08/2004 20:46:37
Get/SetObjectName is already on my to-do list.

Get/SetHotspotName would be a possibility.

Get/SetCharacterName is unnecessary, since the variable   characters[CHARID].name   is available instead

what about hotspot[num].name and object[num].name? Would using those in code work?
Title: Re: Feature request for more name functions
Post by: Mr Jake on Tue 24/08/2004 18:58:59
no
but you could just use GetLocationName (x, y, buffer)

(the hotspotlocation will never move)
Title: Re: Feature request for more name functions
Post by: on Mon 30/08/2004 09:34:04
Well, the main reason I'm curious about getting the names of objects and hot spots and the like is because I am hoping to make a text parser game.