Hello. I'm new to AGS and working on my first "test" game. :) I hope this is not a dumb question, but I can't figure out
how to search for this kind of thing and I'm not sure if I'm asking this right...
Anyway, I am currently using the default game setup and have already made my own character. I am following the very useful
Youtube tutorial videos.
I am now drawing a background. However, I am not sure what to do about this particular interaction, especially since
it's something my character will do a lot in different rooms. (She's a babysitter/caretaker of various alien babies).
My character will pick up a baby/child from the crib (or playpen) at some point and then put the baby back into the
crib (or playpen). I am not sure how I should approach this in a technical sense, though.
I checked the manual on Hotspots, Objects, and Characters, but I'm not sure which one would make sense for the crib and
the baby. :-\
And I'm not sure how to search for this kind of thing, so if someone could point me to the right direction or thread, I
would greatly appreciate it. :)
So, here are my questions:
1) I'm guessing the baby will be either a Character or Object (since the baby will be picked up and held by the player
and has its own animations)?
2) Should the crib/playpen be drawn into the background and be made a Hotspot from there or should it be something else?
3) I'm guessing the actions of putting baby in and out of the crib/playpen could be considered an Event, yes?
Any suggestions would be great, please and thank you! :D
Sounds like you may want a separate view for the person holding babies. I personally would choose a hot spot. Then,
you can easily acheive this by setting the baby as a character, and whenever you click on it, goes through the picking animation and it takes the baby. then, takes the baby out of the room, to room 0. Then set some if functions like
if (player.HasInventory(iBAby!!!)
{
[run animations here]
cEgo.loseInventory(iBaby)
}
else
{
[animation]
cEgo.Add Inventory(iBaby)
}
or something like that. Make the hotspot the entire area of the crib.
Or......make the baby in the crib a hotspot along with the rest of your background, then you need to draw the crib empty and import a sprite of that...add an object to the room of an empty crib and place it over the hotspot with the baby in the crib.
When you pick up the baby you turn the object of the empty crib on...oEmptycrib.visible=true;
now make events for that object, when you do, add oEmptycrib=false; when you put the baby back in the crib.
You will still have to add a baby as inventory item also so you can put the baby back in the crib
now you will have to change the characters view to him or her holding the baby and switch that accordingly
Thats how I go about doing it... :P
lilinuyasha:
I don't mean to be rude, but please hold back on giving (bad) advice until you have mastered the basics yourself. Using dialog options instead of global variables, that's a new one. It's fine that you want to help, but confusing other beginners with obscure solutions not so much.
bunny-gypsy:
1) If the baby is supposed to appear in more than one room, I'd recommend using a character. If the crib and playpen are in the same room, an object will do fine if all the baby does is animate in place.
2) That depends on several factors; an obvious choice for an object as opposed to a hotspot would be something that can be moved or picked up, or animates; static world objects that can appear in front of the player can be implemented as hotspot&walkbehind. I'm not sure what happens if you click on a walkbehind that's also a hotspot, it might register as click on the player if they stand behind it.
Assuming the crib is standing near the back wall, a hotspot will do fine; you can use a small walkbehind to make the front of the crib cover part of the baby in that case.
Similar to what NickyNyce suggested, it's trivial to animate an object or change its graphic. So if you decide to make the crib an object, the baby could be a character/object displayed on top or just represented by another graphic assigned to the crib object.
The difference is that assuming you're going to include a text label that tells the player what's under the mouse, you could have the crib and baby as separate objects or simply "baby in crib" for all of it.
3) Sure, that's the usual way; every click on a hotspot/object/character is called an event.
As has been mentioned, to show the player carry a baby all you need to do is change their walking view i.e. NormalView. You can also check for this view's value to find out if the player is currently carrying a baby.
So depending on the style of gameplay, the baby can be implemented as inventory item or simply interacting with the crib will put the baby in there if carried.
Ah, thank you so much! ;D
So I was on the right track about the main character needing a View with the baby in her arms and about the crib being a HotSpot.
I just wasn't sure about the crib/main character interaction. It's great to hear it can be done! :D
A couple more questions and I will be out of your hair, I promise (lol): I'm a bit confused about Objects.
1) Can Objects have their own animations? The manual says that Objects can be used for "things which need to animate".
So, say I want the baby to animate in the background anytime he/she is placed and left behind in the crib. Should I make the baby a Character in order to animate him/her or can he/she be animated regardless of being an Object or Character?
2) And, if I do decide to make a baby into a Character, the baby can still be considered as an inventory item (whenever the baby is in the possession of the main character), yes?
Again, thank you all so much! :D I'm excited just seeing my character moving on the screen! (She looks funny walking with my horrible animation skills, lol.)
AGS is really versatile, there isn't much that can't be done :)
1) You can animate objects all you want so making the baby an Object is fine.
2) InventoryItems don't have any connection to Objects or Characters except in the game designer's mind.
They are completely separate entities that just happen to represent the same game world object as an AGS Object, if you will.
So to answer the question, it doesn't matter; you have to add the baby InventoryItem/remove it again manually each time, anyway.
If you need help with your animations, consider posting them as animated GIFs in the Critics Lounge.
Quote
1) Can Objects have their own animations? The manual says that Objects can be used for "things which need to animate".
So, say I want the baby to animate in the background anytime he/she is placed and left behind in the crib. Should I make the baby a Character in order to animate him/her or can he/she be animated regardless of being an Object or Character?
Yes, both can be animated. With regard to deciding which to use, If the item will appear in multiple rooms then a character is normally selected. If the item will appear exclusively in one or two rooms then an object is usually selected. Objects are stored and loaded with the room while characters are global to the entire game.
Quote
2) And, if I do decide to make a baby into a Character, the baby can still be considered as an inventory item (whenever the baby is in the possession of the main character), yes?
Yes. You would have an inventory item called baby which would be a separate entity from the baby character. You need to manage/synchronize both with script.
Opps: Khris beat me. Perhaps there's something useful here anyway.
Ah, so that's it. So both can be animated, but (using what RickJ said) the difference is Characters are global (can appear in multiple rooms in the game), while Objects are conformed to the room they load in with. Got it! :D
Thank you, Khris and RickJ for answering my last couple of questions. ;D These answers and advice are making things so much
clearer to me!
Now I just have to plan and decide how to lay out the rooms and what to do with the babies and stuff. (And keep reading the manual and watching the Youtube tutorials as I go, of course! ;) )
I'm really liking this program and I love its different features. I've always loved point-and-click adventure stuff, especially Roberta Williams' King's Quest games and the Monkey Island games. :) I also loved, loved, loved, LOVED those old Humongous Entertainment games (Freddi Fish, Spy Fox, Fatty Bear, Pajama Max, etc) when I was little, so I'm greatly inspired by those. (The most recent adventure game I've played is Sam and Max Season 1 on the Wii.)
You can also just animate your background...copy it 5 times while changing slightly how the baby looks in the crib, you then would turn your object of the empty crib over the animation spot on to cover the animation of the background.
just another way of doing it
And a huge waste...
Well if the animation was 5 frames or less it's actually more efficient for the editor to animate the background than to animate a character or object. It's probably not really an issue, and depending on the size of the crib, probably a bit overboard. If the crib was quite large though, say if there was a close-up shot of the crib, then an animating background would be a better alternative (for animations 5 frames or less).