How to set an animated character or item? [SOLVED]

Started by , Tue 30/11/2004 20:38:49

Previous topic - Next topic

Angel

Hi!Well, i think this must be the sillyest question of them all but, well, today is the first day i'm working with AGS and after the whole tutorial, there are some things i haven't found.'I'm Spanish and i've read it in English so maybe...
Well--> My question is: In the tutorial, when you are supposed to create the MERCHANT, ok, you set a character that stands still, what i'd like to know is how to make it be waiting but moving (you know, like resting or similar but not frozen!). I think it should have to do with the sprites and then with the loops, but i dont get it.
And what if i'd like to include some item moving? like a spider at a corner... which orders should I use?

If you know wher to find a tutorial about this topic in particular, please tell me! And should it be in Spanish... better!!!

Thank U very much!!!! ;)

Candle

Just give a view of the animation then look at the  character editor and you will see  idle views , just put the number in that of the animation view .

Angel

Sorry but i dont get it :-[

"Just give a view of the animation " i dont understand.
You'll see, i draw a man (view 2 - loop 0) 3 frames, in each one i move  his arm.
then i go to characters: merchant: normal view:2, and the man appears in the coordenates i set. view iddle: 2.
i test it but he doesnt move

Candle, could you please explain it to me step by step as if i were a little child?  :P

Thanx a lot

Ashen

#3
The Idle view doesn't start until the character has been idle (standing around, not moving or talking) for about 20 seconds. Have you waited this long, and it still doesn't work, or do you just want it to start immediately? If you wait and it still doesn't start, you've got a totally different problem.

Otherwise (if you just want the MERCHANT to move as soon as you enter the screen):
1) If you're using the Interaction Editor, open the room's interaction menu ('Room Editor' section, 'Settings' window, button marked with a red 'i') and select 'Player enters screen (after fadein)'. Then, add an interction: 'Character - Set idle animation'. Set the character name (MERCHANT, I guess), the View number (2), and the delay (0, so it starts right away). Make sure the character is facing the correct way (you're using loop 0 - down - which is the default, so there shouldn't be a problem.) Test the game.

2) If/when you feel up to using scripting, look up SetCharacterIdle and AnimateCharacterEx. Run one of them (via 'Run script') in 'Player enters screen (after fadein)'. I wouldn't recommend this just yet, however. Get a bit more used to AGS in general before moving on to scripting.

Hope this helps.

EDIT: About animating items. (Sorry, didn't read all of your post at first, just Candle's reply)
You could just make the spider a character, and set an idle view as described above. However characters are limited, and you might want a lot of background animation, so to animate an object, you need to:
1) Create a View for the object animation, in exactly the same way you create a view for a character animation.
2)Place the object in the room, in the right place ('Room Editor' section, 'Objects' window, 'New Object' button)
3) Assign the View to the object ('Player enters screen (before fadein)' then 'Object- Set object view number', or SetObjectView() in script)
4) Start the object animating. 'Object - Start object animating', or AnimateObject/AnimateObjectEx() are the default commands. With a little extra work, you can make the animation behave in different ways - trigger at random times, or change the animation when the player does something, for example - but I won't go into that now. Ask back here for more details if you want to know how.
I know what you're thinking ... Don't think that.

monkey0506

#4
Although it's a bit off topic, and I don't speak much Spanish, I do speak some, and if you would like, I will try to help you with translations and such in your game (as well as scripting and things).

Aunque este no es de el tema, y yo no hablo mucho de español, hablo un poco, y si tú gustas, intentaré ayudar tú con traducciones y tales en tu juego (así como ayudando tú con tus guiones y cosas). También, bienvenido a los foros.


EDIT: I know speaking in other languages is generally frowned upon, but since I speak a little Spanish, I just want to help Angel feel welcome to the forums...

Angel

Thank U very much, specially Ashen for his patience (sorry, Candle was too concrete for me) and monkey_05_06, I'm sure i'll go on sending my doubts here because though i've just started, i've always been fascinated with these sort of games and as, like all of you, i've had wonderful times with Monkey Island, Larrys, Indys and so on, i'll be very ambicious and so will my doubts be!   So please boys, don't go too far away!!!

PS: My merchant is alive! Is Alive!!!

Angel

You see! First doubt! (well, second)

Once i get the key wich i'd set on the floor, it appears at the inventory (yes, i managed to do it) and then when i select the key, the cursor gets that shape... but... how to use this key with the items in the room?

I guess i have to enter in: inventory items>interaction> but then what?

- interact invenory item?
-Use inventory on this item?

Imagine there is a flower (item) in the room, and i want to click on the flower with the key shaped cursor and make the flower dissapear... How?

And could the key shaped cursor interact with a hotspot? (As if i wanted the key to open a tree o something that is a hotspot, not an item)

Well, i hope u can help me!!! Thanx AGAIN

Ashen

You use the Use inventory on... interaction like you guessed, but you set it in the thing you're using the item on (e.g. the flower), not in the Inventory Item (e.g. the Key).

So, to use your example:

1) Open up the Interaction list for the flower object. ('Room Editor' section, 'Objects' window. Select the right object and click the 'Ineractions' button).

2) Select 'Use inventory on object' and add an interaction - Conditional - If inventory item was used. Set the item to the number of the Key inventory item (1, if you're just using the default items).

3) Under that condition, add whatever you want to happen when you use the Key. So, you might have something that looks like:

  - Object 0 (flower)
    Look at object
    Interact object
    Talk to object
    - Use inventory on object
      - Conditional - If inventory item was used (1)
        Character - Move character (EGO, 4, 160, TRUE)
        Game - Display Message (2)
        Character - Quick animation (EGO, 2,0,3)
    Any click on object
    Pick up object
    Usermode1 object
    Usermode2 object

And that's about it. It's pretty much the same for using inventory items on Hotspots (like the tree in your example), Characters (to give the item to someone else), or even other Inventory items.


Oh, and a couple of links you might find useful:
http://www.garage.co.nr/ - Portugese translation of the manual (might be a bit better for you than the English version?)

http://adan.iefactory.com/foros/viewforum.php?f=9 - An AGS forum in Spanish.
I know what you're thinking ... Don't think that.

Angel

Hi!
Well, thank U Ashen, now my inventory can interact with whatever i feel...
Another Challenge?

Well, now imagine:
There is a road, it is a walkable area. BUT there is a barrier in the middle. My character can open the barrier if he uses a key that he has in the inventory. When he uses it, the barrier opens and he can go on walking.
The problem is... How can i do it so that although it is a walkable area my character cannot continue his way until the barrier is open?
You know,I dont want my character to be able to go on unless he uses the key, but... how do I programme it?

Should all the road be a walkable area and make the barrier (item) stop the character? Or should just the beginning of the road (until he reaches the barrier) be a walkable area and after the lifting of the barrier make the rest of the road become walkable somehow?

AND HOW???

Well thanks again! I don't think this is difficult and i wish it doesnt cause many trouble!!  :-\

Ashen

Make the road beyond the barrier a second walkable area that is initially turned off, then turn it back on when you use the key on the barrier.

Unfortunately, it doesn't look like you can turn walkable areas on and off in the Interaction Editor, so you'll need to do some basic scripting.

1) Turn the walkable area off. Open the Room interaction list ('Room Editor', 'Settings' window, red 'I' button). Select 'Player enters screen (before fadein)' and add an interaction Conditional - If variable is set to a certain value. Create a variable that will deal with whether or not the barrier is open (I'm going to call it 'barrier'). Choose 'barrier' as the variable, and 0 as the value. In this condition, add a 'Run script' command. Click 'Edit Script' and add this:
Code: ags

RemoveWalkableArea (2);

(I'mm using walkable area 1 as in front of the barrier, and walkable area 2 as behind it.)
Exit the script editor,  and save changes.

2) Set up the Barrier object to respond when you use the key on it. Use these interactions:

    - Use inventory on object
      - Conditional - If inventory item was used (1)
        - Conditional - If variable is set to a certain value (barrier, 0)
          Game - set variable value (barrier, 1)
          Run script
          (Add a command to animate the barrier object, or remove it from the screen)
         
Edit the 'Run script' command, and set it to:
Code: ags

RestoreWalkableArea (2);



That should do it, but ask back if it looks like I've missed anything out, or if it just doesn't work.
I know what you're thinking ... Don't think that.

Angel

Well Ashen, i think i'll have to pay u for these particular lessons you are giving me! (thank u, at heart!)
Well, and back to our work...
I followed your instructions to make the barrier do its job. The first part of the explanation works perfectly. But the second one didn't work at first.
I'll try to explain my impressions:

I think this is...
------------------------------
- Conditional - If variable is set to a certain value (barrier, 0)
          Game - set variable value (barrier, 1)
------------------------------
... the part that creates the problem, because when I followed those instructions the barrier didn't work. As you see that is just one part of:
----------------------------
- Use inventory on object
      - Conditional - If inventory item was used (1)
        - Conditional - If variable is set to a certain value (barrier, 0)
          Game - set variable value (barrier, 1)
          Run script ((RestoreWalkableArea (2);))

--------------------------------
and if I just use:
--------------------------------
Use inventory on object
      - Conditional - If inventory item was used (1)
Run script ((RestoreWalkableArea (2);))
---------------------------------
it works!!

Now I think that although i've solved my problem, it's been like a trick, because i should have used the variable (barrier) and the value (1) you told but i didn't understand it's way of working...
I mean, you wrote this in the first part:
-----------------------------
Create a variable that will deal with whether or not the barrier is open (I'm going to call it 'barrier'). Choose 'barrier' as the variable, and 0 as the value.
--------------------------------
(this part worked) and then:
---------------------
....
Conditional - If variable is set to a certain value (barrier, 0)
          Game - set variable value (barrier, 1)
....
-------------------------
But what's its purpose? to create a variable? and how does AGS match barrier to my item? (and which commands?) ... I think i didn't understand what i was doing and then i solved it the other way (less professional, of course)

Ashen!!!! Sorry for this boring parragraphs that show my ignorance, but i dont want to make things like a robot, i want to understand and i felt like telling you!!! ;)

I have another doubt but i'll tell you later, ok? I prefer you read above, and give me your opinion. Forever thanx!!!

Ashen

Using the 'barrier' variable is sort of optional - as you found out it can work just as well without it. All it does is check whether or not the barrier has been open, so you don't have to use the key every time you pass it. If you want the player to have to use the key every time, or if they'll never go back to that screen, you can just leave it out.

Anyway, a little explanation:

- Use inventory on object
Ã,  - Conditional - If inventory item was used (1)
Ã,  This line means it only works if the 'Key' item is used.
Ã,  Ã,  Ã, - Conditional - If variable is set to a certain value (barrier, 0)
Ã,  Ã,  This line means it only works if the barrier is locked, so (for example) you don't get the unlocking response everytime you use the Key, even if the barrier is already open.
Ã,  Ã,  Ã,  Ã, Game - set variable value (barrier, 1)
Ã,  Ã,  Ã,  Ã, This line sets the barrier variable to open, so this script won't be run again.
       As you figured out, the last two lines can be missedout, and it still works fine.

Ã,  Ã,  Ã,  Ã, Run script (RestoreWalkableArea (2); )
Ã,  Ã,  Ã,  Ã, This line turns on the walkable area.

But I think, if you've got it working in a way you're happy with, you should stick with that for now. Leave the more 'professional' ways until you feel more comfortable with AGS, and understand what you're doing more, rather than just making things 'like a robot', as you said, simply copying out the commands someone on the forums gave you.
I know what you're thinking ... Don't think that.

Angel

Ok, Ashen, once read your last message...
1) How can I then make things that had already been used (clicked or activated) answer in a different way the second time I clicked on them?

I mean, if I have a door that is closed I can make the character open it when clicking on it and changing the view of the door into an open door. But the second time i click on it, it doesn't do anything (logical), as it would be as asking the programme to open the door again and change the door's view into the same view. But I'd like the door to go back to the first state and view -the second time i click on it - (and the third one, open, the forth, close... well, you understand)
Does it have to do with the variables you told me before? Or is there an easier way to do it?

2)This is another doubt  (another  :P!) When making a presentation of the game, in which each screen (such as: "Lucas Arts" - "Presents"...) is a room, how can you program it so that rooms automaticaly are shown one after another after 5 seconds? till you get to the main menu. Because you usually do this like rooms, or... items?

Well, thank u again,Ashen!

Ashen

Hello again!
1) You're right, it's done with variables. To use the barrier example from before:

- Use inventory on object
      - Conditional - If inventory item was used (1)
           - Conditional - If variable is set to a certain value (barrier, 0)
           The barriet is closed, so open it.
               Game - set variable value (barrier, 1)
               Run script (RestoreWalkableArea(2); )
               (Add a command to animate the barrier object opening)
               Stop running more commands
               As 'barrier' is now now set to 1, this line stops the next bit running until you click again.
           - Conditional - If variable is set to a certain value (barrier, 1)
           The barrier is open, so close it.
               Game - set variable value (barrier, 0)
               Run script (RemoveWalkableArea(2); )
               (Add a command to animate the barrier object closing)

Have another try for yourself, but if you really can't get variables to work, it's possible I didn't explain properly, or you're doing something wrong - is it possible for you upload your game somewhere, so I can see what's happening? If you don't have anywhere to upload to, zip it up and e-mail to me (my address is in my profile, just click on my name to get it.).

2) There are 2 ways to do this - one using rooms, the other objects. Both use the 'Game - pause command processor for a time' command, to make the game walt for a number of gameloops. By default, there are 40 loops per second (thhis changes a bit based on game resolution, colour depth, etc, and speed of the computer, but it's usually around this), so 5 seconds = 5 x 40 = 200 loops.
To use rooms, you'd do something like:

Set up the room 1 (the 'Lucas Arts' screen), and select the 'Hide player character' option on the 'Setings' window. Add these commands:

- Player enters screen (after fadein)
     Game - pause command processor for a time (200)
     Player - Go to a different room (2)

Set up room 2 ('presents'). Again, hide the character, and add:

- Player enters screen (after fadein)
     Game - pause command processor for a time (200)
     Player - Go to a different room (3)
Keep doing that, until you've finished the intro, and reach the menu screen.

To use objects, you'd just have the one room, and use the 'Object - Start an object animating' command to run loops of the text fading in and out :

- Player enters screen (after fadein)
     Game - pause command processor for a time (200)
     Object - Start an object animating (0, 3, TRUE)
     Game - pause command processor for a time (200)
     Object - Start an object animating (0, 4, TRUE)
     Game - pause command processor for a time (200)
     Object - Start an object animating (0, 5, TRUE)
      and so on...

Wher views 3, 4, 5, etc show the stages of the into (Lucas Arts logo, 'presents', game title, anything ele you want to show.)
If you just want the text to appear and disappear, you could set all but object 0 not to be initially visible, and use 'Object - Remove an object from the room' and 'Object - Switch an object back on':

- Player enters screen (after fadein)
     Game - pause command processor for a time (200)
     Object - Remove an object from the room (0)
     Object - Switch an object back on (1)
     Game - pause command processor for a time (200)
     Object - Remove an object from the room (1)
     Object - Switch an object back on (2)
      and so on...
I know what you're thinking ... Don't think that.

Angel

Hello, teacher  ;)!
I've done what you told me and it works!!! (variables and so on) now my barrier goes up and down when I want!!!
BUT...  :( something goes wrong with my intro!!!
I did exactly what you wrote me down (using rooms)
--------------------------------------------------------------------------
- Player enters screen (after fadein)
     Game - pause command processor for a time (200)
     Player - Go to a different room (2)

........and so on with all the rooms
--------------------------------------------------------------------------

But when I test it, AGS displays this message:

"Error: A text script run in the Player Enters Screen event caused the screen to be updated. If you need to use wait (), do so in After Fadein"


SO? has this ever happened to you? what shall I do to correct the mistake?

Well, there is also another question i'd like to make you:
- In a room, when the character gets to one edge of the screen.. how can I do so that the room follows the character, you know, like a panoramic. Instead of fading and going to another room... like moving the camera! (I dont know if i've come my idea across)
You know, like in "Monkey Island TM" just the beggining, Guybrush is at the street in front of the sea,  but as he goes on walking on his right he walks and show us more of the landscape (houses, the tavern...) What is panoramic guided by the character. (Oh, my English! :-[)

Greetings!!!

Ashen

"Error: A text script run in the Player Enters Screen event caused the screen to be updated. If you need to use wait (), do so in After Fadein"

Well, are you sure you've put the commands in 'Player enters screen (AFTER fadein)'? There's another option - 'Player enters screen (BEFORE fadein)' - which usually generates that error. Make sure it's not that before we go any further.

And secondly, just make the room wider than the screen (e.g. make it 640 by 240, if your resolution is set to 320 by 240, or 1280 by 480 if you're using 640 by 480). Now, the room view (the 'Camera' if you like) will follow your character when it moves off screen - the 'panning' effect you wanted.
I know what you're thinking ... Don't think that.

Angel

Ashen, once again you were right and both of my problems were solved!
Now I think I can start to make a short game. You know i've been trying and testing but I didn't want to begin anything "serious" and then start running into trouble.

But before I start I'd like to know:
- Which program do you recommend me to use when drawing? The same for the characters and the landscapes? I've already worked with Flash but when I see games like "Larry" or "Indiana Jones" and so on I see another texture...

- What about the music? Which format do people use and how do you import and set it? Do they create it or can you download somewhere online?DO you have to pay for it?

- This is another doubt about AGS: when a character goes to a place that is far away and you want him to became smaller... how?

And well, that's all! mmm.. another thing: I've seen in your profile that you are from Liverpool... do you support that soccer team? Rafa Benitez, Xavi Alonso.. are spanish and as a matter of fact I know a player of this team, Antonio Nuñez! He played for Real Madrid until this year. Now he is injured :(

Thank You again and again and again (loop) ;)

Scummbuddy

Both questions A and B are SO VERY MUCHLY answered on this forum already. Please search the forums for an answers before asking them.

a) Microsoft Paint. If you plan on using an LEC style GUI on the bottom, make your background 320 by 144. if not, then 320 by 200

b) FruityLoops, I suppose. There are many. http://www.fruityloops.com/


Your question C is completly answered in the manual. You really need to go thrugh and read the manual.
c) for the walkable areas, you set the scaling value for them in the same section.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Ashen

See, now you're moving away from what I know, and from what you're really meant to ask here, like Scummbuddy said, but:

a) Depends, basicly go with what you feel most comfortable with. Personally, I use Paint Shop Pro (but not very well). Try THIS THREAD for other ideas.

b) Same as above - if you're a musician, or just have a microphone, you can easily make your own sounds, but it's up to you. There are plenty of free sound site on the 'net, though - just use Google.

c) Use the 'Scaling' function of the Walkable Areas, as Scummy said. Specificly, 'Continuous Scaling' will give the 'smaller with distance' effect.

d) (Totally wrong forum, but...)Half my family support Liverpool, the other half Everton. I'm one of the (seemingly) small handfull of people in Liverpool that honestly couldn't care less either way.
I know what you're thinking ... Don't think that.

TerranRich

Yes, you are now starting to ask questions outside of the realm of this forum. If there are no other Beginners' AGS engine questions, but you have other questions not related to this forum, please ask them in the proper forums. Thank you! :)
Status: Trying to come up with some ideas...

SMF spam blocked by CleanTalk