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

#1561
Quote from: snowzone on Thu 10/03/2005 13:52:53If I make a game and I post it here, I need to say or do something about the paint program or other programs I have used?

Of course not. But if the game/graphics is any good, someone will ask anyway. :)

Quote from: snowzone on Thu 10/03/2005 13:52:53
PD: The AGSers Wolrd Map does not work. Is that a problem of my computer or is it all right? :)

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=19457
#1563
If you have indeed deleted a sprite that was in use (placed as a frame in a view loop) and you know which number that sprite had, you can right-click another sprite and change its number to that of the missing one with "Change sprite number...".
#1565
What's your point? Come on, these kinds of posts help noone.

Edit:

Quote from: stuh505
I didn't mean to be a bother, I thought CG might like to know if there are bugs in the code that can allow for this kind of unexpected behavior...most everything seems to be well handled by runtime exceptions but this one wasnt.  Knowing that they come up may help him tol solve them in the future.

The problem is you didn't provide any useful information that could help track down the problem.
"Hey, there's some bug in AGS." isn't terribly useful, not even for CJ.

Edit 2:

:)
#1566
LEFT is defined as 1, so button can be LEFT (1), so can buttonreleased.

(I've edited my previous post in case you didn't notice.)
#1567
QuoteI'm trying to detect mouse release over a character or overlay, not an AGS GUI.

I know, my first remark was only a reminder for anyone else reading this.

Quotehow does this part make sense?

The part after the first if-clause is run when the button is pressed down.
The code after the second if-clause only gets run when on_mouse_click is called via repeatedly_execute (mouse released).

It may not be the best solution, hence "something like this". But I have quickly tested it and it seemed to work fine. It obviously needs some more work.

Edit:

I've played around a bit:

Code: ags

int buttondown;
int buttonreleased;

function on_mouse_click(int button) {

  if (button == LEFT) {

    if (GetCharacterAt(mouse.x, mouse.y) == YOURCHARACTER) { // if mouse is over character
      if (button == buttonreleased) ProcessClick(mouse.x, mouse.y, GetCursorMode()); // or do some other stuff
    }
    else { // if mouse is over anything else
      if (button != buttonreleased) ProcessClick(mouse.x, mouse.y, GetCursorMode());
    }

    if (button == buttonreleased) { buttondown = 0; buttonreleased = 0; }
    else buttondown = button;

  }
  else if (button == RIGHT) {
    SetNextCursorMode();
  }

}

function repeatedly_execute() {

  if (buttondown != 0) {
    if (IsButtonDown(buttondown) == 0) {
      buttonreleased = buttondown;
      on_mouse_click(buttonreleased);
    }
  }

}


This runs YOURCHARACTER's interaction only when the mouse button was released. All other interactions run when the mouse is pressed down.

Is this what you're looking for?
#1569
8-bit means 256 colors. Surely there's an option for that in Paint?
#1570
Advanced Technical Forum / Re: code wont work
Thu 10/03/2005 03:11:00
It looks like your second ccCreateCommand string is too long.
Try moving some of the CCS commands in additional ccAppendCommand functions.
#1571
QuoteI think it is better to save the screen continuosly, because many screens involve animations...and your method would freeze all animations while the GUI is up.

True.

2) You can check if a mouse button has been released over a GUI in the on_event function (GUI_MUP).

If you want it for all interactions, you could do something like this:

Code: ags

int buttondown;
int buttonreleased;

function on_mouse_click(int button) {

  if (button == LEFT) {
    if (button == buttonreleased) {
      buttondown = 0;
      buttonreleased = 0;
      ProcessClick(mouse.x, mouse.y, GetCursorMode());
    }
    else buttondown = button;
  }
  else if (button == RIGHT) {
    SetNextCursorMode();
  }

}

function repeatedly_execute() {

  if (buttondown != 0) {
    if (IsButtonDown(buttondown) == 0) {
      buttonreleased = buttondown;
      on_mouse_click(buttonreleased);
    }
  }

}
#1572
QuoteBut the problem with this is that I can only save 1 screen!  So when I close down the option box, I've still got a line left!

You only have to save the screen once. Only restore the screen continously.
If you save the screen continously, of course the drawn stuff will be saved too.

QuoteIt would be nice if I could create graphic overlays for all the same things I can do with RawDraw.

http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=413
#1573
What setting was it?

And please edit your previous post instead of double-posting. Thank you.
#1575
Quotestrazer: RunInventoryInteraction(game.inv_activated, GetCursorMode());
              Doesn't pickup at all...

Yeah, it doesn't work since there's no cursor mode that by default selects items, so you have to use the script as shown by Scorpiorus. Sorry for the confusion.
#1577
Keep in mind that you can have more than one of the same inventory item, so if you do
  AddInventory(10);
  AddInventory(10);
you have two of these items, occupying the same slot in the inventory (Check "Display multiple inventory items multiple times" in the General settings pane to change that).
If you then do
  LoseInventory(10);
you lose only one of the two items, so you will still have the item in your inventory.

Are you sure you only have one of these items in your inventory?
As I said, check the option in General settings to verify.
#1578
I don't quite understand:

Quote
This is the example code in the help file.
I am currently using it.

Yet in your on_mouse_click function you have

Code: ags

  else if (button == LEFTINV) { SetActiveInventory(game.inv_activated);}


This obviously selects the item you clicked on, not running its interaction.

What happens if you replace
  SetActiveInventory(game.inv_activated);
with
  RunInventoryInteraction(game.inv_activated, GetCursorMode());
?
#1580
It should work fine.
Have you put it in your on_mouse_click function?
Do you have a Look interaction defined for the inv item you're testing it with?
Do other cursor modes work?

Maybe there is a braces problem. Please post your whole on_mouse_click function.
Use the [ code ] tag (without spaces):

[ code ]
This is some script
[ /code ]

becomes

Code: ags

This is some script
SMF spam blocked by CleanTalk