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

Topics - actaria

#1
Hello,

I am still working on my piano bar room and unfortunately i am stuck again.

I want the character to be able to sit on a chair and just listening to the pianist with a idle view
view 167= the character sitting on the chair
Code: ags
function ochair_Interact()
{
cChar1.Walk(1420, 820, eBlock);
cChar1.FaceDirection(eDirectionUp);
cChar1.LockView(167);
}
I had this code but i think the lockwiew was preventing the idle view to animate so i made a timer that triggers the idle view.

Code: ags
function ochair_Interact()
{
cChar1.Walk(1420, 820, eBlock);
cChar1.FaceDirection(eDirectionUp);
SetTimer(7,80 + Random(500));
cChar1.LockView(167);
}

Code: ags
function room_RepExec()
{
if (IsTimerExpired(7)) 
{
cChar1.Animate(0, 5, 0, eBlock, eForwards);
SetTimer(7,80 + Random(500));
}
}
It works well maybe there was an esier way to do this ?

Now i want that when the player click somewhere it makes the character stand up and go back to the normal view

I don't know how to do that i had a look at: "on mouse click" but i am not doing anything good i tried that:
Code: ags
on_mouse_click
{
cChar1.UnlockView();
cChar1.LockView(1)
}
It gives me an error and i don't really know where to put it

Thanks again for your precious help.
#2
Hello,

I hope everyone is doing well.

I need your help because i am stuck on that one.

I have a bar with a pianist and a dancer:



I use this code to make the dancer move everywhere on stage

 
Code: ags
function room_AfterFadeIn()
{
SetTimer(15,250);
}


 
Code: ags
function room_RepExec()
{
if (IsTimerExpired(15)) {
cdanseuse.Walk(Random(999), Random(999), eNoBlock, eWalkableAreas);
SetTimer(15,80 + Random(80));
}

It works well the problem i'd like to solve is that the character needs to talk to a NPC and when the dancer reach the end of timer she stops once the NPC is talking or opening a dialog.

How can i make the dancer to keep dancing even when the player is talking to someone ?

Thanks a lot for your precious help.
#3
Hello,

I have some problems with a script part in Global Script
It's a usual code i really don't know what i am doing wrong.

The Character needs to get 10 rocks with a pickaxe then give them to a NPC
I also have a GUI that counts the number of rocks top right of the screen

Code: ags
function NPC_UseInv()
{
if (rock10==true)
{
  if (cChar1.ActiveInventory == irock)
  {
    grock10.Visible=false;
    player.LoseInventory(irock); 
    cChar1.Walk(1274, 665, eBlock);
    cChar1.FaceDirection(eDirectionUp);
    cbianca.Say("congrats you made it");   
  }
}

The end of the code i use to show the number of rock GUI
Code: ags
function room_RepExec()
{
if (rocks == 10)
 {
 grock9.Visible=false;
 grock10.Visible=true;
 SetTimer(1,0);
 rock10=true;
 player.LoseInventory(ipickaxe); 
 }
}
I have 3 problems yes that a lot :)
-the GUI stay on screen
-Player is not losing rocks from his inventory
-NPC is not using speech view anymore (it's working in the room script) means no animation and the speech color is white when supposed to be green.

I also use a simple code to randomize if the player get a rock or not but i don't think it's related to the problem.

What am i doing wrong ?
Thanks a lot for your precious help

EDIT:
I removed all the part from the function room_RepExec() and now it's in each hotspot area where the player use the pickaxe it was a big mistake i think.
Now the GUI is being removed as intended, other problems remain the same

EDIT 2:
Ok my code was a toal mess

I was adding a new rock each time in my inventory so i had to click 10 times on ths NPC to see the rock disapear from the inventory.
GUI is also removing well now that it is not on RepExec anymore

I'll see now for the speech color
#4
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.
#5
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