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

#301
I was just looking through some of the threads here and I can't seem to find what I'm looking for. Is it currently possible to change the name of objects/hotspots/characters/anything from the script (hotspots and objects in particular)? Otherwise I have an idea of how to handle the problem I've encountered. Thanks for any help!  ;D
#302
How does the game determine what method of interaction it should use in the room script? The functions are named as "function hotspot2_a", "function hotspot2_b", etc. as they are created in the interaction menu. So if I make a script for "Look at hotspot" --> Run script, and then I make one for "Any click on hotspot" --> Game - Display a message, and then I delete the look at function in the interaction editor menu, any click is defined by "function hotspot2_b". But if I make the any click function first, it is named "hotspot2_a". The only distinguishing characteristics that I can see are the comment lines which read, i.e., "//script for hotspot2: Look at hotspot". So how does the game determine what you are intending to do with the function (what method of interaction)?

EDIT: Also, would changing the hotspot NAME affect this interaction? I have an extension in the hotspot name that I am using to determine the default right-click interaction for the hotspot, but I remove it in my script, so would that affect my scripts? (i.e. hotspot 2 is named "sky>o" but the ">o" part should be removed from the name so when it is added to my label it appears as "sky".
#303
In my global script I have this function:

Code: ags
function SetGlobalMode(int which){
  //if cursor isn't "give" mode of use
  if (invmode!=1) SetGlobalInt(100, which);
  //if cursor is "give" mode of use
  else if (invmode==1) SetGlobalInt(100, give);
  }


invmode is used to determine between use and give as they are the same cursor. give is #define(d) in the script header as 12. I then call this function in repeatedly_execute:

Code: ags
function repeatedly_execute(){// put anything you want to happen every game cycle here
  if (timer>0) timer--;
  if (timer==0){
    if (IsGUIOn(TEXTSPEED)==1) GUIOff(TEXTSPEED);
    if (IsGUIOn(VOLUME)==1) GUIOff(VOLUME);
    timer=-1;
    }
  mode=GetCursorMode();
  if (IsGUIOn(LOAD)==0) GUIOff(LOADLABEL);
  GetTextBoxText(SAVETEXTBOX, 1, textboxtext);
  if (IsGUIOn(SAVETEXTBOX)==0) SetTextBoxText(SAVETEXTBOX, 1, "");
  if (IsGUIOn(LOAD)==0) SetLabelText(LOAD, 2, "Choose a game to LOAD");
  while ((mode==walk) && (GetInvAt(mouse.x, mouse.y)!=-1)) SetCursorMode(lookat);
  UpdateLabelBar();
  KeyControls();
  Extension();
  HighlightDefaultMode();
  if (IsGUIOn(QUIT)==1) SetGUIClickable(MENU, 0);
  else if (IsGUIOn(QUIT)==0) SetGUIClickable(MENU, 1);
  InventoryArrows();
  if ((IsGUIOn(SAVE)==0) && (IsGUIOn(LOAD)==0)){
    GUIOff(LISTOVERLAY);
    ListBoxSetSelected(SAVE, 0, -1);
    ListBoxGetTopItem=0;
    }
  SetGlobalMode(mode);
  }


mode is set to the value of GetCursorMode(). Then, per SetGlobalMode(int which), GlobalInt 100 should equal the cursor mode, unless the mode is give, in which case it should be 12. I then check it in my room 1, hotspot 2 script... actually, I deleted that part of checking the Global int. Instead, I just have in Any Click on Hotspot (Run script):

Code: ags
Display("something");


No matter what mouse button I click, it never displays any message when I click on the hotspot. I have to go to bed...
#304
The keys '=' '-' '[' and ']' are not listed in the help file. Are they just not supported? Because by using a ASCII table in the C++ book I'm using to learn C++ I found the keys:

'=' = 61
'-' = 45
'[' = 91
']' = 93

So are these keys just not "officially supported", but still usable, like arrays? Because I tried using them, and the keys work with on_key_press, so I just don't understand why they aren't in the list. Sorry if this is the wrong thread...
#305
Basically it would be a lot easier to scroll a list box if you could just set the top item (ListBoxSetTopItem(int gui, int object, int topitem)) to the current top item plus a value (e.g. ListBoxSetTopItem(SAVE, 0, ListBoxGetTopItem(SAVE, 0)+4)). I found a way of doing this just storing the top item in the list box to an integer, but it would still be easier to be able to test the top item in the listbox. Yeah, I know, if I already found a way I really shouldn't be complaining because the suggestion list is already a mile long, but still... Ok... I've searched the forums and haven't seen this suggested yet, so I feel safe to post it.
#306
I'm trying to make a custom SAVE GUI without using the savegameindex array because I want a possible 99 save games. Also, is there a way to change the appearance of the selected item. I just want a textbox to be turned on at the selected item in my SAVE GUI, and I don't want it to be highlighted (with the foreground color). For those who don't already know, I'm making a Monkey Island 1 CD Version SCUMM GUI. It would be much easier if there were some way to turn off the highlight of the selected item... i don't know...
#307
For my scrolling inventory, I want the arrow buttons to ONLY be on if you can scroll the inventory in that direction. So, I made the following function which I call in repeatedly_execute():

Code: ags
function Inventory(){
Ã,  if (GetButtonPic(MAIN, 11, 1)==0) SetGUIObjectEnabled(MAIN, 11, 0);
Ã,  else SetGUIObjectEnabled(MAIN, 11, 1);
Ã,  if (GetButtonPic(MAIN, 12, 1)==0) SetGUIObjectEnabled(MAIN, 12, 0);
Ã,  else SetGUIObjectEnabled(MAIN, 12, 1);
Ã,  if (game.num_inv_items<=8){
Ã,  Ã,  SetButtonPic(MAIN, 11, 1, 0);
Ã,  Ã,  SetButtonPic(MAIN, 12, 1, 0);
Ã,  Ã,  }
Ã,  else if (game.num_inv_items>8){
Ã,  Ã,  if (game.top_inv_item==1){
Ã,  Ã,  Ã,  SetButtonPic(MAIN, 11, 1, 0);
Ã,  Ã,  Ã,  SetButtonPic(MAIN, 12, 1, 0);
Ã,  Ã,  Ã,  }
Ã,  Ã,  else if (game.num_inv_items<=game.top_inv_item+7){
Ã,  Ã,  Ã,  SetButtonPic(MAIN, 11, 1, 13);
Ã,  Ã,  Ã,  SetButtonPic(MAIN, 12, 1, 0);
Ã,  Ã,  Ã,  }
Ã,  Ã,  else if (game.num_inv_items>game.top_inv_item+7){
Ã,  Ã,  Ã,  SetButtonPic(MAIN, 11, 1, 13);
Ã,  Ã,  Ã,  SetButtonPic(MAIN, 12, 1, 14);
Ã,  Ã,  Ã,  }
Ã,  Ã,  }
Ã,  }


It works, except if the number of inventory items is <=8 at the start of the game, it takes a second to turn off the buttons. Nevermind, I fixed this by moving this function before game_start(), and calling it there so when the first room loads it has already checked the inventory. My other problem is that if the inventory is scrolled all the way to the top, the up arrow, button 11, should have it's image set to 0, but it isn't. If num_inv_items<=8, both buttons 11 and 12 are off. If num_inv_items==9 (for example), both buttons are on when I scroll to the very top of the inventory box, but the down button (12) is off when I scroll to the very bottom of the inventory. I'm sorry if this is confusing...

EDIT: I think it may have to do with the line:

Code: ags
if (game.top_inv_item==1)


But I'm not sure what to use to check if the inventory is scrolled all the way to the top...

EDIT: I appear to have posted too soon:

Code: ags
function Inventory(){
Ã,  if (GetButtonPic(MAIN, 11, 1)==0) SetGUIObjectEnabled(MAIN, 11, 0);
Ã,  else SetGUIObjectEnabled(MAIN, 11, 1);
Ã,  if (GetButtonPic(MAIN, 12, 1)==0) SetGUIObjectEnabled(MAIN, 12, 0);
Ã,  else SetGUIObjectEnabled(MAIN, 12, 1);
Ã,  if (game.num_inv_items<=8){
Ã,  Ã,  SetButtonPic(MAIN, 11, 1, 0);
Ã,  Ã,  SetButtonPic(MAIN, 12, 1, 0);
Ã,  Ã,  }
Ã,  else if (game.num_inv_items>8){
Ã,  Ã,  if (game.num_inv_items<=game.top_inv_item+7){
Ã,  Ã,  Ã,  SetButtonPic(MAIN, 11, 1, 13);
Ã,  Ã,  Ã,  SetButtonPic(MAIN, 12, 1, 0);
Ã,  Ã,  Ã,  }
Ã,  Ã,  else if (game.num_inv_items>game.top_inv_item+7){
Ã,  Ã,  Ã,  if (game.top_inv_item<4){
Ã,  Ã,  Ã,  Ã,  SetButtonPic(MAIN, 11, 1, 0);
Ã,  Ã,  Ã,  Ã,  SetButtonPic(MAIN, 12, 1, 14);
Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  else{
Ã,  Ã,  Ã,  Ã,  SetButtonPic(MAIN, 11, 1, 13);
Ã,  Ã,  Ã,  Ã,  SetButtonPic(MAIN, 12, 1, 14);
Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  }
Ã,  Ã,  }
Ã,  }


Works like a charm...
#308
The help file says that

QuoteThe save game list can only hold 20 save games.

Is there any way to change this amount. I know that Proskrito somehow implemented 99 save slots (which is what I want to do) but I don't know how he did it (and his scripts confuse me (ARRAYS???)). Thanks.
#309
Is it possible to have non-square GUI buttons? Because, upon checking against the source for my GUI (The Secret Of Monkey Island CD), I realized that the buttons should ONLY be highlighted if the cursor is over the text of the button. Also, I have another question. Is there a better color for me to use that AGS #593918287? I'm aiming for 7B2C7B, and that's the closest I can get. It's off by 3 green, but the green appears to change by units of eight. Thanks for help with either problem!

EDIT: Regarding how I came up with such a long number for the text color, I realized that the AGS palette has more than just 15 colors, the unit of change is just small. Needless to say, 79 (yes, 79. It's actually more, but I got tired of trying new numbers, then making a new document and pasting it, and just started using layers...) Photoshop layers, a worn-half-to-death Prt Scrn button, and 2 saggy eyes later, I'm only 3 (7B297B instead of 7B2C7B) green away, but I don't think it's possible to change the green color by 1 is it?
#310
See lastest post for confession of my presumptious presumptions, and another not-really-that-important "problem".  :P

SEE THE LAST POST FOR LASTEST SCRIPT INFO.

In order to provide both keyboard and mouse cursor control, I have the following script:

Code: ags
#sectionstart on_eventÃ,  //DO NOT EDIT OR REMOVE THIS LINE
function on_event(int event, int data){
Ã,  if ((event==GUI_MDOWN) && (data==MAIN)){
Ã,  Ã,  if (GetGUIObjectAt(mouse.x, mouse.y)==1){
Ã,  Ã,  Ã,  SetMode(give);
Ã,  Ã,  Ã,  if (IsKeyPressed(keyenter)==1)Ã,  SetButtonPic(MAIN, 1, 1, 11);
Ã,  Ã,  Ã,  else if (IsKeyPressed(keyenter)==0) SetButtonPic(MAIN, 1, 1, 2);
Ã,  Ã,  Ã,  }
Ã,  Ã,  else if (GetGUIObjectAt(mouse.x, mouse.y)==2){
Ã,  Ã,  Ã,  SetMode(open);
Ã,  Ã,  Ã,  if (IsKeyPressed(keyenter)==1) SetButtonPic(MAIN, 2, 1, 12);
Ã,  Ã,  Ã,  else if (IsKeyPressed(keyenter)==0) SetButtonPic(MAIN, 2, 1, 3);
Ã,  Ã,  Ã,  }
Ã,  Ã,  else if (GetGUIObjectAt(mouse.x, mouse.y)==3){
Ã,  Ã,  Ã,  SetMode(close);
Ã,  Ã,  Ã,  if (IsKeyPressed(keyenter)==1) SetButtonPic(MAIN, 3, 1, 13);
Ã,  Ã,  Ã,  else if (IsKeyPressed(keyenter)==0) SetButtonPic(MAIN, 3, 1, 4);
Ã,  Ã,  Ã,  }
Ã,  Ã,  else if (GetGUIObjectAt(mouse.x, mouse.y)==4){
Ã,  Ã,  Ã,  SetMode(pickup);
Ã,  Ã,  Ã,  if (IsKeyPressed(keyenter)==1) SetButtonPic(MAIN, 4, 1, 14);
Ã,  Ã,  Ã,  else if (IsKeyPressed(keyenter)==0) SetButtonPic(MAIN, 4, 1, 5);
Ã,  Ã,  Ã,  }
Ã,  Ã,  else if (GetGUIObjectAt(mouse.x, mouse.y)==5){
Ã,  Ã,  Ã,  SetMode(lookat);
Ã,  Ã,  Ã,  if (IsKeyPressed(keyenter)==1) SetButtonPic(MAIN, 5, 1, 15);
Ã,  Ã,  Ã,  else if (IsKeyPressed(keyenter)==0) SetButtonPic(MAIN, 5, 1, 6);
Ã,  Ã,  Ã,  }
Ã,  Ã,  else if (GetGUIObjectAt(mouse.x, mouse.y)==6){
Ã,  Ã,  Ã,  SetMode(talkto);
Ã,  Ã,  Ã,  if (IsKeyPressed(keyenter)==1) SetButtonPic(MAIN, 6, 1, 16);
Ã,  Ã,  Ã,  else if (IsKeyPressed(keyenter)==0) SetButtonPic(MAIN, 6, 1, 7);
Ã,  Ã,  Ã,  }
Ã,  Ã,  else if (GetGUIObjectAt(mouse.x, mouse.y)==7){
Ã,  Ã,  Ã,  SetMode(use);
Ã,  Ã,  Ã,  if (IsKeyPressed(keyenter)==1) SetButtonPic(MAIN, 7, 1, 17);
Ã,  Ã,  Ã,  else if (IsKeyPressed(keyenter)==0) SetButtonPic(MAIN, 7, 1, 8);
Ã,  Ã,  Ã,  }
Ã,  Ã,  else if (GetGUIObjectAt(mouse.x, mouse.y)==8){
Ã,  Ã,  Ã,  SetMode(push);
Ã,  Ã,  Ã,  if (IsKeyPressed(keyenter)==1) SetButtonPic(MAIN, 8, 1, 18);
Ã,  Ã,  Ã,  else if (IsKeyPressed(keyenter)==0) SetButtonPic(MAIN, 8, 1, 9);
Ã,  Ã,  Ã,  }
Ã,  Ã,  else if (GetGUIObjectAt(mouse.x, mouse.y)==9){
Ã,  Ã,  Ã,  SetMode(pull);
Ã,  Ã,  Ã,  if (IsKeyPressed(keyenter)==1) SetButtonPic(MAIN, 9, 1, 19);
Ã,  Ã,  Ã,  else if (IsKeyPressed(keyenter)==0) SetButtonPic(MAIN, 9, 1, 10);
Ã,  Ã,  Ã,  }
Ã,  Ã,  }
Ã,  else if ((event==GUI_MUP) && (data==MAIN)){
Ã,  Ã,  SetButtonPic(MAIN, 1, 1, 2);
Ã,  Ã,  SetButtonPic(MAIN, 2, 1, 3);
Ã,  Ã,  SetButtonPic(MAIN, 3, 1, 4);
Ã,  Ã,  SetButtonPic(MAIN, 4, 1, 5);
Ã,  Ã,  SetButtonPic(MAIN, 5, 1, 6);
Ã,  Ã,  SetButtonPic(MAIN, 6, 1, 7);
Ã,  Ã,  SetButtonPic(MAIN, 7, 1, 8);
Ã,  Ã,  SetButtonPic(MAIN, 8, 1, 9);
Ã,  Ã,  SetButtonPic(MAIN, 9, 1, 10);
Ã,  Ã,  }
Ã,  }
#sectionend on_eventÃ,  //DO NOT EDIT OR REMOVE THIS LINE

function KeyControls(){
Ã,  if (IsKeyPressed(keyg)==1) SetMode(give);
Ã,  if (IsKeyPressed(keyo)==1) SetMode(open);
Ã,  if (IsKeyPressed(keyc)==1) SetMode(close);
Ã,  if (IsKeyPressed(keyl)==1) SetMode(lookat);
Ã,  if (IsKeyPressed(keyp)==1) SetMode(pickup);
Ã,  if (IsKeyPressed(keyt)==1) SetMode(talkto);
Ã,  if (IsKeyPressed(keyu)==1) SetMode(use);
Ã,  if (IsKeyPressed(keys)==1) SetMode(push);
Ã,  if (IsKeyPressed(keyy)==1){
/*Ã,  Ã,  if (IsGUIOn(WIN)==1){
Ã,  Ã,  Ã,  //script for win
Ã,  Ã,  Ã,  }
Ã,  Ã,  else if (IsGUIOn(QUIT)==1){
Ã,  Ã,  Ã,  //script for quit
Ã,  Ã,  Ã,  }
Ã,  Ã,  else if (IsGUIOn(RESTART)==1){
Ã,  Ã,  Ã,  //script for restart
Ã,  Ã,  Ã,  }
Ã,  Ã,  else{*/
Ã,  Ã,  Ã,  SetMode(pull);
//Ã,  Ã,  Ã,  }
Ã,  Ã,  }
Ã,  if (IsKeyPressed(keyup)==1) SetMousePosition(mouse.x, mouse.y-2);
Ã,  if (IsKeyPressed(keydown)==1) SetMousePosition(mouse.x, mouse.y+2);
Ã,  if (IsKeyPressed(keyleft)==1) SetMousePosition(mouse.x-2, mouse.y);
Ã,  if (IsKeyPressed(keyright)==1) SetMousePosition(mouse.x+2, mouse.y);
Ã,  if (GetGUIAt(mouse.x, mouse.y)!=-1){
Ã,  Ã,  if (IsKeyPressed(keyenter)==1) on_event(GUI_MDOWN, MAIN);
Ã,  Ã,  else if (IsKeyPressed(keyenter)==0) on_event(GUI_MUP, MAIN);
Ã,  Ã,  }
Ã,  }


and:

Code: ags
#sectionstart repeatedly_executeÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function repeatedly_execute(){
Ã,  // put anything you want to happen every game cycle here
Ã,  UpdateLabelBar();
Ã,  KeyControls();
Ã,  }
#sectionend repeatedly_executeÃ,  // DO NOT EDIT OR REMOVE THIS LINE


The script works fine, with one small problem. I can move the mouse cursor with both the arrow buttons and the mouse, and I can click on my GUI's buttons with both the mouse and the enter key. The problem: If I hold enter down, and move the mouse cursor (by either method), it selects (highlights) multiple buttons, and then returns them to normal when enter is released, and stops changing the cursor mode (with each button the cursor is moved over while enter is pressed, it changes the cursor mode). So, how can I tell the game that if you press enter while the cursor is over a button, to change the cursor mode, if enter is held, to leave the button highlighted, and when enter is release to restore the button pictures UNLESS the cursor is moved OFF the button that enter is initially pressed over. I know this sounds very confusing (at least to me), but that's why I'm asking for help...Ã,  :P
#311
Is it possible to find out what the button picture is of the button at coordinates (mouse.x, mouse.y)? I'm trying to script keyboard control of the mouse cursor with the arrows moving the cursor (works), enter performing a left click (works), and tab performing a right click (works). I say that the left and right clicks work, but there is one complication. I have the script to run the on_mouse_click function for LEFT or RIGHT on enter and tab respectively. This doesn't highlight the buttons as the "pushed image" does when I left or right click with the mouse. I tried doing this:

SetButtonPic(GetGUIAt(mouse.x, mouse.y), GetGUIObjectAt(mouse.x, mouse.y), 1,

and then I encountered an error. I had hoped to use something like "GetButtonPic(GetGUIAt(mouse.x, mouse.y), GetGUIObjectAt(mouse.x, mouse.y))+1", but GetButtonPic isn't one of the engine's functions... Does anyone know how to do this?

EDIT: I forgot to mention, and not sure if it matters, but I want keyboard AND mouse control of the mouse cursor.

EDIT: I just searched the forums, and found that Goot asked a similar question nearly a month ago. He seemed to know an alternate, although lengthy way of doing it involving ints? Also, could this function perhaps become a suggestion for the next version of AGS? I would like to see this if it is possible...  ;D
#312
There's been a lot of talk about using @OVERHOTSPOT@ on a label versus using GetLocationName for a LucasArts style statusbar. I have a question about this. Is @OVERHOTSPOT@ capable of displaying the names of characters and objects? Because it would kind of be a hassle to have to add hotspots everywhere that there is an object or character. Just wondering...
#313
I have searched the manual, and I don't know how to do this. I found GetInvName, but the help manual says to use player.activeinv, and mouse.x, mouse.y doesn't work. I need to make it so when the mouse is over an inventory item it adds the inventory's name to my label. I'm already using GetLocationName for hotspots, objects, and characters, but it doesn't add inventory names. Thanks in advance!
#314
Just as a test of the features, I'd like to try and get the character to display the score. There are only two possible scores. 0 or 800. The only way I can find of displaying the score is @SCORE@ and @TOTALSCORE@, but I can't use these in a display message.
#315
Ok, I got pretty retarded for a while, but after looking at my alternatives, although there are more powerful ways of getting this done, I'm not sure I'm ready to go somewhere else. AGS is pretty powerful. I'd like to make at least a couple games with AGS before I leave completely. I'd like to learn C and write an engine myself, but there's a lot I'd LIKE to do. So, I think I'll still be producing TMI with AGS. As for the GUI I'm building, I'm having a lot of problems. It's hard for me to describe, so I'll let some of you play around with it and tell me what I can do to fix it. I'm uploading the entire folder (for the game, not just Compiled) to my website:

http://www.meleepta.us.tf/files/GUIBuilder.zip

Thanks for the help in advance. Some thing I know, but don't know how to fix:
When you click on a button, it will sometimes highlight the button above the one you clicked, and when you release the mouse button, it creates a very jerky movement as the cursor jumps to a set point???
#316
Critics' Lounge / Critique me!
Thu 29/07/2004 21:59:22
Here's me getting run over by a carÃ,  :o :

http://www32.brinkster.com/monkey0506/temp3+tires.gif

And, a WIP, the local library:



EDIT: I decided NOT to show the first image. It's rather large. Also, kind of decieving. It should be "me after getting run over by a car" not "me getting run over by a car"...

EDIT II: Here's the original picture for the library:



Like I said, that first pic of the library is a Work in Progress...
#317
Is it possible to rescript alt-x? In true SOMI style, if you press alt-x it turns on the quit gui, so I'd like to do that if it's possible. I'm trying to get as close to true SOMI style as possible...
#318
Searched, and couldn't find anything related to this. I scripted a GUI Slider for volume control, which works fine. The only problem is, there isn't much of a change in the volume. I was wondering if it's possible to change the intervals by which the slider handle moves at. If not, I think I know another way, but it's a lot harder...
#319
I have noticed that when I set my cursor hotspot, the bottom of the character's feet go to the cursor hotspot. I need to make it to where it centers the character at the center of the cursor. Like in MI1/MI2. I have searched the help files and the forums, but can't find how to do this. Thanks ahead of time!
#320
My "Prt Scr" button does not work while I have DOS open for some reason, SCUMMVM replaces this GUI with it's own, and DOSBox no longer reads my SOMI CD. What I'm looking for is an unedited screencapture taken directly from The Secret of Monkey Island. I need the GUI that displays on keypress F8, the restart GUI. I have recently found myself incapable of getting any more screenshots of the standard Popup GUIs. Please do not post a reply telling me to use PrtScr, ScummVM, or DosBox. I cannot get them to work. I am just looking for an unedited screen capture. Any help would be appreciated. Thank you.
SMF spam blocked by CleanTalk