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

#21
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 !
#22
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.
#23
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 :)
#24
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
#25
Hi again !

You know when you pick up an item, you like it to switch the mouse cursor to useinv of that item with a code like this :
Code: ags

{
....
player.AddInventory(item);
player.ActiveInventory(item);
Mouse.Mode==eModeUseinv;
}


This makes the item you picked more visual, more concrete.
But I can't find how to do the same when you need an interaction with another item you already have(call it item2). Because that function calls for (item2) to be the active inventory so it makes the game crash.
This is the kind of code that I use (and doesn't work)

Code: ags
function obox_UseInv()
{

if(player.ActiveInventory==item2)
{
player.AddInventory(item);
player.ActiveInventory(item);
Mouse.Mode==eModeUseinv;
}

  else
player.Say("Doesn't work.");
}



I can see where the problem is here but I can't find the way to avoid it. Any function in mind ?

Thanks a lot again and have a good sunday.
#26
Hey guys.

I'm facing a few problems on my game. It's not much for you I guess, that's why I put it all in the same topic (to avoid flooding too much :) ).

1)HOTSPOTS : I followed a code that was previously given to me here. I'm going for a Sam and max interface. For those who don't know it, the pointers (walk, look,pick up speak and use) animate when the mouse is over a hotspot, item or character. This isn't initially coded on  I had too add it :

        - 1)first, to animate the pointer when over a hotspot (thanks @Khris)

Code: ags

                  bool wasHovering = false;
function HandleCursorHighlight() {
  bool isHovering = GetLocationType(mouse.x, mouse.y) != eLocationNothing;
 
  if (isHovering && !wasHovering) {
    // cursor entered interactive area
    if (player.ActiveInventory) mouse.ChangeModeGraphic(eModeUseinv, player.ActiveInventory.Graphic + 1);    
  }
  else if (!isHovering && wasHovering) {
    // cursor left interactive area
    if (player.ActiveInventory) mouse.ChangeModeGraphic(eModeUseinv, player.ActiveInventory.Graphic);
  }
 
  wasHovering = isHovering;
}


It works just fine, but I was wandering if I could adjust it so that the animation doesn't go if the hotspot isn't scripted for the specific action. For instance an item on the floor would not animate the "speak" cursor because I haven't planned to script something in "talk to hotspot". It would just animate the pick up and look at cursors, because this is what the hotspot has functions for. I was thinking maybe with the properties of the hotspot, or if there is a function that recognizes if clicking will do something or not.

       - About hotspots again, weirdly enough, the "walk to" cursor doesn't go through hotspots. If I create a hotspot to changeroom, it doesn't activate. So I used this code to force the action :
Code: ags

function on_mouse_click(MouseButton button)
{
  // called when a mouse button is clicked. button is either LEFT or RIGHT
  if (IsGamePaused())
  {
    // game is paused, so do nothing (i.e. don't process mouse clicks)
  }
  else 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)
      {
        
         //then fire "interact" event
        Room.ProcessClick(mouse.x, mouse.y, eModeInteract);
        return;} // do not do anything else
           Room.ProcessClick(mouse.x,mouse.y, mouse.Mode);
      }
    }
    // in all other cases - just do default action
    Room.ProcessClick(mouse.x,mouse.y, mouse.Mode);
  }
  else // right-click, so cycle cursor
  {   
    mouse.SelectNextMode();
  }
}


Once again, it does the trick. When I "walk to" a hotspot that changes the room, it works. But when I "walk to an "item hotspot" it plays the interact script, which is not cool. I could'nt find the way to have both the interaction on specific hotspots(the exit ones) and the no interaction on regular ones. Again there might be a function that determines the id of the hotspot, that i could use to determine whether it's an exit one or not(1->3 are exits,4+ are regular), or maybe by including comments that a function could recognize? Any ideas ?



2)Second point is about music, I guess an easy one. It's pretty easy to put the music changes in specific room loads so that it loops and there is no discontinuity through the game. But I'm going with 2 playable characters here, and so the player changes will disturb this beautiful continuity.
Actually I tried to write an example but it was so terribly unclear I will just go with the gerenal question and will be more precise if needed :
-imagine you have like in DOTT, two houses with many rooms inside. You want music1 for one house(and all its rooms) and music2 for the other. Music 1 si on cause you play the main character in house1. The music doesn't restart every time you go from a room to the other(so you ant' use music1.play at each room load) but if you switch characters, you need the music to change to music2.
One last thing,in reality there are more than 2 houses and more than one music in one house so you can't just systematically change when you switch character.

I hope that is clear enough...I'm ready to explain as precisely as needed^^


Thanks a lot, and actually, maybe I should have posted different topics.

#27
Hi guys

Once again, it sounds like a stupid easy question but I guess it's not so obvious since I haven't found anything about it : How to copy a room ?
The game I'm working on mixes different times of the day, so the background will change to look like night and day. But the hotspots,walkbehinds, objets etc. remain the same.

I'm pretty sure I need to create a room for each part of the day, but could I copy the one I fully edited and just change the background so that I don't have to do everything again ?

Thanks a lot :)
#28
Hi guys

I'm a bit stuck on two (basic I guess) issues. Maybe you could help.

1) I know this question occurs often but so far I haven't found any accurate answer and it would suprise me if it weren't possible. I would like my "useinventory" cursor to change its sprite or to animate on hotspots, the way other cursors can. Is there a generic code that we can use somewhere? The idea is to make the interaction more visible. I suppose it would be a matter of changing the sprite to another one(say n+1) so you would have to create two icons for each item. But is there a way to make that work ?

2)second question is I think quite a classical too. But since many things have changed with 3.5, it's still hard for me to understand it. CAMERAS.
My game goes under the resolution 320*200. I'm glad with the way the camera follows the character.

But I want to make a little move of the camera in a cinematic cutscene. I would like the camera to move up for a short while, and then go down and back to normal. Just picture the character is in front of a skyscaper. The camera climbs to show how big it is and then you re back to the ground.
The "camera.setat" function does move the cam, but it does it automatically, in one frame. I would like it to really make the movement of climbing up.
Secondly, I guess I would have to make a background image of 320*600 (for instance). But then I would like it to NOT scroll up as the character moves, to stay to a 320*200 config. The top extension to 600 is just designed for the cinematic but then I dont want to be able to see it anymore. Do you see a solution for that ?

Thanks a lot in advance and sorry for my english. If I'm unclear I'll develop :)
#29
Hi guys

I want to be able to play several characters in my game. Like in DOTT or thimbleweed park, and to be able to pass items from one to another.

I found the cChar.SetAsplayer tool can switch characterplayers, but if it changes the inventory, speech color (so I guess it really did change characters)... I still have the same animating view as the initial character. Should I go with a changeview script or so ? But in this case do you know if it's gonna change my idle and thinking views that were already set for each player. Or is there an easier way.

Second little issue is about the GUI graphic. I made a cliquable GUI that switches from one character to the other using a variable. But I don't know how to change the picture of the GUI so that it displays the other character's portrait each time I change. I guess this is very basinc coding but I could find a precise answer in the manual.

Thanks in advance :)
SMF spam blocked by CleanTalk