How to build a Kyrandia Template?

Started by Zaidyer, Sun 08/08/2004 04:34:36

Previous topic - Next topic

Zaidyer

Hello, folks. I'm posting this to get some insight on how a Legend of Kyrandia type interface can be built into AGS.

If you haven't played any of those games, you might want to in order to get an understanding of just exactly how it works. It's actually pretty simple in practice, but it does some things AGS reportedly can't do without a little finagling.

Here's a description of what the Kyrandia interface can do. This doesn't cover the first game in the series because I've never played it, but nevertheless this can be used to figure out just how to pull off the tricks necessary to make it possible:

---A "one click for all" mouse interface. This means walking, talking, looking and interacting are all controlled with just one cursor. When holding an item it will interact with the clicked thing in only one way, like most other systems.
---Inventory consists of "slots". Usually ten, but you could have up to 30 in Hand of Fate. Any item can go in any slot. clicking a cursored item over a stored item will swap them if they cannot be combined. You can also drop items on any screen and pick them up again later, which is probably going the hardest thing to get working convincingly in AGS.
---LucasArts style talking, but without topic trees. It's just a one way conversation between the character(s) and the player. The more you click on a character, the more topics you cover until you eventually loop around to a previous one.
---Container items such as flasks and bowls can be filled with a lot of different liquids, but only one at a time. Occasionally they also combine with other items to get filled.
---Clicking on a GUI object labelled "options" will open up a menu consisting of the usual sub-menus such as save, load, gameplay options, and quit.
---The player's inventory objects can be "deleted" at any time by the game itself. This usually happened when you went to the next chapter, and sometimes a few "critical" items such as the Stick and the Alchemist Magnet would be spared.
---Each game featured different persistent GUI objects. Hand of Fate gave you a spellbook (which could be given extra pages by using Page items on it) and a Potion Cauldron, which you could toss items in. It kept a memory of what was put into it in order to determine whether you had actually mixed the correct ingredients for a specific Potion, which could be filled into a Flask and used that way. You could delete the contents of the Cauldron by clicking on a little chain, which would make it flush cutely like a toilet. Both the Spellbook and the Cauldron would only become available once you triggered a specific event.
---In continuation of persistent GUI objects, Malcolm's Revenge gave you a three-setting adjustable "mood-o-meter" which would affect conversation outcomes depending on the setting. Unlike Hand of Fate, this object was with you the entire time, however after a certain chapter it would irrepairably "break" and become worthless. (which was probably just a cop-out by the programmers so they didn't have to deal with it after that.) You also had your Conciences, who were really just characters that'd pop up and say something depending on what you just did, then vanish.


I'm pretty sure that's everything. So, any advice or insight into how this can all be accomplished in AGS?
~Zaidyer

Moox

Learn Scripting, you will need it to accomplish almost all of that, start off simple, dont bust in and try to make a template. Read the manual and tutorials first.

Rui 'Trovatore' Pires

It's funny, somehow this subject does keep cropping up... well, a Kyrandia interface without the object dropping wouldn't be the same, and object dropping is the one thing AGS can't manage. Yet.  ;) Maybe we should pester CJ for a CreateNewObject function, or something...

...as for all the rest, take LostTraveler's advice. With just a bit of experience, you'll be able to accomplish all the rest by yourself.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Mr Jake

you could do object dropping.. you'd just have to limit the number of objects dropped per room... unless you cant change the name of an object via script.

Rui 'Trovatore' Pires

Yeah, we COULD reserve, say, objects 1-10 for in-game inventory droppable objects, but that's a very harsh limitation, considering that, 1 - Kyrandia had no such limit (and unless we do it just Kyrandia's way, what's the point?), and 2 - you'd be left with only 10 objects to work with, roomwise. Of course there are many workarounds for 2 , but not for 1.

Yes, it's possible. Just not optimal yet. Call me when it IS optimal, and I might even script the thing - can't be all that hard.

One more thing which I don't know how to script in AGS - in HAnd of Fate (at least), the INV is scrollable - as in, there's a "rack" on which you can place your stuff. The rack can be turned 3 times, up or down, so you can access more of the INV. Now, how would you script it, considering that the rack-turning is SMOOTH, as in, you actually SEE the INV items going up/down and disappearing off the INV window GUI? THAT one I REALLY don't know how to do... and it'd be a shame to cut that.

Understand I'm being very strict about the precision of the template because I believe AGS is capable of emulating ANYTHING - or is well on its way to be - , and we shouldn't, therefore, be content with imperfect copies.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Pumaman

CreateNewObject has been requested before, and I'd like to add it.

The difficulty lies with the interactions for the new object -- normally, you specify in the editor what happens when the player clicks on an object, but with a dynamically added object, how would this work?

The easiest option might be to simply have some sort of global script function
function dynamic_object_click(int object)
which would then deal with all clicks on all dynamically added objects, but it seems a bit messy.

Adamski

#6
Use characters as 'fake' objects, possibly?

Edit: And by that I mean have a character for every inventory item, and when you need to drop an item just place the character in the right room at the right co-ordinates. A little bit of scripting to keep track of it all and it should work quite nicely =)

Snarky

#7
In this thread, Crash posted some code that looks like it would allow you to drop up to thirty items in each room. On inspection, it probably doesn't scale too well when the number of rooms gets large, but there are other ways of doing it that are more elegant.

Radiant

CJ -> maybe this is a solution...
don't use objects, but make a class of 'dropped inv items' (this option can of course be toggled off). Basically, any invitem can be assigned a room, X and Y (in the invitem editor panel). Then it will be displayed there, of course. If used with MODE_USE, the item is added to the player's inventory and it disappears frmo screen. If used with any other mode, the regular script for 'look invitem' etc are used, just as if you looked at the item from within your inventory.
Finally, whenever a player MODE_USEINV's an item on hotspot 0 on a walkable area, EGO moves there and the dropped invitem is put on the floor.
Okay this may be a lot of work for you but it would feasibly duplicate the Kyrandia interface.

Pumaman

I'm hesitant to introduce another class of things, it adds unnecessary complexity I think.

Your solution could work, but the Interact interaction would need to be customizable (perhaps you'd want the player to walk over to the item before picking it up, or to display a message, etc).

Therefore perhaps keeping it as an object, but storing a "based off inventory number" value in the object to allow you to RunInventoryInteraction later, might be the best plan.

Hollister Man

I think this is somewhat like others have suggested, but I didn't see anyone say it that clearly...

Couldn't each inventory item have a room, X, and Y (room could be -1 if it is in the player's inventory) then each inventory item could have an interaction, just as they do now.Ã,  That way they would just appear if they were in Room R, at coordinates X, Y.Ã,  The extra work it would require for scripting could be left in the hands of the designer, rather than CJ's.Ã,  e.g.
Code: ags
if (object[1].room!=-1) addinventory(1);


I think that's as clear as mudd, mut that's how I would do it.  I think it could be managed even without messing up older games.  Of course, I've never delved into major programming on that scale before.
That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

Earth_Deer

Hey there, has anybody figured out a way to solve these problems? I would like to start on a Kyrandia-style game, but I don't want to even start if it can't be done.

Rui 'Trovatore' Pires

Well, as has been said rather extensively, everything can be easily done except for the object-taking and object-dropping... and even that can be worked around if you think about it. After long thought on the subject, I decided I'd use characters, which are global, to work as these droppable objects. After all, the character limit in AGS is very big, and people probably not going to use that many characters. Just like Adamski suggests, really.

You'd still have to find a way to make that rack turn smoothly, though. In theory, it might work if you move the inventory window at a pace that matches the animation, but I'm not sure - and at any rate, it would be harder to make it loop back.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Earth_Deer

I'm not necessarily worried about a scrolling inventory. Only Kyrandia 2 has that, and honestly, you don't need it. 1 & 3 don't have it.

Has anyone made a template, or am I going to have to figure it out?
I'm just starting out making these games - but I don't want a classic Sierra style (with the separate functions for walking and talking, etc.) I thought it would be easier just to have one cursor do everything. But since AGS doesn't have that implemented directly, would I have to code it?

Anyway, thanks for replying.

Radiant

Using only one cursor is easy. Just remove the bit in the standard game template that does "SetNextCursor" upon a right mouse click.

Using Kyrandish objects, somewhat less so; I'd not recommend that for someone's first game.

Earth_Deer

Right on, thanks for the help. I'll check back in a while after I get some more experience then.

Cino

Though I discovered a few days ago that there is a limit that is not mentioned in the manual - you can only have up to 50 objects/characters per room. If you have a lot of inventory items plus some other stuff in the room, this might be a problem.

Radiant

Ah yes. While I don't recall trying it with Kyrandia itself, I do know that similar games tend to get problematic if you stack too many items in the same area. I've been known to crash RPGs through stockpiling, and did you know it was possible to overload Descent 2 to the point where you can no longer fire your gun?

Come to think of, I believe Kyrandia 1 has only a couple dozen inventory items, so this would stay well within a limit of 50.

Earth_Deer

Yeah, I was thinking 10-12 inventory items.

Rui 'Trovatore' Pires

I'm pretty sure Kyrandia 1 had the INV scrolling. But yes, it's nitpicking, because it goes back to the template discussion.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

SMF spam blocked by CleanTalk