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

#1
Hello Khris,
Playing tracks in specific room without restarting, this is really interesting !
I will have a look tonight, thank you for the link.

EDIT:
Couldn't resist to have a look at your link even if i am at work 😀  and i like it, it seems to be easy to  use.
I will try your module as soon as i get home
#2
Hello Crimson Wizard,
I did what you said and now it's perfectly working 👍

Once again thank you very much for your help
#3
Hello,
It's already me again 😀
I am trying to improve a few things and now i on the sounds, musics parts.
Until now i was doing little tricks here and there to prevent music to start over again when reentering a room before the end of the music.
I found a thread on the forum here:
https://www.adventuregamestudio.co.uk/forums/beginners-technical-questions/changing-rooms-without-the-music-starting-over/

I am trying to use the 2nd method with audio channels

In GlobalScipt.asc i have:

Code: ags
function game_start()
{
 bool IsAudioClipPlaying(AudioClip* clip)
{
    for (int i = 0; i < System.AudioChannelCount; i++)
    {
        if (System.AudioChannels[i].PlayingClip == clip)
        {
            return true; // found it
        }
    }
    return false; // nowhere
 }
}

In GlobalScript.ash i have:
Code: ags
import bool IsAudioClipPlaying(AudioClip* clip);


And finally in my room i have:
Code: ags
function room_AfterFadeIn()
{
    if (!IsAudioClipPlaying(aMusic1))
    {
        aMusic1.Play();
    }
}


Unfortunately it gives an error in the GlobalScript.asc

"GlobalScript.asc(13): Error (line 13): Nested functions not supported (you may have forgotten a closing brace)"
this is this line:
Code: ags
 bool IsAudioClipPlaying(AudioClip* clip)


Can you please help me if you can see the mistake i made.
Thank you very much.
#4
Hello,
It really looks amazing the graphic style is awesome.
I hope i'll be able to buy it soon (got it on my Steam Whishlist)
I am a huge fan of Technobabylon my wish is to have a Technobabylon movie one day 😃
#5
Since i am a lazy girl i picked the shortest way to do it and it works like a charm.
Code: ags
player.ChangeRoom(map_room_number);


I keep Kastchey way to do it in my personnal guide.
And now i know that button can be animated on a GUI 😉 Snarky
Thanks again to all of you have a good night
#6
Quote from: Snarky on Wed 06/03/2024 18:09:00
Quote from: actaria on Wed 06/03/2024 15:53:55I hope you are not going to tell me that it was possible to animate things on a GUI haha 😃 ?

Certainly it is. You use a GUI Button and call Button.Animate().

Nooooo  :shocked:  well this is a great lesson for the next time i will use a GUI  😉 Snarky
I redone the whole map because of this !  now i know about the Button.Animate()

Thank you 👍
#7
Hello Kastchey,
Thanks a lot for your help, this is a great way to solve the problem, this is what i had in mind but i didn't know how to do it with 2 varibales integers.

I'll try both solutions as soon as possible.
Thanks again for your time.
#8
Hello Khris,

The player is not visible in the map room, it's just clickable points so i will try your solution as soon as i get home:
Code: ags
player.ChangeRoom(map_room_number);


This is a really good question, you are asking why i used a specific room with a GUI and not just a GUI, this is what i did at first but i wanted to add animated objetcs on the map such as waves and little things moving and i didn't find how to animate objects on a GUI

I hope you are not going to tell me that it was possible to animate things on a GUI haha 😃 ?

Thanks again for your precious help and il will let you know if i managed to do it.
#9
Hello,
It's been a while i was not stuck but this time i need your help
In order to create a map i use a room with a GUI on it
There's a button on the GUI to exit the map (a basic cross)
to go back to the previous position when the player exit the map i use:

Code: ags
player.ChangeRoom(player.PreviousRoom);


The problem is that the player comes back to the previous position but in the middle of the room
I need to find a way to go back to the previous room with the same coordinates (x,y)  the player was before he opened the map

I tried different things without success
I believe there must be a way to do that can you please help me 😀

I wish you all a great day, thank you very much
#10
Hello,

I am so sorry it took me so long to answer.

I used your script and it's perfectly working so now i know how to do it (a click + a condition) and it's going to be really useful.

Thanks also for the explanation about unlocking views.

Once again thanks a lot for your precious help.
#11
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.
#12
Quote from: Crimson Wizard on Thu 13/04/2023 23:03:52
Quote from: actaria on Thu 13/04/2023 22:34:37Perfectly working thank you didn"t know about the "always" thing

There's some information about these, and explains the difference:
https://adventuregamestudio.github.io/ags-manual/RepExec.html

Thank you
#13
Thanks a lot for the answer i will have a look right now  ;-D

EDIT:
Perfectly working thank you didn"t know about the "always" thing
#14
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.
#15
Hello Cassiebsg,

Stupid girl i am...
Without having my code you found my mistake.
I was not even using the correct character name but another one that is almost the same.
Thanks a lot  it's been 2 days and i was not even able to see this.

Plus i tried for hours some WalkableArea wondering why my character was not able to go through the way and it was an invisble part of the PNC blocking the way
i just needed a solid=false.

I guess this is how we learn :)

Thanks again you saved me many hours.
#16
Hello Khris,

Thanks for the reply,

This is so much better than the way i was doing to update the GUI.

Same thing for the way you check the quantity given to the NPC

I will keep this script and use it again on another room to be used to count and update GUI the right way.

Everything is working great now the only remaining problem is that the NPC isn't using is Speech and color wiew.

The color is white when he talks (supposed to be green) and the speech animation isn't playing in Global Script when it's working normally in Room Script.

I tried:

cNPC.SpeechView = 61; but it still not animating or changing the text color

I guess it might be another setting set to white somewhere else.

Any idea ?

Thanks so much once again to help me progress with AGS.
#17
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
#18
I just had a look and this is really nice especially the zoom exemple with respected ratio.
i will use it sooon for sure  :-D
Great job thanks.
#19
O yes ok thank you for the explanation and it's easier than numbers sure thing.
#20
I am now trying to use the module

Code: ags
function room_RepExec()
{ 
if (PPColliding.CWithC(character[0], character[15])) {
cChar1.Say("i am dead");
  }
}

Unfortunately it's not working nothing happens when i collide.
I triple checked the characters ID's.
Both characters got solid properties On

What am I doing wrong, any ideas ?

Thank you.
SMF spam blocked by CleanTalk