Objects animation - HELP!!!!

Started by Filipe, Tue 15/01/2019 11:48:31

Previous topic - Next topic

Filipe

Oh my god!!! I'm loosing my mind with AGS. I'm loving it, but also hating it :( Sorry, but I'm only starting... but every time I want to do something I run into problems.... snif, snif..

Ok, I want to animate an object. It is a kind of a character, but it stays in the same position -stalled, so I choose to animate an object instead of a NPC. I thought it was easy that way...

So I had a new inventory Item to my inventory (I guess this is the same as an object, or isn't it???!')  I then try to animate this object using the animate property like this:

iJohn.animate(1, 2);

But AGS is telling me that it doesn't recognize this property - Animate.... What am I doing wrong?!?!? HELP!!!

Thanks :)

I've see it here. Is this out of date?

https://www.adventuregamestudio.co.uk/wiki/Object_functions_and_properties#Object.Animate

Cassiebsg

An object and an inventory item are not the same thing.

To animate an object you need to create an object in the room, assign it a sprite, and then you can animate it.

An inventory item is something that only exists in your inventory, not in the room.
There are those who believe that life here began out there...

Slasher

For an object to animate you must set it's View first...

Example
Code: ags

oMan.SetView(12);


Khris

Why would an Object and an InventoryItem be the same thing? They have different names, one has a node in the project tree, the other is a room editor selection, the manual entries are separate and completely different...
Plus, when you type iJohn. into a script, the auto-complete window will pop up. If you just type whatever you think will work and completely ignore the suggestions...

Anyway, an Object exists in a room. An InventoryItem is global and exists in a Character's inventory. The only connection between the two is in the designer's mind, where interacting with oScrewdriver will make it disappear and iScrewdriver appear in the inventory.

Filipe

#4
But where are the objects then? How can I edit the script of an object? I press the thunderbolt next to it; and I don't see nothing?!?!

Oh man, I'm getting crazy here...

I'm really getting nuts trying to animate a simple obect, I try animating a NPcharacter then. I did

c.Guard.Animate(1, 2, eNoBlock);

I put this on the Function room_RepExec ()

Everything seems great, but now I cannot move my playable character...

Then I try doing a kind of loop, but it only animates once...

I did as you told me, previously like this:

function room_RepExec()
{
  if(!cGuard.Moving)
  {
    if((cGuard.x == 100) && (cGuard.y == 100)) cGuard.Walk(100, 400);
    if((cGuard.x == 100) && (cGuard.y == 400)) cGuard.Walk(400, 400);
    if((cGuard.x == 400) && (cGuard.y == 400)) cGuard.Walk(400, 100);
    if((cGuard.x == 400) && (cGuard.y == 100)) cGuard.Walk(100, 100);
  }
}

It does this only once, so Hi does the fucnction is called RepExec()?!?!?!

I'm tryng to turn around obscacltes and I'm really only beggining.... :(

I want to do a patrol character and also and animated object... in an endless loop... It seems inpossible :(

Sorry guys... but I'm getting a kind of frustrated here:(

By the way, what I know from objects I'v seen it here:

https://www.youtube.com/watch?v=eKeI1pXdBfw

Crimson Wizard

Let's focus at one problem at a time and only move further after we solve that one.

Objects only exist in rooms. This is why they are created and edited in the Room editor. They are not shown in the project tree for example.

The creation of an object is demonstrated at 1:25 in the video you linked above.

Filipe

Thanks... I learned how to create an object... but...

I tried every thing to animate it in an endless loop. I just want you guys to say if my conclusion are correct, so I don't waste my time:

the eNoBlock function doesn't work in almost all situations;

It is impossible to loop an animation.

I'll explain:

I tried to animate an object. oSusan

oSusan.SetView(3);
oSusan.Animate(1, 5, 1, eNoBlok);

I put in an hotspot (walk on) and also in the Rep Exe function and...

the RepExec function animates it but only once...

The hotspot animates rit, but only if it is eBlock, or none...

:( :~( :~( :~( :~(

Thanks

Khris

#7
Add the "enters room before fadein" event function to your room if you haven't already. In there, use
Code: ags
  oSusan.SetView(3);
  oSusan.Animate(1, 5, eRepeat, eNoBlock);


(and remove everything from room_RepExec)

Like you were already told, putting commands like that in rep_exec will not work the way you want it to.
You only need to call Animate() once to achieve a continuous, non-blocking animation.

Snarky

#8
Look up Object.Animate in the manual, or just look at the popup hint when you type it in AGS. You'll see that the format is Object.Animate(int loop, int delay, optional RepeatStyle, optional BlockingStyle, optional Direction). Which of these arguments do you think controls how the animation repeats? (Hint: it's the one called RepeatStyle, the third one. Why you would put a 1 in that place is beyond me.)

Khris

Fun fact: eRepeat's value is 1 :)
So with the Animate() call used in the right place it would actually have worked.
eBlok not so much though.

Filipe

#10
Thank you Chris. Actually I read the manual...  "1" stands for repeat...

I tried putting the code in almost all the Room functions available, and still it doesn not work. It only works with the eBlock.

In other words I conclude that AGS doesn't allow for having an animation while moving the character, at least, it doesn't seem to do it...

What really makes me nuts, is why the manual states things that doesn't work at all like the eNoBlock... this goes beyond me... I know it is a free software, but.... I'm really sad... :(

Is this a problem with Windows 10?

When I change it to eBlock, it immediately starts the animation, but I'm not able to move my character as expected...

This is really a bad start... Imagine with more complex things...

thanks :(

Crimson Wizard

#11
Are you moving and animating SAME character (or object) or different ones? If these are different then normally there should not be any problem. If they are the same, some actions in AGS may override each other so you need to know how to deal with that.

Can you show your full room script?

Like I mentioned before, my recommendation is to solve one problem at a time. That is: make a new room, put 1 object there and make it animate. After you succeed in that continue adding more things. This way at least we may be sure that things are not messed up because of some unaccounted code.

eri0o

#12
Hey, Filipe, could you make a drawing of what you want to achieve? If you upload in a service like imgur and place the link here, to look.

The view you created, if you name it like MYVIEW, you you will be able to use with nameOfMyObject.SetView(MYVIEW).

Use nameOfMyObject.Animate(0, 3, eRepeat, eNoBlock).

https://adventuregamestudio.github.io/ags-manual/Object.html#animate

In your room, on the properties in the editor, on the thunderbolt events thing, verify that on the after fade in option, the written function name of your Room_AfterFadeIn is there, if not, click the ... button and it will create the AfterFadeIn in your script. Place this animation inside of that

Khris

Quote from: Filipe on Tue 15/01/2019 14:20:34In other words I conclude that AGS doesn't allow for having an animation while moving the character, at least, it doesn't seem to do it...

What really makes me nuts, is why the manual states things that doesn't work at all like the eNoBlock... this goes beyond me... I know it is a free software, but.... I'm really sad... :(

Please stop your incessant whining. You are a beginner, and the problems you run into are typical beginner shit every beginner has to deal with.
Blaming AGS for your rocky start just makes you look silly.

Get a grip and let us help you by posting the code you have. Animating objects while characters walk around is of course possible and a trivial thing to do; you are just missing something simple.

Filipe

Oh Khris... don't say that... :( I'm not wining... I think ;)

The problem is simple. I spend all my day trying to overcome this issue.. and finally noticed something odd... THE eNoBlock doesn't work at all on my computer... get it? I tried and tried...

For instances, I tried interacting with a NPC and told him to walk. He does so, but only if the eNoBlock is not chosen. Otherwise he blinks on the last position and then returns to the starting position... I tried looking at him, and the same thing happens...

To summarize:

THE eNOBLOCK DOESN'T WORK, got any suggestions? I'm using Windows 10...

It is not a matter of coding... Is this a known issue?

Thanks again and sorry :)

Crimson Wizard

#15
I've already made a suggestion: create an empty room, put one object and try single command with eNoBlock there.

Also, please, show us your actual code.

Quote from: Filipe on Tue 15/01/2019 16:06:43
For instances, I tried interacting with a NPC and told him to walk. He does so, but only if the eNoBlock is not chosen. Otherwise he blinks on the last position and then returns to the starting position...

This sounds like there's some other code that overrides NPCs behavior. If you still have that moving between 4 points in RepExec that could explain these weird things. RepExec is still run during any NoBlock commands.

Snarky

Quote from: Filipe on Tue 15/01/2019 16:06:43
THE eNOBLOCK DOESN'T WORK, got any suggestions? I'm using Windows 10...

It is not a matter of coding... Is this a known issue?

It is a matter of coding. eNoBlock "doesn't work" because you are Doing It Wrong.

Filipe

#17
There are some weird things going on for sure...
I manage to solve some of my problems, not sure why... It is already doing the animation, but I had to delete the same code from  multiple functions. So it was a matter of overriding, that's true... because sometimes the object started to animate... so one thing is solved... but....

I got another character. I want him to come to me without blocking my movement. I try eNoBlock, but he doesn't move...

This overriding issue, or code garbage makes the game goes crazy... sorry guys :) and thanks to all of you :)

Khris

Post. Your. Code.
Jesus FC. I'm outta here or I'll get banned again.

Filipe

#19
I was banned??!?
oh sorry... you were banned..
Khris, my code is simple...

I'm gonna try using Roger...

Slasher

#20
Filipe.

You want to listen to these guys for they have years of knowledge and trust me I've been where you are.

Sit back, relax an stay cool. All will come right in the end if you do as they ask.

1, Make sure you have created the said object in the room correctly named and that its view loop has at least 3 images.
2, Add your object code to animate in Before Fadein function
3, Get rid of all the other code. Maybe use a new room to do this so it has no other code.
4, Check your walkable area is correctly placed.
5, We generally use regions and not hotspots for walks on..
4, compile and run game.




eri0o

Filipe, could you show a printscreen of your Room and code, paste on imgur or record a video? I still can't understand your problem.

Please consider the possibility you misunderstood what blocking and nonblocking functions do. Essentially, if something is non-blocking, neither the player or whatever is next in the first-in-first-out actions pipe will wait. So if you tell something to animate, starting from the first frame, and do that on the next frame, and on next frame, on and on, the result is that you only see the first frame all the time.

As CW said, without taking a look in your code it's impossible for us to help you.

Filipe

Ok, sorry.. and thanks :)
When my game started doing these weird things it seemed like it was a kind of windows 10 conflict... I'm now more relaxed...
You see I'm used to Procedural programming, like Pascal, c, etc...



Filipe

Quote from: eri0o on Tue 15/01/2019 16:49:03
Filipe, could you show a printscreen of your Room and code, paste on imgur or record a video? I still can't understand your problem.

Please consider the possibility you misunderstood what blocking and nonblocking functions do. Essentially, if something is non-blocking, neither the player or whatever is next in the first-in-first-out actions pipe will wait. So if you tell something to animate, starting from the first frame, and do that on the next frame, and on next frame, on and on, the result is that you only see the first frame all the time.

As CW said, without taking a look in your code it's impossible for us to help you.

I would do that, but it is just a test... I'm ashamed :( It is not a game... I will do that later... thanks for your help :)

eri0o

#24
Seriously, just paste your code, someone will find your thread in Google one day looking for help.

If you can, please, once you understand what you were doing wrong, and what you did right, write here what you did wrong, and if you can, why you thought of that. It's not impossible that sonething has to be written clearly somewhere to make something easier to understand.

Crimson Wizard

Quote from: Filipe on Tue 15/01/2019 16:51:08
I would do that, but it is just a test... I'm ashamed :( It is not a game...

That really does not matter. We are not here to judge your game, we are trying to diagnose the problem and it is as hard to do without seeing actual code as to diagnose illness without seeing actual person.

If you look around this forum you will see people posting all kinds of random code all the time, some of which is just made for experiment.

Filipe

my code:

Function cSusan_Intertact()
{
cSusan.Walk(500, 400, eBlock, eAnywhere);
}

Maybe it is the eAnywhere, because he jumps from one position to the last frame

Filipe

#27
Ok, I got it... the problem was the Anywhere, but still he walks very, very  fast...  I remove the anywhere and now he walks but he runs like Flash ;) LOL



Also the character is not going to walk with the eNoBlock, if it is being animated in the Rep Exec...  so that was also one of my problems... when you have an animated object/character and you try to interact with it, if he is doing the animation in a loop, you have to block it otherwise it will be messed up, and the eNoBlock function seems not to be working... so it was always a override problem from the begining... thanks to Crimson Wizard for suggesting it :)

Slasher

in the character events panel check movementspeed and animationdelay.. Adjust to suit...

Khris

Quote from: Filipe on Tue 15/01/2019 17:06:24
my code:

Function cSusan_Intertact()
{
cSusan.Walk(500, 400, eBlock, eAnywhere);
}
That won't even compile, let alone run. Why don't you post the actual code you have? Just copy-paste it here. You aren't seriously retyping it / avoiding to post code because you don't know you can copy-paste it?

Filipe

#30
Thanks Slasher, your replies really help me :)

Filipe

Quote from: Khris on Tue 15/01/2019 17:40:41
Quote from: Filipe on Tue 15/01/2019 17:06:24
my code:

Function cSusan_Intertact()
{
cSusan.Walk(500, 400, eBlock, eAnywhere);
}
That won't even compile, let alone run. Why don't you post the actual code you have? Just copy-paste it here. You aren't seriously retyping it / avoiding to post code because you don't know you can copy-paste it?

:( No, actually, for strange that it might seems to you, I'm using a different computer to run AGS, which is not connected to the net, I know, I know what you are thinking, and no. I don't use wi fi. It is an old computer, well sort of, it runs Windows 10 :)... so in fact everything has an explanation, in this case a very simple one... I'm doing some tests, and I really love AGS... what is happenng to me is something called creative impatience... It was the first time I really got into AGS and I love it... :) I plan on installing it on my new computer.... but now, I'm just learning, and boy I leanr a lot this day...

My problem is that I was running a lot of tests... I never bother to delete the code I had on the Rep Exec function, so it was in conflict with every thing I told cSusan to do... Also I didn't mean I was ashamed of showing my code, I wanna it more to say, that i it was difficulte for you to understand with all this mess I was doing... but you Khriss... you seem to be looking for a fight :( I understand you don't have patience for newbies... sorry then :(

By the way, I promice to show you guys first hand, when my game is finished ;)

Khris

Quote from: Filipe on Tue 15/01/2019 19:09:12but you Khriss... you seem to be looking for a fight :( I understand you don't have patience for newbies... sorry then :(

Yes, I hate all newbies. Newbies are scum. I always talk down to them, as a general rule. If you are a newbie and I happen upon your thread, you better get ready for some serious, indiscriminate abuse.

Slasher

Back in the cage Khris  (laugh)

He gets angry when Newbies won't listen or pay any attention to advice and make lame excuses and get very defensive because ags is not doing what it's suppose to do.

Most of us know Khris and his bark is worse then his bite but he's an ok guy, underneath  (laugh)

Read the ags help manual, its your bible  (nod)

Filipe

No problem for me here... I was wondering why Khris was banned once, but now I understand why ;) There is always a Khris in any forum LOL, and always a Filipe ;) I just hope he likes my game.. the bad guy is going to be called Khris, on your honor, and he is going to be a really ugly dude... You see, I'm a goods sport ;)

Gilbert

Everyone! Please stay on topic and refrain from attacking each other or I'll do something to this thread.
Thank you!

Filipe

#36
To end it, let me just say this:

I LOVE AGS :) My favorite genre of games is adventure games. I spent my youth playing games such as Monkey Island, Rex Nebular, Space Quest, Kings Quest, etc... Those great memories are embedded on me. I use to play those games on an Amiga before I move to PC. I alywas dreamed of making computer games, namely point and click ones. I only discovered AGS now, and I'm crazy happy. It was a dream for me... I'm in love by AGS, and what it can do, so I got a little be excited. I had problem in the past with Win 10... and some software so I got into panic :(

Again, many  Thanks to all the people that helped me including Khris :)

ManicMatt

Hi, I think you would be better off making a simple one room game to get into the swing of things. Don't have any npcs doing any complex movements or animations. Just keep it basic as possible. Get into the swing of making a simple room where you can have a simple puzzle. My first starting project didn't require me to use eNoBlock and so on, it was that basic with no animation apart from the main character walking and talking. Small steps!

If you want to see what AGS is capable of, look up a trailer for the forthcoming Guard Duty and you'll see how AGS is quite easily coping with multiple animations and events.

Filipe

thanks for the advise...

Did you choose your nick name in honor to Manic Miner? I am a fan of that Spectrum game :)

ManicMatt

I've played it, but... nope, sorry!

I can't really remember it was that long ago, but I think it was something to do with my personality back then.

SMF spam blocked by CleanTalk