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

#141
Quote from: strazer on Thu 03/02/2005 01:57:06
Try this:

Code: ags

function on_event(int event, int data) {
Ã,  //...
Ã,  
Ã,  if (event == GUI_MDOWN) { // if mouse button pressed when over a GUI
Ã,  Ã,  if (IsButtonDown(RIGHT)) { // if right mouse button pressed
Ã,  Ã,  Ã,  on_mouse_click(RIGHT); // call on-mouse-click function for default right mouse button action
Ã,  Ã,  }
Ã,  }

Ã,  //...
}


and make sure on_event is located after the on_mouse_click function in the script so it can call it.

I'm afraid I don't follow you... Where in the global script am I supposed to put this? I tried putting it "after" the on_mouse_click function, but I have a feeling I really don't know what I'm doing... (How) does this correspod with the show_inventory_window() function?

Do I need a show_inventory_window() function if I want AGS to handle inventory clicks in script? Do I want AGS to handle inventory clicks in script?? *Sigh*, I've got so many questions inside my head right now...

Here's the entire global script, hoping for further directions... : global.txt

#142
Almost all AGS games uses buttons within the inventory GUI to change the mouse cursor's looks and behaviour. What I've tried for quite some time is to have the mouse cursor change the same way by right-clicking the mouse inside the custom GUI as when right-clicking inside the gaming part, a task I have yet to succeed in.


Let's take a look at parts of the global script:

In repeatedly execute:
Code: ags

// Script that changes icon of the mouse whenever there's something you can interact with underneath.

string name;
GetLocationName(mouse.x, mouse.y, name);	// Get the name of what's under the cursor	
if (StrComp(name,"")==0) SetDefaultCursor();	// if blank ( or hotspot with no name ) do nothing	
else {	
   if (GetCursorMode()==1) {
      if (GetLocationType(mouse.x,mouse.y)>0) SetMouseCursor(8);
   else SetDefaultCursor(); 
   }
   if (GetCursorMode()==2) {
      if (GetLocationType(mouse.x,mouse.y)>0) SetMouseCursor(9); 
   else SetDefaultCursor(); 
   }
   if (GetCursorMode()==3) {
      if (GetLocationType(mouse.x,mouse.y)==2) SetMouseCursor(10);
   else SetDefaultCursor(); 
   }
}


// This snippet just turns the inventory off if clicked outside of it before entering, or if the cursor has entered - and then moves out of it.

if (IsGUIOn(INVENTORY)){
    // Checks if mouse has moved onto GUI...
    if (((mouse.x > 50) && (mouse.x < 270)) && ((mouse.y > 35) && (mouse.y < 165))) {
    SetGlobalInt(1, 1); // Mouse HAS entered GUI!
    }
  
    // Checks if the mouse has entered the GUI...
    if (GetGlobalInt(1)==1) {
       // Checks if mouse is still over the GUI...
       if ((mouse.x < 50) || (mouse.x > 270) || (mouse.y < 35) || (mouse.y > 165)) {
          //If not:
          GUIOff(INVENTORY);
          SetGlobalInt(1, 0);
          }
       }
    }
  
    // Closes GUI if clicked outside GUI before entering it
    if (GetGlobalInt(1)==0) {
      if ((IsButtonDown(RIGHT)) || (IsButtonDown(LEFT))) {
        GUIOff(INVENTORY);
        SetGlobalInt(1, 0);
      }
    }


No need to change anything here, is it?


function show_inventory_window()
Code: ags

function show_inventory_window() {
  
  GUIOn (INVENTORY);
  
  SetMouseCursor(6);
  SetCursorMode(2);
  
}


I guess this is the part where I have to add new code? The problem is whenever I try to program something when the "handle inventory clicks in script" box is checked, I can't make anything work. It has to be checked in order to add this kind of "advanced" feature, no?

I haven't been able to find an answer to this "right-click to change mouse actions inside custom inventory GUI" riddle anywhere on the forums, which I think is kind of strange. Is it possible to implement this feature into the game?
#143
Quote from: Goot on Wed 02/02/2005 05:13:43
QuoteSetButtonPic(YOURGUI, BUTTONNUMBER, 1, 0)
Are you sure this won't set the picture to a blue cup? If it does, there's a command (SetGUIObjectPosition?) which sets the coordinates of a GUI object, so you can move it somewhere off the screen when you're done with it.

I didn't try the other thing as I really didn't understand it or even look into it, but this worked perfectly. Thanks.
#144
I'm in the middle of creating an icon-based dialog system similar to the one in Sam and Max... I'm wondering, is there a way of manipulating Objects / Buttons within a GUI? For example, when the user has clicked an icon and it runs a dialog, I want some buttons to just disappear afterwards.

Please tell me I don't have to use several GUI's to accomplish this...
#145
Yes, that seemed to work, but with some modifications. Here's the code I'm using:

Code: ags


if (IsGUIOn(INVENTORY)){
Ã,  Ã,  // Checks if mouse has moved onto GUI...
Ã,  Ã,  if (((mouse.x > 50) && (mouse.x < 270)) && ((mouse.y > 35) && (mouse.y < 165))) {
Ã,  Ã,  SetGlobalInt(1, 1); // Mouse HAS entered GUI!
Ã,  Ã,  }
Ã,  
Ã,  Ã,  // Checks if the mouse has entered the GUI...
Ã,  Ã,  if (GetGlobalInt(1)==1) {
Ã,  Ã,  Ã,  Ã, // Checks if mouse is still over the GUI...
Ã,  Ã,  Ã,  Ã, if ((mouse.x < 50) || (mouse.x > 270) || (mouse.y < 35) || (mouse.y > 165)) {
Ã,  Ã,  Ã,  Ã,  Ã,  //If not:
Ã,  Ã,  Ã,  Ã,  Ã,  GUIOff(INVENTORY);
Ã,  Ã,  Ã,  Ã,  Ã,  SetGlobalInt(1, 0);
Ã,  Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  Ã, }
Ã,  Ã,  }
Ã,  
Ã,  Ã,  // Closes GUI if clicked outside GUI before entering it
Ã,  Ã,  if (GetGlobalInt(1)==0) {
Ã,  Ã,  Ã,  if ((IsButtonDown(RIGHT)) || (IsButtonDown(LEFT))) {
Ã,  Ã,  Ã,  Ã,  GUIOff(INVENTORY);
Ã,  Ã,  Ã,  Ã,  SetGlobalInt(1, 0);
Ã,  Ã,  Ã,  }
Ã,  Ã,  }



This way, the inventory window works as in Monkey Island 3. I'm sure it can be written shorter, but it works! :)
#146
Does anyone know how to get AGS to automatically close the GUI when the mouse hovers outside it? I'm trying to make a custom inventory GUI that closes when the mouse is outside of it...

Code: ags
#sectionend repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE

function show_inventory_window() {
  
  GUIOn (INVENTORY);  
  // switch to the Use cursor (to select items with)
    SetCursorMode (MODE_USE);
  // But, override the appearance to look like the arrow
  SetMouseCursor (6);
}



Additionally, does anyone know why the SetMouseCursor command doesn't change the cursors appearance to cursor number 6, but instead it uses the "Use" cursor instead? If I understand the function correctly, you're supposed to be able to have the cursor appear as you like, but with the use function.

Does anyone know why this isn't working?

I couldn't find any answers anywhere to these little riddles...
#147
Completed Game Announcements / Re: The Cell
Fri 14/01/2005 18:42:40
Here's some things you should consider looking into:

- Make the player aware of what the point of the game is.
- Try to add at least SOME text when you look at items in-game.
- You have to pixel hunt the pillow to find the spoon but aren't told when you actually pick it up? I clicked on the pillow for 1 minute straight before I decided to check if I had anything in the inventory...

???
#148
Well, that was certainly an interesting experience... Is this a medium or a long-sized game?

Spoiler
I'm having a little problem setting off the dynamite... got any tips?
[close]
#149
Completed Game Announcements / Re: Frog Island
Fri 26/11/2004 16:23:21
Quote from: monkey_05_06 on Sat 20/11/2004 20:30:55

Of course LucasArts doesn't like people using their copyrighted material without even giving them credit for it. Put them in the credits or they could make you change the music. But LucasArts isn't so bad as they used to be about making people change stuff like that.

Oh, they are mentioned in the readme file, check under "Legal Stuff"...

Quote from: monkey_05_06 on Sat 20/11/2004 20:30:55
This game was funny. But it was so horrible. wait... how do you put a spoiler?

Spoiler
You hit that kid in the head with a shovel, and then you shove a grenade down the frog's throat and kill it as well as the guard. That's not cool...
[close]

But still a funny game...

Did you honestly feel sorry for the frog? I don't know whether that's a good thing or a bad thing, but I would have thought the sound effects made the voilence more acceptable / funny. I don't think the voilence in Frog Island is worse than what you see in any random episode of Tom & Jerry.

Also, hitting that kid in the head (isn't he all head?) with a shovel was your choice, you could've finished the game without knocking him out, or even ruining his sand castle! Shame on you!

PS: I loved your description of the voilence in the game, it warms my heart every time I read it.Ã,  :)
#150
Completed Game Announcements / Re: Frog Island
Sat 13/11/2004 18:26:09
Quote from: Ieremiou on Sat 13/11/2004 05:10:45
Oooh, C64 (Commodore 64) music.. Download.. I'm a sucker for old SID tunes now most are under the term.. Chiptunes as I've been hearing (and spreading)... :).

From the previous posts it sounds pretty good.

Nice game, very clever animations... annoying kid.
Alas, all I heard were sound effects and no music.. :-\

Is your midi volume muted or set very low? If you don't know how to check it out, here's how: Go into Control Panel, hit Sounds and Audio Devices, and under Volume / Device Volume click Advanced (It's possible that you have a shortcut to this in your traybar). How is Midi synth positioned? Try dragging it all the way to the top. I can't think of anything else... it's just an ordinary AGS game.  ???
#151
Spoiler
The part where Titanic 2 dodges the ice berg and immidiately is struck by a meteor was brilliant!
[close]

:D
#152
Completed Game Announcements / Re: Frog Island
Wed 03/11/2004 16:14:38
Quote from: Geoffkhan on Wed 03/11/2004 03:43:11
Congrats on the first game!

Backgrounds look great -- are they drawn over photographs or something?

The backgrounds are a mixture of original art and pieced together photographs that's been through a variety of photoshop filters and colour changes to make them look "cartoony".

For example, the second screenshot consists of 5 different parts of photographs that was filtered and changed by hand, grass texture similar to that of the fourth screenshot, and lots and lots of colour changes to give it a "tropical" and light feel.

But that's not for you to worry about, just try to enjoy the game!Ã,  ;)



Quote from: Gilbot V7000a on Wed 03/11/2004 04:10:40
HAHAHA very funny game. Animations are nice, wish it's a bit longer. PACMAN!

Spoiler

Does "GAME OVER" mean that I had actually completed the game? :=
[close]


Yep, sorry! The thing is that with this game, I wanted to make it as good as possible in terms of interactivity and detail, and that usually means shorter gameplay! But, making a short game that you're content with is more important than making a longer that's got this half-finished feel to it, don't you agree?Ã,  :)
#153
Completed Game Announcements / Frog Island
Wed 03/11/2004 02:50:09
Audunsoft proudly presents Frog Island v1.00!

After surviving a horrible accident, you wake up on... Frog Island! Your goal is to get past the hideous french guard with a baguette which is, of reasons unknown, stopping anyone from leaving the area. Frog Island is a short adventure game about a creature stuck on an island with a gigantic frog, an unhappy banjo player and good rhythms!


Features:

- Runs in the good old 320 x 200 resolution
- 16 bit colour
- At least 15 minutes of gameplay
- Same kind of interface as in Sam & Max
- Almost 10 different background images
- A broad variety of ingame sounds
- Cutscenes that will blow you away
- A main character with some serious personality


Screenshots:




Download

readme.txt
frog_island.zip 1.8 MB (fastest)
frog_island_installer.exe 1.8 MB (installer that creates start menu group w/ uninstaller)


Notes

I've worked on this game for a couple of months, off and on, while learning AGS at the same time. As it's my first game, please be gentle with me.

I hope you enjoy playing it, and that you leave a message on the games' homepage (http://audunsoft.moo.no) as well as here when you've tried it out!
#154
Thanks to both of you, my problems are now solved. I can't believe I never thought about the "No Interaction" function, I always thought it was something completely different...

As for the idle character animation, it was solved by SetCharacterIdle function. Thanks again!
#155
These are questions that have bothered me during the entire making of it, and I can't find any answers to them on these forums.Ã,  :\


1. How do you make the mouse totally ignore the player character? Like, for example, in Lucasarts games, when you click on the player character, it acts like you weren't even there.Ã,  If there's something behind you, you get to click that item. Basically the opposite of Sierra games where you can touch yourself and silly things like that.

Will there be any problems implementing this when I'm using a Sam'n Max interface where the cursor changes when it's over objects and characters. As the game is now, I get a cursor change over the ego character, which I don't want. I figure this will be solved if I can somehow 'disable' the player interactive-wise as described above?

Here's the code that's used to do the mousecursor changes:

Quotestring name;
GetLocationName(mouse.x, mouse.y, name);   // Get the name of what's under the cursor   
if (StrComp(name,"")==0) SetDefaultCursor();   // if blank ( or hotspot with no name ) do nothing   
else {   
Ã,  Ã, if (GetCursorMode()==1) {
Ã,  Ã,  Ã,  if (GetLocationType(mouse.x,mouse.y)>0) SetMouseCursor(8);
Ã,  Ã, else SetDefaultCursor();
Ã,  Ã, }
Ã,  Ã, if (GetCursorMode()==2) {
Ã,  Ã,  Ã,  if (GetLocationType(mouse.x,mouse.y)>0) SetMouseCursor(9);
Ã,  Ã, else SetDefaultCursor();
Ã,  Ã, }
Ã,  Ã, if (GetCursorMode()==3) {
Ã,  Ã,  Ã,  if (GetLocationType(mouse.x,mouse.y)==2) SetMouseCursor(10);
Ã,  Ã, else SetDefaultCursor();
Ã,  Ã, }
}




2.Ã,  This will seem really silly. I've got a character that is set to have a static view until a global variable is changed, then he is going to continously run a loop until he's talked to, in which he will run a simple talking animation. When done talking to him, he will go back to his continous loop.

I guess basically what I'm asking is: How do you make a character run a continous loop (triggered by a global variable) as long as he's not being talked to?
#156
Thanks! It's kinda weird I couldn't find any other people wondering about the same thing!
#157
I've got kind of a problem I can't find any solution to anywhere, so I'm asking you here.

There's this intro cutscene with a quite long wav file playing, 10 seconds long or so. If I choose to skip the intro during this time, the sound file will keep on playing even though the game skips to the EndCutscene(); part of the script. How to I stop all sounds / this sound when I choose to skip the intro?

It seems very unprofessional when it's like this...Ã,  :-[
#158
It works perfectly now! Thanks everyone!  :)
Global variables actually *are* useful!
#159
Quote from: Gilbot V7000a on Thu 09/09/2004 02:34:43
And, as you want different behaviours, you can just keep tracking it with a global variable (you can use GlobalInt, check the functions SetGlobalInt() and GetGlobalInt() ), for example when the character's appearance changes, set the variable to 1, and you can script his behaviour differently according to the value of the variable.

I couldn't find any info either in the manual or anywhere on the forums on how to use this function...

Would you be as kind as to explain how this is done?  I really didn't understand anything of what you just said.Ã,  :(
#160
No need to introduce myself - I'll jump right to the problem:


I'm making a game where, when I give an item to a character, this character should change behaviour completely. When I look at this character after I've given the item, it should give a different response than before. The same goes for talking to the character. I have solved this by running the script:

Quote
character[CHARACTERBEFOREITEM].room = -1;
character[CHARACTERAFTERITEM].room = 5;

Basically it replaces the old character with a new one. Maybe this is a bit amateur-ish, but I'm pretty new to all of this.

Here's the dilemma: When I give the original character the item that will transform him into the new one, it's set to run a dialog at the same time. But, as the old character is deleted at this very moment, the text he speaks moves to the center of the room (as the original character is no longer in the room!), and is not hovering over the head of the new character.


So what I'm asking is, how do I, when I give an item to a character, make *another* character respond to this?
SMF spam blocked by CleanTalk