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...

SMF spam blocked by CleanTalk