Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - actaria

#21
Hello Kris,

My savior as usual, well what can i say many big thanks you are really amazing each time.

It works really well thanks you so much i can continue the spiders cave now  :-D


#22
Hello,

It's me again. :-D
Today i am learning Camera function.

I have a 1980x5500 room and i wanted to make a Camera scrolling from the top to the bottom of the room to show the player what he will have to climb.

I managed to do the scrolling i wanted with this code and it works really well

Code: ags

// Create and setup a temporary camera
Camera* myCam = Camera.Create();

myCam.SetAt(0, 0);


// Save the old camera in a temp variable
Camera* oldCam = Screen.Viewport.Camera;
// Assign the new camera to the primary viewport
Screen.Viewport.Camera = myCam;

// Scroll the new camera across the room
while (myCam.Y < (Room.Height - myCam.Height))
{
    myCam.SetAt(myCam.X + 1, myCam.Y + 10);
    Wait(1);
}

// Delete the camera and reset the old camera back
myCam.Delete();
Screen.Viewport.Camera = oldCam;


The only little problem i have is that when you enter the room the camera shows the player for like 1 second before going to the top of the room to begin the scrolling down.

I thought that myCam.SetAt(0, 0); was what the camera shows at start but even if i changes the values it still shows the player at start.

Any help to explain would be appreciated.

Thank you.
#23
Quote from: Khris on Wed 30/11/2022 08:56:50Here's one relatively quick way to do this:

Add this to the room script:
Code: ags
function on_mouse_click(MouseButton button) {
  if (player.View == DEATH) ClaimEvent();
}

This will disable all non-GUI (i.e. room) clicks based on the view. ClaimEvent() tells AGS to no longer run the global on_mouse_click function after the room's, effectively disabling all global room click handling.


Hello,

This is exactly what i was looking for
I will try it for the next player death  :-D
Thank you
#24
Quote from: Snarky on Tue 29/11/2022 23:15:26
Quote from: actaria on Tue 29/11/2022 22:29:32But I can't do any blocking animation here because i want the spider to keep moving a little bit while the deeath music plays.

You can have a non-blocking and a blocking animation running simultaneously, so if you make the spider animation non-blocking that shouldn't be an obstacle.

Hello,

Now i have used this solution "will make an object using the last frame of the death loop and make the character(player) invisible for exemple."

But i was curious and went back to this room code:
-The spider kill the Character and i have some blood spreading on the wall (animation that goes till the game goes back to sxreen title)

So maybe i should've just put the blood animation on Blocking and maybe it would bave been ok my character wouldn't have been able to move till the game returns at title screen.

I am not giong to try because it's working well now and I am a lazy girl  :-D

Tonight i am trying to learn Camera and it's not easy but i begin to understand how it works.

I have lots of room but none used camera yet so now it's time.

The scary spider





#25
Quote from: newwaveburritos on Tue 29/11/2022 22:26:17One thing I have learned that I've found useful is that the player doesn't have to be the "player" the player just has to look like the player.  If it's easier for you to use something else  like maybe like maybe an object or even a GUI that can't move and keep the player as the player then you could do that rather than try scripting very specific behavior.

O yes this is a pretty good idea maybe i will make an object using the last frame of the death loop and make the character(player) invisible for exemple.
That sould work.

Thank you.
#26
Quote from: Snarky on Tue 29/11/2022 22:15:09Also, if you're playing a blocking animation, the game will block so that players can't (normally) do anything. Depending on what you want to happen after the player dies, that may be sufficient. (For example play a blocking animation for ten seconds, then jump back to the main menu or show a Restart/Reload/Quit dialog.)

This is what I did for others player death (yes he dies a lot:)
But I can't do any blocking animation here because i want the spider to keep moving a little bit while the deeath music plays.
#27
Hello,

I have a little problem there.

In a room the player dies by a spider..
I have a death animation  which works well.
And of course I don't want the player to be able to move anymore (the corpse is lying on the ground) and  there is a little animation and music that plays once the player is dead on the ground.

So i t ried these 2 commands:

Code: ags
cChar1.StopMoving();

cChar1.Clickable = 0;

But  i am still able to move the character
what am i doing wrong ?

Thanks a lot for your help.
SMF spam blocked by CleanTalk