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

#101
OK thanks a lot for the tip. I'll try this :)
#102
Hey crimson, thanks for the tip. That is more or less the kind of trick I used but yours seems quite easier. It's the second one I was looking for, I don't want the player to be blocked while the animation plays. So I'll try it.

Although I did'nt understand the last part of your message. You mean that I can't do this with the repeatedly execute from the room? I don' t get why:/ Then (sorry I still suck at scripting) I must create a "repeatedly execute" function but how to apply it ?

Thanks again
#103
Hey guys.
Do you know if there is a way to wait for an animation to end without blocking the game?
For instance:
Code: ags

Player.LockView(2);
Player.Animate(1,5,eOnce,eNoBlock);
"Someway to wait for it to end"
Player.UnlockView();


It's been bugging me for a while now and I kept avoiding the problem but there is maybe an easier way:)

Thanks in advance
#104
Ok so I tried and it's exactly what I needed, it saves a lot of time and is pretty easy to use.

Thanks again! ->solved
#105
That looks like a good lead,didn't know about this. Thanks a lot Khris! :)
#106
Ok Cool! Thanks again Crimson :)
#107
So what did you change? I faced the same issue and put it aside :p
#108
Hey Guys!
I ll try to make this simple...

I have 10 different buttons and I want to create a single function that could change their sprite NormalGraphic, with a variable.
My buttons are called button1,button2...button10

Is there a way to select those buttons with just one line of code, instead of detailing all the possibilities.

So instead of :
Code: ags

{
var=Random(9);
if(var==1){button1.NormalGraphic++;}
else if(var==2){button2.NormalGraphic++;}
...
else if(var==9){button9.NormalGraphic++;}
else {button10.NormalGraphic++;}
}



I m looking for the correct spelling (if one) to do something like this :

Code: ags

{
var=Random(9);
button[var].NormalGraphic++;
}



In other words, how to apply an int number to a button number ?
Do you see what I mean? And is that possible ? I guess so because it would be so heavy otherwise

Thanks a lot :)
#109
Hey guys.

I haven't used any modules so far, but amongst the ones that I found on the dl list there is one that particularly caught my attention : The weather module.

Unfortunately,after a few searches it appears that it was created more than 15 years ago, and the last version is compatible with quite old versions of AGS.

So, in short, is there an easy way to make it rain on one of my maps? Using another plugin that I didn't see or any other way?

thanks in advance !
#110
Hey guys, juste a quick update about my issue.

The on event code works really well. thanks again. I still have some minor issues at the moment (the left and right click don't yet work the same as the rest when over a cursor GUI button), but I think I have all I need now to make everything right.

So thanks for your help and see you :)
#111
Ok i ll try that tomorrow and let you guys know but it seems very good. Thanks a lot
#112
Yes, I can see how I could apply the same thing to the action buttons. Nice.
But the inventory list doesn't have an event button. I hope it's the last time I annoy you, but could you tell me how you would apply the same function to the inventorylist ? :)

Thanks again
#113
Yes, that's right, I forgot to define the onclick button in the gui. Seemed obvious but when you only use buttons it doesn't come straight to themind^^

So, It does work , but, not exactly as I wished.
Here is the link of the inventory :
https://ibb.co/sCHq8kx
(It's the sam and max one if you know the game or want to check how the orignal works you can check https://www.youtube.com/watch?v=LvjqHbF9zR0 at 39'15''. Or you can try this awesome game).

So problem is, the switch works but only in the green area. When I'm over the action buttons, it still is blocked, and same goes when over the inventory list, which is 70% of the window. Does the mouse really need to change it's behaviour ? Can't it just work the same it does inGame, and only trigger the gui buttons ?

Anyway, I think we're getting closer so thanks a million arj0n for your time :)
#114
Ok thanks that seems cool .But how do you apply it in the script ? I tried just pasting it in the global script, didn't work. But I need to define the inventory click (else than item) and I don't get how to do that.

Sorry, I'm doing a lot of things without having to get too much into details about scripts so I'm pretty lame about it.

Thanks again.
#115
Hi Arjon. thanks for your reply. I think I actually based my own script on one that is similar to yours. I just changed a few details. But either one still don't work in the inventory.
Does it work in your own game?
Did you override the built in inventory window click handling ?
Maybe there is another line somewhere in my script that overrides the normal behaviour of the mouse.
#116
Hi guys!
So, I've spent many hours on this and now I am on the verge of letting it go... Why the hell don't my cursors switch the usual way in the inventory mode.
I know the inventory pauses the game and could break the command, but even when I unpause it to try ("normal" mode instead of "pause game when shown"), nothing changes.

Here is my on click command :
Code: ags

function on_mouse_click(MouseButton button)
{ 
  
 if (button == eMouseLeft)
{
    // if it is walk-to command
    if (mouse.Mode == eModeWalkto)
    {
      // if there's a hotspot under mouse cursor
      if (GetLocationType(mouse.x, mouse.y) == eLocationHotspot)
      {
        if(IsInteractionAvailable(mouse.x, mouse.y, eModeLookat)==0){
         //then fire "interact" event
        Room.ProcessClick(mouse.x,mouse.y, eModeInteract);}
        
      }
    }
    
    if (GetLocationType(mouse.x, mouse.y) == eLocationHotspot||GetLocationType(mouse.x, mouse.y) == eLocationObject)////if cursor not over hotspot, walk there whatever it is
      {
            Room.ProcessClick(mouse.x,mouse.y, mouse.Mode);
            }
        else{Room.ProcessClick(mouse.x,mouse.y, eModeWalkto);}

  }
  else // right-click, so cycle cursor
  {   
    mouse.SelectNextMode();
  }
}





lines 9 to 14 are just a way I made out to exit maps without having to switch 'interact' so don't mind them(Exit hotspots dont have a "lookat" function so it automatically triggers the interact without needing to change).
I also removed the "if gamepaused" condition in case that was the problem. It seems it isn't, but I still haven't put it back yet.

What is weird is that the mouse 3 button of my mouse (the wheel) makes the switch, but not the right click. So I suppose there is hope, but I can't find the thing.

Thanks a lot.
#117
Ok. Too bad then. When I m done updating the function,I ll post it here.
Thanks
#118
Hey guys

The question is in the title, is there an easy way to pause a sound or background music(can be useful for an event for instance) ? I found old stuff on the forum (from 2017 or earlier) but it's custom functions and I doubt AGS didn't include this possibility now.

Thanks in advance :)
#119
Omg, I swear I looked for such an option. Must have been really tired.
Thanks a lot
#120
Hey guys

I've noticed a small detail, not to serious but that can affect the credibility of the game : When you're in a dialog and choosing your answer (monkey island style dialog), the animations pause. It starts again when characters speak, but there is this moment when it "freezes" that can be problematic. Do you know a way to let the animations continue all the time.

For info I used the lockview/character.animate functions in the repeatedly execute of the map.

Thanks
SMF spam blocked by CleanTalk