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

#2121
I have a custom inventory. I wanted to create custom on_mouse_click interactions with it, instead of using the system which comes with AGS.

If I set, in general settings, the "Override built-in inventory window click handling" to false, the GUI detects clicks on the inventory item correctly and I can select an item as active inventory item with the interact mouse cursor.

I wanted to alter this functionality in some ways, and set the above mentioned setting to true, which causes the game to call "on_mouse_click" even inside inventory windows as usual.

To test the issue I'm about to describe, I've simplified the code as below.

Code: ags

function on_mouse_click(MouseButton button) // called when a mouse button is clicked. button is either LEFT or RIGHT
{
  Display("click");
  if (button == eMouseLeft) {
    Display("left");
  } else if (button == eMouseRight) {
    Display("right");
  } else {
    Display("fail");
  }
  ProcessClick(mouse.x, mouse.y, eModeInteract);
}


The Display commands I've set up reveal that on_mouse_click command is correctly called (game displays ("click"), but then it gets weird: the check for which mouse button was clicked fails to detect which button was clicked. The same check works outside of the inventory GUI, but inside the inventory GUI it seems that the if -lines are never run at all and if I click on an inventory item, the script above displays "fail" on screen, denoting that the script did not detect left-click or right-click, but instead went for the "else" option.

What causes this behavior inside an inventory GUI?
#2122

-----

>  Check if gun is loaded

You feel a little disappointed. Only one (1) bullet in the chamber, none in the magazine.



#2123

-----

>  Tear the piece of cloth in half, tie the one part of the cloth on the one edge of the rung. Tie the other half of the cloth on the other edge of the rung.

You feel confused, but the voices in your head were quite adamant the cloth had to be combined with the rung. The purpose of this is unknown.



#2124

-----

> use the shard to cut your pants.

You use the piece of glass as a knife to shorten a pant sleeve and stuff the piece of cloth into your pocket along with the piece of glass.



#2125

-----

> climb up again carefully (there is only one step missing), so you should be able to get the weapon by using the rung

You carefully climb up. The top rungs, the ones above the one which broke, feel quite loose and you don't dare put any weight on them. You decide to use the rung to try to reach the gun. You can't quite reach, but a more vigorous move does manage to knock down some pieces of glass as well as the gun.



Your holster is now filled with gun. For some reason it does not make you feel much safer, though.



#2126

-----

> try using it as a screwdriver at the grate

You ponder for a good while how to use the rung as a screwdriver. It is basically a metal pipe, bent into shape, with both ends broken. If you had some good tools you might be able to hammer the rung's end into a screwdriver, but you've yet to spot a hammer or an anvil.



#2127

-----

> Take cover behind pipes, throw metal rung to break the rest of the glass and have the gun fall  

The pipes do not provide much cover, so you give the rung a very careful toss. It thunks off the thick glass without effect.



You sigh with relief, wondering what might have happened if the rest of the glass had actually come crashing down in the narrow shaft. You pocket the rung again, wondering if it could have other, less dangerous uses.



EDIT: You wonder for a while what this strange "save" feature might be?

#2128

-----

> pick up broken rung

You pick up the slightly bent metal rung and place it in your free pocket.




#2129

-----

> climb ladder

You begin you ascent...



It seems fairly dark out there, but you can smell freshly mowed lawn and you can hear running water. You also see what looks like a pistol lying on the glass you evidently fell through earlier. Looks like freedom was closer than you...



Oh crap!

"AAAAAAAAAAAAAAAA- Ooompf!"



Well today is NOT your lucky day, now is it?





I'll be taking a short break from now, since we've gotten started so well. I will keep up the minimum of "1 post per 24 hours", maybe more if I have the time. Since it's sunday today... Oh well, I might just be back!
#2130

-----

> Use ID-card on the grate's corroded bolt(s)

You tear the velcro-attached ID card off your chest and flap it around the rusty bolts for a while. The cheaply made laminated card bends uselessly and has no effect.



You decide to put the ID card back on your chest so as to not lose it.



#2131
@Arjon: It's okay, I forgive you. I guess the angry smiley was a little overkill.  :)


-----

>Examine ID-card (or nametag)

Well this looks odd somehow. Despite the fact you have amnesia, you're pretty sure you never had such a magnificent beard in your life.





#2132

-----

> Use a piece of glass on the grate's corroded bolt(s). (Arjon! You forgot the ">", this is your only warning >:()

The glass shard is too thick to fit into the grooves on the bolts, and bashing the bolts with it will only cut your palms and break the glass shard.

(Oh and Tabata: its the gun holster the inventory has a slot for)





#2133

-----

> (try to) open the door carefully

The handle turns and you can hear the mechanism working, but the door does not move. You (try to) push and pull (carefully), to no effect. You see no hinges on this side, so you deduce they are on the other side and the door SHOULD open by pushing.



#2134
AGS Games in Production / Re: He Watches
Sun 07/08/2011 09:32:44
Thanks ProgZ! It's always great to hear people have noticed the work going into the game.  :)
#2135

-----

> Open Grate

The metal mesh is fairly sturdy, although the bolts holding it in place seem a little corroded.

You give the mesh a good yank, but it just isn't enough.



#2136

-----

> grab a shard of glass

You pocket a good-sized shard of glass. You are slightly afraid of walking around too fast now, as the shard is quite close to your... well, you know what.



#2137
Since its the very start, I'll be online for a while and do the first few turns a bit faster to get everything going.
Also, love the way you're taking risks right from the start Domithan. Keep in mind, this game has a health bar and that has implications.

-----

> Turn valve

You turn the valve. Nothing happens. Judging by the lack of any sound from the large pipe, you deduce that nothing is running through it at the moment.



#2138

Instructions for new players

If you want to try your hand at this "game", just read up on the last few pages (or all the pages, if you have a few hours to waste) and think up a funny, interesting or useful command that follows the rules stated below. Anyone can enter new commands at any time, but only one SIMPLE command is accepted per "turn", to keep confusion to a minimum.

Making suggestions is also welcome!

RULES:
- I post once roughly every 24 hours, sometimes more often. If I take a break, I will tty to provide some warning.
- No overcomplicated entries.
"> Grab crowbar and smash the porcelain doll" is fine.

"> Grab crowbar, smash porcelain doll, then run to the elevator and smash the button repeatedly if the monster in the next room got angry. Also: stop wearing pants" will go ignored due to overcomplication. We are not in a hurry, people. Take your time and see what happens step by step.

- All gameplay input must be preceded with a ">" as given in examples above.
This will help me differentiate any potential discussions between players on later actions from actual gameplay entries.

- Only one input will be considered per post, so if someone's already entered input after my last post, any further input will most likely be ignored (unless it is REALLY good or I feel really energetic and want to draw it).

- THERE ARE NO LIMITS
Anything is possible. If you can think it, the game can probably do it.




-----

* CRASH *
"AAAAAAAAAAAAAAAA- Ooompf!"
You are... who are you? What the heck? WHERE are you? What are you doing here?



-----

*BOOOOOM*
Oh well now THAT didn't sound too good. It was almost like an explosion!



-----

You are in a small room. You have a feeling you should be doing something really important. Too bad you cannot remember what it is. What you CAN remember is that you are running out of time FAST!

On your feet, man! Get to it!



#2139
AGS Games in Production / Re: He Watches
Sat 06/08/2011 16:40:49
Giddy with excitement right now! I got the lighting system working just right and it looks GREAT! Well, at least I think it does.  ;)
Also finished the cutscenes for the demo and began adding hotpots and details into rooms. Also working with the inventory GUI and persistent record keeping elements right now.
#2140
Huge thanks for clearing that up Monkey! I've been a bit lazy with ensuring my code doesnt do anything unnecessary as long as I haven't had any noticeable slowdown with my games. Thus I've been stuffing things in repeatedly execute always with wild abandon in my previous projects.

Now that I think of it, I should probably clean those up and reorganize the functions a little better, just to be safe. Maybe add some "if" checks around stuff that only need to be checked in certain rooms etc, so that the checks arent run carelessly in all rooms.
SMF spam blocked by CleanTalk