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

#61
[NOTE:  This was in response to ManiacMatt's post above.]

I was just ranting about how weird it was that someone gave me a big blue cup(mug) right around the same time I started working on a game using AGS.  The picture I was posting was a picture of that very cup, but the link didn't seem to work.

The original idea behind this thread was to answer the question "I wonder how many AGSers actually have big blue cups?", as well as generate discussion on what they like to use their cup for (favorite beverage, pen/pencil holder, flowers, etc.), and perhaps how the contents of that cup aid in the individuals production of adventure games.  (Of course, if one doesn't have such a cup they can pretend they do for the purposes of discussion on what they would use it for.)

In my case, for example, I most like to use my cup for coffee, although it's been mostly filled with green tea lately.  The caffeine boost helps, although the mere idea of drinking from a big blue cup helps me motivate myself to get to work on projects I may be working on. 
#62
What's in MY Big Blue Cup?  Well, I like to have coffee in it, mainly, although lately it's been filled with green tea. 
What comes OUT of my Big Blue Cup?  Lately, an attempt at emulating a card game. 
#63
I was afraid that the header had created multiple variables...but it's good to have conformation. :-\

The bad news is that importing the bool to the header file didn't seem to change anything...

The good news is that, after then trying to import said variables to room 2, the function worked!  MUCH thanks for the info on importing/exporting variables from the global script to individual room scripts. 
#64
SOLUTION:  It turns out that all I had to do was declare the variables from the global script, then "export" those variables, and then call them in the room they belonged in using "import." 

(Start Intro--Skip to 'End Intro' to get to meaningful part of post.)

For anybody who read my previous thread about scripts not seeming to run, you'll recall I have begun a card game project and have used objects instead of GUI buttons for the games interface.  This has come back to bite me in the butt, for I've run out of objects to use and finally have resorted to employing GUI's in my design.  Of course, since object scripts run locally and GUI's run globally, the need for a workaround has arisen.  Being my stubborn self, I'm still refusing to start over, because (a) I'm not interested in rewriting 600+ lines of code just yet, and (b) it'd be better in the long-run to know why this snag has come up anyway.

(End Intro--The Problem)   
(Or for Phoenix Wright fans: --WITNESS TESTIMONY--)

The following are a list of facts about the script of my game:

1) The Script Header contains the line "bool workaround_strike = false;".

2)  In a room of the game (room 2), there is an "if" statement within the content of the function which handles the "repeatedly execute" event.  In particular, this statement tests whether workaround_strike = true.  If it is true, then the stuff inside of it happens.

Code: ags
<
	if (workaround_strike == true)  
	{
	  if (turn == 1)  //If P1 attacked P2 with a card...
	  {
				p1.attacking = true;
				blocking(2);  //P2 Must now choose a card to block
											//with (or not)
		}
		
		if (turn == 2)  //If P2 attacked P1 with a card...
		{
				p2.attacking = true;
				blocking(1);  //P1 must now choose a card to block 
		}                 //with (or not)
		Display("before workaround is equal to false");
		workaround_strike = false;
		Display("after workaround is equal to false");
		
	}
>


3)  A GUI button is set to, whenever it is clicked on, to set workaround_strike
to a value of "true".

Code: ags
<
		if (interface == gStrike.ID)  {
			val_display = String.Format("workaround_strike is equal to %d", workaround_strike);
			Display (val_display);
			workaround_strike = true;
			val_display = String.Format("workaround_strike is equal to %d", workaround_strike);
			Display (val_display);
		}
>

(Note:  val_display is a String variable, declared at the beginning of the global script.)

So then, if I click on the GUI button, the "if" statement within the "repeatedly
execute" event of room 2 should run its script, right?

"Not quite" is the answer I've been getting so far.

Trouble-shooting methods I've already tried:

-Placing a Display() function before and after the workaround_strike = true assignment in the GUI script.  Both ran, and both gave different values, thus
indicating that the assignment worked fine.

-Placing Display() functions at the beginning and end of the "if" statement within the "repeatedly execute" event.  Neither of these messages showed up, thus indicating that the "if" statement wasn't tested (or possibly Repeatedly_execute was still false for some reason.)

Any ideas as to why "repeatedly execute" doesn't seem to catch the boolean switch?  Any and all input will be greatly appreciated!

--End Post--  (Or, to PW Fans: --CROSS EXAMINATION--)
#65
 :o >:(

...KhrisMUC... >:( you...

...hit the nail on the head.  As such, you are a freaking GENIUS! ;D

The problem was that a GUI, which I had thrown in to display players HP, was covering the whole room.  As you suggested, the only element which could detect clicks was this GUI, because it overlapped everything else.

I removed that GUI and tested the room again by clicking on the card slot to see if the card highlighter would move over it as a result.  Sweet success!

Now all I gotta do is figure out a good score display method, and get the highlighter to appear over the card slots...ah well, at least those are work-around-able issues.

Thanks everyone for all the help!
#66
uh, wut aer thes label thingz ur taking abot?  ...oh rite, i haev a manuel...*reads* oh, TAHTS how u put sum1's hp in rpgs!

Ahem.  Seriously though...

So, first I tried Pumaman's suggestion of turning pixel-perfect detection off, but sadly this didn't change anything.

Then, I threw in an @OVERHOTSPOT@ label into the room.  In addition, I drew in a hotspot in the same general area where the card slot is, so when my mouse moved over it, the @OVERHOTSPOT@ label would indicate that was so.  Much to my surprise, the label remained blank when my mouse was over the hotspot!

Finally, I double-checked the global script to make sure ProcessClick was still present in the on_mouse_click function, and it was still there:



#sectionstart on_mouse_click  // DO NOT EDIT OR REMOVE THIS LINE
function on_mouse_click(MouseButton button) // called when a mouse button is clicked. button is either LEFT or RIGHT
  {
  if (IsGamePaused() == 1) // Game is paused, so do nothing (ie. don't allow mouse click)
    {
    }
  else if (button == eMouseLeft)
    {
    ProcessClick(mouse.x,mouse.y, mouse.Mode);
    }
  else // right-click, so cycle cursor
    {   
    mouse.SelectNextMode();
    }
  }
#sectionend on_mouse_click  // DO NOT EDIT OR REMOVE THIS LINE


#67
(Edit:  The room this all takes place in is room 2, the designated room for the game.  I'll specifically state when I'm talking about anything outside this room.)

I've placed the highlighter object visibly in the room, and since it doesn't move from that spot after clicking on the card slot, it would seem that the card slot isn't responding to mouse clicks, so it's not under the card slot.  Even if it were, the sprite for the highlighter is a couple pixels bigger than the card slot, so it would show up underneath it anyway.

Quote from: HammerBlade on Mon 26/11/2007 00:57:52

-A Display function has been placed both before and after the line that reads "object[18].SetPosition(91,160);", but no message is displayed upon clicking on the object.



For the script listed under "any click on object" for the card slot object, I've added two display functions, one before and one after, like so:

Display("That was nuts!");
oCard_highlighter.SetPosition(91,160);   
Display("That was nuts!");                               // (For some reason, this script doesn't run, causing me to
                                                                         //wonder if the object is responding to clicks at all...)

In a script under "player enters room (before fadein)", the code "oP2_faceup1.Clickable = true;" has been written.  Placing a display function before and after this line showed that this particular script passed. 

I also put that same line of code at the beginning of "player enters room (after fadein)", just in case for some reason the "clickable" argument didn't pass before the fadein.  Even after this, the card slot remains unresponsive to clicks.  (I've used those words a lot today, "responsive" and "click", haven't I?)

"So it's unresponsive even though it's been specifically defined as responsive?  Must be a cursor issue..." 

Such was my hope, but that didn't seem to be it either.  In room 1, during "player enters room (before fadein)", a script to set the cursor is placed.  I've tried a couple of cursors now, one being the pointer, and the other being the interact cursor.  Neither of these elicit any response from the card slot object.  I've even added some script under "interact with object" for the card slot, but a click with the interact cursor doesn't get the object to run the script.  Of course, the script for "any click on object" doesn't run either.

I hope I've been thorough enough in my description.  Any glaring oversights on my part? :-X
#68
Hm...that explains SO much.  And it looks a lot cleaner than the way I was trying to use them.  :P Thanks!

In any case, the game still doesn't seem to want to respond to "Any click on object".   >:(
#69
Let's see:

-"Pixel perfect click detection" is checked...
-A Display function has been placed both before and after the line that reads "object[18].SetPosition(91,160);", but no message is displayed upon clicking on the object.

And while it is true that it's better to use script-o-names, utilizing them also caused a compile error.  In particular, the message read:

"Type mismatch:  cannot convert 'object*' to 'int' ".

For example, rewriting the line of code like this...


object[oCard_highlighter].SetPosition(91,160);
//oCard_highlighter = the script-o-name of the card highlighter object.  (Who would have guessed it?)


...yielded the "type mismatch" error. 
???  I say again,  ???

#70
Okay.  It would have been better to use a GUI instead of a ton of objects.  Nonetheless, I would like to know why this approach doesn't work.

I'm attempting to make a card game interface in AGS, and the method I've chosen is to have a room, filled with objects which represent areas on a table-top where cards in the game go.  Essentially, I have it set so that the initial graphic of each object is an outline of the area where the card goes ("card slots"), so when cards are dealt, the graphic of each object changes to the card that was assigned to that object.  That itself works hunky-dory.

I also have an additional object in the room, a "highlighter" (a box that fits around a card graphic), so that when a card is clicked on, the highlighter is directly over the card.

I went to edit the interactions of one of the card slots, and under the "Any click on object" trigger (or are they called events...? I digress.), I added the following script:



object[18].SetPosition(91,160);   

//   18 = The "highlighter" object
//   (91,160) = the coordinates of the card slot



I went to test the game, and it compiled fine.  However, no matter how much I clicked on the card slot, the highlighter refused to overlap the card slot. 

Aside from the fact that I've picked an overly complicated approach to the making of a card game, why doesn't this work?
#71
Adventure Related Talk & Chat / The Tower...?
Mon 04/09/2006 02:35:13
Hey!  I've got something of a request.

Anybody ever play "The Tower (by Akumayo)"?  I just read about it, got interested in it, but now his download website is gone from the internet...FOR-E-VER.  I would presume.

Anyway, I don't suppose anybody has a copy of the game?  If they do, I would greatly appreciate obtaining it!

I'll send a PM to whoever happens to respond to this with e-mailing info.


#72
If I had ever played Grim Fandango I'm sure I'd have fallen in love with it.  Sadly, the only adventure games I've played are those ones that are classic Sierra/Lucas Arts stuff.

BEST COMMERCIAL:  Laura Bow 2:  The Dagger of Amon Ra
                                --Probably the first Sierra adventure game I've ever played
                                --Watched my Mom play it while I was 6, now I'm conditioned to be 
                                   scared to death of games that have a 256 color pallette.
                                --Great soundtrack, artwork, progression rate, and replayability

BEST NON-COMMERCIAL:

                               --Just about anything by Yahtzee, but if I had to pick it'd definitely
                               be anything that has to do with Trilby

                               --Teen Agent.  Most funny, most classic-feeling, and BESTEST EVEREST.
#73
He has a forums?

Knew I shoulda  :-X up

Well, I guess I know where I'm off to now!

#74
Even though I have a fear in the pit of my gut that I'm going to be hated for starting a thread like this, I'm starting it anyway. 

Ever since I first stumbled upon the Adventure Game Studio about a half-year ago, I've been closely following the works of Ben "Yahtzee" Croshaw.  I love his work, and am eagerly awaiting his last game which will conclude the mystery of the dark forces that revolve around Trilby's Life.

If I'm not mistaken, I believe that Yahtzee mentioned on his website somewhere that he's planning on, someday, creating a special edition of the four games in his series, and even selling them commercially.  After playing through Trilby's Notes (The last in the series of events revolving around Trilby), I'm convinced that Yahtzee is the Alfred Hitchcock of the AGS community, and as such his games would be well worth paying for.  (I swear, I didn't fall asleep unil 3:00 AM after my first night of playing that game)

For this reason, I think it's important that any plot-holes in his series are located and brought to light.  I definitely know of one plot-hole in particular that happens to be in the series, although it's so horribly obscure I'm not sure it could even be called that.  It's the following:

In Five Days a Stranger, one of the main characters is Simone Taylor.  In Seven Days a Skeptic, the last name of the doctor on the crew happens to be Taylor as well. 
In the README file included with the download of Seven Days a Stranger, Yahtzee mentions that the doctor is a descendant of Simones.  Personally, I see two problems with this:

1.  When a woman is married, her last name(usually) (EDIT: almost always) (EDIT: Doesn't it always?) becomes that of her husbands.  So it's extremely unlikely that this Dr. Taylor is her direct descendent.
2.  A certain event that happened at the beginning of the game Trilby's Notes (an event I can't mention for risk of spoiling the game) made such a form of leiniage (did I spell that right?) not possible. 

I had another comment about the series, but I can't remember what it was. >_< I'll probably edit later and add it in.  (Being obsessive-compulsive about what I post in forums these days, I tend to edit all of my posts 5 minutes after I post them)


Anybody else?  Improvements?  At all?
#75
(Yay, my first post!)

Tips for improving the sprite?Ã,  Well, I've been closely examining the sprite for any possible flaws in detail, and so far the only thing I can find that could be improved would be the presence of the character's feet.Ã,  If the characters feet poked out slightly from the robe as (s)he stepped, I would be absolutely convinced that (s)he was walking.

However in spite of this somewhat subjectional criticism of mine, I still agree with PenguinX that the sprite is totally useable as-is, just as long as all the other characters animations are consistent with the style used to animate this character. :)

...Yaay, this is now officially an extremely hot topic!
SMF spam blocked by CleanTalk