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

#1701
Glad I could help. :)

As for the GUI mouse clicks, I did it like this:

Code: ags

// main global script file

int guimb; // stores mouse button clicked on gui

function on_event(int event, int data) {
  //...

  if (event == GUI_MDOWN) { // if mouse clicked over a gui
    if (IsButtonDown(LEFT)) guimb = LEFT; // if left mouse button pressed, store it in variable
    else if (IsButtonDown(RIGHT)) guimb = RIGHT; // if right mouse button pressed, store it in variable
    // and so on...
  }

  //...
}

function interface_click(int interface, int button) {
  //...

  if (interface == GUI1) {
    if (button == 0) {
      // do stuff
    }
  }

  if (guimb != LEFT) return; // only allow left mouse click on the following guis:

  if (interface == GUI2) {
    if (button == 0) {
      // do stuff
    }
  }

  //...
}


Edit: Minor syntax corrections.
#1702
Sure, go ahead. :)
#1703
Quote from: Pumaman on Sat 13/11/2004 21:02:00
Changes from Beta 15 to Beta 16:
* Added game.show_single_dialog_option to specify that the dialog option should be displayed, even if only one is available.
#1704
Are you sure it's not the sound output setting?

Quote from: Pumaman on Sun 23/05/2004 17:42:04
I just tried changing my Winamp Output Plugin to DirectSound rather than WaveOut and you're right, running an AGS game then stops the winamp output. I'm not sure why this is because AGS starts up DirectSound with a non-exclusive cooperative level, so it should continue playing.

Anyway, the workaround is to set Winamp to use the WaveOut plugin.
#1705
Why don't you use run-script & dialog_request to play animations?
There's also the set-speech-view command to change facial expressions.
#1706
Quote from: Pumaman on Sun 06/02/2005 22:45:39
Ugh, GetGameParameter looks so ugly now in comparison to the new OO stuff. But I mustn't get carried away, we're done with objectising things for now!

I'll see what I can do.

As I wrote in my edit above, I don't need it anymore since ItemCount and ItemAtIndex work much better.
As for objectizing, yeah, that would be nice, but is not that important. We can always add it to the tracker.
#1707
According to the manual, ChangeCursorGraphic should permanently change the mouse cursor's graphic, but it does seem to try to use the activated inv item's graphic again if you cycle to it.
Ok, I did it like this, and it works:

Code: ags

  else if (button == LEFTINV) { // if left-clicked on an inventory item

    if (GetCursorMode() == MODE_USE) {
      if (character[GetPlayerCharacter()].activeinv != -1) SetInvItemPic(character[GetPlayerCharacter()].activeinv, oldItemGraphic); // if another item is already active, reset its sprite to its old sprite slot
      SetActiveInventory(game.inv_activated); // activate the clicked item
      oldItemGraphic = GetInvGraphic(game.inv_activated); // save clicked item's old sprite slot
      SetInvItemPic(game.inv_activated, 0); // remove clicked item's sprite
      ChangeCursorGraphic(MODE_USEINV, oldItemGraphic); // set mouse cursor to item's old sprite
    }

  }

  else if (button == RIGHT) {
    SetNextCursorMode(); // cycle to next cursor mode
    if (GetCursorMode() == MODE_USEINV) ChangeCursorGraphic(MODE_USEINV, oldItemGraphic); // if new mode is an activated inv item, set mouse cursor to item's old sprite
  }
#1708
Ah, stupid me!

Try
  ChangeCursorGraphic(3, oldItemGraphic);
#1709
Any chance of a GP_NUMINVITEMS for GetGameParameter?
I use the mouse wheel to let the user scroll through his inventory items, jumping to the last one when he reached the first one.
Since it seems a character's InventoryQuantity array is only as big as the number of inventory items in the game, I can't use AGS_MAX_INV_ITEMS as a starting point for the while loop to find the last item since it produces an out-of-bounds error.

Edit:

Nevermind, I use InvWindow.ItemAtIndex and InvWindow.ItemCount now, much better!

Edit 2:

Quoterenamed Can Be Walked Through to Solid

Since you also reversed its behaviour, the tooltip needs an update. So does the tooltip for "Diagonal loops" I suppose.
Maybe they should read "Whether other characters can walk straight through this character" and so on?
#1710
Try changing
  ChangeCursorGraphic(currentItem, 31);
to
  ChangeCursorGraphic(3, GetInvGraphic(currentItem));
#1711
Quote from: Pumaman on Sun 06/02/2005 16:46:40
Quotethe manual still refers to "player" as an alias to character[EGO] which is not being updated.

Whereabouts is that? I did a quick search of the manual but couldn't find anything.

Reference -> Scripting global variables

Quote from: Pumaman on Sun 06/02/2005 16:46:40
Quote
I'd like to request an eEventSaveGame, similar to eEventRestoreGame, which would get called JUST AFTER a SaveGameSlot (I THINK that's the name) command before the screen refreshes.

Sounds like a reasonable request. However, I am very aware of the feature creep that seems to be affecting this version, and I would like to get things settled down for an RC1.

Tracker'd: http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=505

How about a "Script O-Name" display in the Characters pane similar to the GUIs and Objects pane?
#1712
Actually, better do this, so the GUI only hides again if you leave the GUI area:

Code: ags

function repeatedly_execute() {
  //...

  if (mouse.y >= system.viewport_height-5) GUIOn(MYGUI);
  else if (IsGUIOn(MYGUI) && mouse.y < MYGUI_Y_POSITION) GUIOff(MYGUI);

  //...
}


The GUI will popup on the bottom of the screen. But you have to adjust its Y position in the properties window first. If your resolution is 320x200 and your GUI has a height of say, 30, set its Y position to 170 (200-30) and replace MYGUI_Y_POSITION with this value as well.
The 5 is the number of pixels on the bottom of the screen that trigger the GUI popup. Increase or decrease at your discretion.

system.viewport_height is a system variable that holds the height of the screen, you don't have to change it.

Edit:

Changed system.screen_height to system.viewport_height
#1714
2.) Since you have to store the inv item's old sprite slot number in a variable anyway (for restoring it later, use GetInvGraphic), you could modify your on_mouse_click RIGHT mouse button cycling to change the cursor graphic to the slot number stored in variable when you cycle to the UseInv cursor mode.
#1715
I have compiled the links to old AGS versions here.
#1716
1.) DisableCursorMode

2.) You could set the item to a blank sprite with SetInvItemPic while it's activated.

With AGS v2.7 you will be able to add an item to a specified position in the inventory so you could store its position, remove it from the inventory and add it back to the old position once the user changes the cursor mode.

I've noticed you don't use "else" much:

  if (GetCursorMode()==0) {
    SetCursorMode(1);
  }
  // use "else, otherwise the following will also be executed if cursor mode is 0 because you set the cursor mode to 1 in the part above:
  else if (GetCursorMode()==1) {
    SetMouseCursor(8 );
  }
#1717
What exactly is your problem? What do you want to do?

You can download AGS from the main download page.
The executable of the AGS editor is called "agsedit.exe".

Where have you heard of "Winroomedit"?
#1718
Welcome to the forums!

1.) You can't align frames for walking animations. Make sure they are all the same width when you import them. For animations, you can use the SetCharacterViewEx function with the "align" parameter. There's no equivalent function for objects, so you have to use frames of the same width.

2.) "Characters" pane -> "Adjust speed with scaling"

3.) That shouldn't be happening. There's always a small pause when you click anywhere because of the pathfinder calculating the new path, but the current frame of the character should be retained.
Please post your on_mouse_click function.

Your english is fine.

AGS Beginners FAQ
#1719
Quotehigh quality sprite scaling

Yeah, that's even better. No misunderstanding there.
#1720
QuoteSprite filtering, similar to the term "texture filtering" in 3d graphics, would be better imo.

I agree.
SMF spam blocked by CleanTalk