Character Animation Without Walking - in the same position

Started by Filipe, Tue 26/02/2019 22:57:56

Previous topic - Next topic

Filipe

Hi guys :)

I know I'm just a beginner, but I envision this game, and I think that with your precious help I can do it :)

I want to animate my playable character but in the same position, without walking, I mean, and without being a cut scene... So, here is what I want to do:

I want my character to seat on a chair, after we tell him to do it, with the action click... then, I want the same character to do different things, on this new seated position, like changing the TV channel, reading a book, etc...

So, here is how I though I could this. I just want you guys to tell me if this is possible, to make suggestion, and also to tell me which are the instructions, I should use... (e.g - I don't know the instruction to make the character invisible :()

I though that after I click on the chair, the character walks to a certain positiion, and its visiblility turned to "false" (is it possible to do it?), but with the all the actions visible, so I could tell the character, what to do after he sat on the chair... then I turn the visibility of an object, on the same starting position where my character was,  to true (the object is an animation of my character  seating on the chair) . Then, If I click on certain objects the character performed certain animations with different objects (like reading a book, etc), If I click with the walk action to an area, outside the chair, I turn visible an object animation of my character getting up, and then the playable character turns visible again, and everything turns to normal again...

So, is it possible to do what I want like this? Is there a better way of doing this? Can you tell me which instructions should I use to do this?

Many thanks :)



Khris

You don't need to switch to an object, that's what Character.Animate() is for. If you look at the documentation for that command you'll also find example code that shows how to lock the character to a certain view first. (Create separate views for all the animations; don't put them in the Character's main view.)

If you create a room variable (just add bool playerInChair = false; to the top of the room script) you can keep track of the character's state. Set the variable to true when the player sits down, and check its value in interactions to decide what to do.

Filipe

Thanks Khris... I already did the animations, on different views. Can you put  a link to the character.animate()? I have difficulty finding some instructions on the manual :(
Also, do I need to change my character view first?

https://www.adventuregamestudio.co.uk/w/index.php?title=Special%3ASearch&search=character.animate%28%29&go=Go

Khris

The online manual is here: https://www.adventuregamestudio.co.uk/manual/
Here's the page: https://www.adventuregamestudio.co.uk/manual/ags47.htm#Character.Animate (including how to use the command)

The manual is also available from inside AGS, just press F1.

Filipe

Thanks again Khris...

But I have to make the character walk to a certain position, otherwise he seats o the floor right? Also, how does AGS adjust scaling? Should I scale the same way as the character?

One thing that was really handy, was a graphic editor on AGS... It is so time consuming to have to go to photoshop to sometimes do a minor  adjustment on the sprite :( Also can we zoom the sprites? It is so small, that it is sometimes difficult to see the frames...

ManicMatt

I think scaling is covered in the manual..

I hit ctrl and + to use the zoom feature in Windows if I'm struggling to see something.

Khris

Not sure what you're asking. Just make the character walk to the position first, using eBlock. Then use LockView and Animate to show them sitting down.
If you make the sit down sprites wide enough, you don't need to reposition the character at all. A character sprite is drawn with its bottom center at the character's x/y position, so keeping that in mind, you can adjust the sprite's canvas so the character's pivot remains the same.
If you do this, the same scaling will apply throughout, and everything will work out fine.

Filipe

#7
Thanks...

Khris, do you know if there is any graphic editor planned to be included on future AGS versions?

Or at least the ability to make minor adjustments to the graphics, like saturating colors, turn sprites to black-and-white, framing sprites right, or the ability to zoom the sprites...

For instances, I found my graphics color's to be not very saturated. Now I have to edit them again on Photoshop. The problem is that I have to do this frame by frame, or sprite by sprite, don't I? Is it possible to open all the sprites used in a view in photo shop at the same time? Or zoom them? OR I have to go trhough the painful task of having to open them individually? Is it possible to export AGS sprites to different layers in Photoshop, at the same time?

What I want was a Photoshop inside AGS... is it to much to ask for?  :grin: LOL

Khris

Yes, it's too much to ask for. Primarily because it's not necessary at all. Color and contrast choices should happen during the design phase, not while you're implementing animations.

Load a room background into a layer, then your character sprite into another layer. Now edit the sprite until you're satisfied.
When you're done, then is the time to create tons of animation frames based on it.

Still, AGS supports tiled sprite import. Use a sprite sheet (that way you can make coloring adjustments to all sprites at once), then import them all at once into AGS using the option in the sprite import dialog.

You don't need Photoshop inside AGS (which isn't going to happen any time soon, or ever), you simply need to fix your workflow.

Filipe

Thanks Krish... I guess you are right... but... sometimes you just change your mind whit the development of the game... imagine you want your game to get darker, or colors to get de-saturated, when your character is dying... or you want to do a cut scene in black and white, so it gives the impression of a flash back... I mean it was handy to do minor adjustments to your sprites without having to go to Photoshop...

Anyway, you really help me a lot... again... I'm already implementing your advices, and they are working....

Thanks  :)

Filipe

Quote from: Khris on Wed 27/02/2019 08:10:01
Not sure what you're asking. Just make the character walk to the position first, using eBlock. Then use LockView and Animate to show them sitting down.
If you make the sit down sprites wide enough, you don't need to reposition the character at all. A character sprite is drawn with its bottom center at the character's x/y position, so keeping that in mind, you can adjust the sprite's canvas so the character's pivot remains the same.
If you do this, the same scaling will apply throughout, and everything will work out fine.

Khris, what I mean with the scaling thing is this: do I use the same scale of all my normal character view sprites, or should I scale down this new seat view so it matches the place where he starts the seating animation? Because I'm using the scale feature of AGS, so when the character seats he is probably 80% of its original size... Thanks again :)

Khris

Create your in-chair sprites at 100%, as if your game had no scaling at all.
The character's in-game scaling will always apply to its current sprite, so regardless of the view or frame, the sprite will appear downscaled according to the current walkable area scaling.

The only reason to do things differently would be if you were creating a lowres game and you want the chair animations to be pixel-perfect. In that case you'd create them at the final size (i.e. 80% of the character's actual size), then disable scaling while they're in the chair.

As for character effects, AGS has ways to achieve that in game. You could for instance use Character.Tint(), or display a non-clickable semi-transparent black GUI across the screen to darken/tint the entire scene.

Filipe

Thanks Khris :) I guess I have a lot to learn from you guys :) I love AGS :)

Filipe

Quote from: Khris on Wed 27/02/2019 12:16:50
Create your in-chair sprites at 100%, as if your game had no scaling at all.

As for character effects, AGS has ways to achieve that in game. You could for instance use Character.Tint(), or display a non-clickable semi-transparent black GUI across the screen to darken/tint the entire scene.

Khris, how exactly do you use character.tint()? If you want to affect only saturation, what should one do? I mean, I want the same RGB colors levels, but I want to increase saturation only. So what should I do? If you  do cEgo.Tint(0, 0, 0, 30, 100) what does it do? I know that for luminance to be the same one should choose 100, what about RGB? Is it zero, or 250/2?

Thanks

Khris

I don't think you can increase just the saturation; the saturation parameter is only used to specify how much of the RGB gets applied.

If you want to change the saturation of the character in-game, you can create highly saturated sprites, then tone them down in-game using a tint like (128, 128, 128, 50, 100), which should apply 50% medium gray to the sprite. Remove the tint to turn the character saturated again.

As far as I can tell, the Tint() command is mostly intended as a way to implement colored light sources; it's very possible that it doesn't support the thing you want it to do.

Having said that, you can in theory create a fully custom colored dynamic sprite based on an imported one; a suitable function could grab the frames of a view, iterate over the pixels and create new sprites. Doing this once per frame is probably going to slow down the game though, so whether this is feasible depends on how and when exactly you want the saturation to change, and on whether the character is supposed to be moving while you're doing it.

Filipe

To tell you the truth I want to match the saturation of some of my first sprites animations. Why? Because I forgot that I had saturation to 40 in photoshop on those first animations. Then I noticed that with the new animations I already have done, and imported to AGS, the sprites look less saturated :( I'm just lazy to import all the sprites of those new animations again into AGS, this times with Saturation turned to 40.... :(

Matti

Well, don't be lazy and don't forget the steps in your image editing process ;)

But as a note: If you don't change the filenames you can quickly re-import all the sprites at once using "import from source".


Filipe

Quote from: Matti on Thu 28/02/2019 07:43:16
Well, don't be lazy and don't forget the steps in your image editing process ;)

But as a note: If you don't change the filenames you can quickly re-import all the sprites at once using "import from source".

Matti, can you at least adjust the character brightness/contrast? I mess around with the tint properties, and I really don't understand... it seems to have a mind of its own ;) LOL Thanks :)

Cassiebsg

I'm guessing you can create a macro in photoshop, open the files, run it and change those things automatic, save the files overwriting your old ones. Then just select the sprites you wish to replace, right click, select "replace from source" and *bingo* it's done.
There are those who believe that life here began out there...

SMF spam blocked by CleanTalk