Suggestion for next AGS version

Started by stryker, Fri 12/09/2003 00:27:30

Previous topic - Next topic

stryker

I'm working on the next version of Opensource Discworld Interface System (version 1.1 aviable on announcements forum). There are some things that can't be done because of the lack of some AGS commands. Of course a lot of the following features could be useless for the others, so just check which ones can be useful for everybody and let me know if you're going to add them on the next ags version.

- SetGUIObjectSize (with the recent SetGUISize I added the resizabile inventory window like the one in DW, but without the ObjectSize command is useless, because inventory itself remains the same size)
- GetInvItemPic (there is a Set, but not a Get. This one is to make the active inventory pic transparent and get the original sprite to be used as cursor, like in DW. It gives the feel you really take the object from the inv and carry it on the cursor)

The following ones are not commands, so I don't think their implementation will worth the work, but i'm posting them anyway (who knows?):
- multiple inventory support (a single player can have many inventories with different obects for each one. This would be cool i.e. if a player has a trunk or something where he can keep all the things he doesn't want to carry around)
- foreground GUI click event (treat the border lines (and maybe 2 or 3 pixels around them to make the click of a single-pixel line not so annoying) like a GUI object, so it's triggered by the GetGUIObjectAt command)

that's all, I think.

The biggest problem (but I don't thik this will never be sloved) it's to make the object names label appearing upon every obect, and not mouse following or blocked in a specified location of the screen. But I can't think a way to emulate this on AGS engine (if anyone has suggestion, just post!)

thanks

Download Discworld Template ODIS ver1.2
(right-click and "save as")

stryker

#1
I just find a solution for the "big problem" above. With "on mouse over" event I set two variables (let's say labelx and labely), I export them to global script and use them to set the label position for every hotspot.
It'a a bit annoying adding a script with "labelx = x and labely = y" for every hotspot/object/character in every room, but I think it's the only way.

The problem is: there is no "on mouse over" event for characters and objects, without it it's impossible to use this method. Can it be added for chacters and objects too?

thanks


edit: in the first post I forgot a thing that should be useful for many of us: display dialog options as sprites (to do dialog system like in DW and S&M).

Download Discworld Template ODIS ver1.2
(right-click and "save as")

SSH

I agree with the dialog options as sprites, but you can do your equivalent to "on mouse over"...

In repeatedly execute, use GetLocationName(mouse.x, mouse.y) to get the name of the thing the mouse is over. There is also GetLocationType and GetCharacterAt and GetObjectAt that you can use and have an if statement in the repeatedly_execute.

If you're using AGS 2.56 you could use properties of the object/hotspsots/characters to set the label locations, too.
12

stryker

Script all that stuff in repeatedly execute I think could slow down all the game. Imagine there are about 50 charatcters/objects, there will be in the repeatedly execute 50 of those strings:

if (GetLocationName(mouse.x,mouse.y)==objectname1) [
labelx = x;
labely = y;
]

if (GetLocationName(mouse.x,mouse.y)==objectname2) [
labelx = x;
labely = y;
]

etc... x 50 times

isn't it too much to handle it in the repeatedly execute?


I read about those proprietes thing, and if it can help me with the thing I'm realle interested, but I really can't get how the stuff works. Is there some thread or sepcific page in the help file where I can get info about it? (the help page explaining the command is not very clear...)

Download Discworld Template ODIS ver1.2
(right-click and "save as")

SSH

So, for example:

Character properties can be set by choosing a character and clicking oin the properties buttopn just under "interaction"

Object properties can be edited by going to a room's Object section and clicking on the Properties button next to "New Object"

And hotspot properties by a room's  Areas/Hotspot and clicking properties, next to "interaction".

The first time you do one, you will be told that no properties exists and you have to edit the schema. The right-click on the schema window, add a property and call the property "labelx" for example, set the type to number, etc. Create another one called "labely".

Then, in the repeatedly execute:
int loctype;
int itemno;
loctype = GetLocationType(mouse.x, mouse.y);
if (loctype == 1) {
  itemno = GetHotSpotAt(mouse.x, mouse.y);
   CreateTextOverlay(GetHotspotProperty(itemno, "labelx"), GetHotspotProperty(itemno, "labely"), <labelwidth>, <labelfont>, <labelcolor>, GetLocationName(mouse.x, mouse.y));
} else if (loctype == 2) {
  itemno = GetCharacterAt(mouse.x, mouse.y);
   CreateTextOverlay(GetCharacterProperty(itemno, "labelx"), GetCharacterProperty(itemno, "labely"), <labelwidth>, <labelfont>, <labelcolor>, GetLocationName(mouse.x, mouse.y));
} else if (loctype == 3) {
  itemno = GetObjectAt(mouse.x, mouse.y);
   CreateTextOverlay(GetObjectProperty(itemno, "labelx"), GetObjectProperty(itemno, "labely"), <labelwidth>, <labelfont>, <labelcolor>, GetLocationName(mouse.x, mouse.y));
}
12

Lazy Dragonrose

Quote from: stryker on Fri 12/09/2003 00:27:30
- multiple inventory support (a single player can have many inventories with different obects for each one. This would be cool i.e. if a player has a trunk or something where he can keep all the things he doesn't want to carry around)

There is a solution to this one.  Have a little transparent pixel friend follow the player character around, make it a character.  Whenever you click on whatever it is that has a seperate inventory (i.e a trunk or a spells inventory icon or whatever) have it first swich over to your pixel character that has this magical other inventory.  Or if it's just a trunk that has stuff in it, like in QFG II-V, just have the invisible pixel friend stay in the same room as the trunk.

HOWEVER, I think it would be great if there actually was more than one inventory per character.  That would make me a very happy person.

stryker

Thanks Dragonrose, I will try it out! That's a smart solution (BTW the multi-inv support should make it very much simple!)

SSH, the system works very well, thankyou very much (the overlay method is much more valid, because the GUI label system was giving me problems of refresh).
But there is still a problem. If there is a moving character (like the player one, who is "clickable" so it has its own label), the textoverlay must move around with him. So the script on "locationtype=2" must be depending on the character actual location. And here's the problem: how can I get x and y of the character position? There is no GetCharacterLocation or something like this, so I can't script the overlay position to be made depending on these variables.
Any clues?

Download Discworld Template ODIS ver1.2
(right-click and "save as")

SSH

I think there's a tutorial or a thread with more on what Dragonrose said about multi-inventories: try doing a forum search.

As for character location, look under the help file, Reference -> Text script global variables

character[CHARID].x , character[CHARID].y

maybe the labelx and y can be used as an offset instead of absoulte for characters, although I suppsoe that you might want the label to be on the left when on the right side of the screen and vice versa?
12

stryker

#8
It works perfectly, thanks again! Now the labelx and y proprietes work as universal coordinates for hotspots, and as "local" coordinates for characters and objects

But I think I didn't understand your last question...

Download Discworld Template ODIS ver1.2
(right-click and "save as")

Pumaman

I'm not sure about allowing multiple inventories per character. I think the best solution is simply to use a dummy character to store the chest's inventory, or whatever.

Quote- SetGUIObjectSize
- GetInvItemPic

These two are on my to-do list, I'll bump them up a bit.


SMF spam blocked by CleanTalk