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

#41
Could you maybe... implement lua or javascript while still leaving in AGS script, and when you've finished implementing said scripting language, make an interface that uses said scripting language internally while still acting like ags script... eventually you could maybe have it running off of said scripting language when no one really knew that you changed out the scripting language at all?

-Keith

ps. a switch/case command will be pretty helpful to me right about now
#42
On July 2nd, I did some story / puzzle work, which I have yet to revise.  Basically the main character is a Wizard (who's name is Harold -- and yes I know).  You have to solve 3 problems to get out of the room.  One is you need the spellbook before you can do anything (for instance saving games, or having inventory ;-) ), second is you need to enact the only spell you have left (a mysterious 'wind' blew all the magic hats out the window but luckily you still have one spell), the third is you need to find a way to get out as Harold has magically sealed himself but doesn't remember how he did it.  That's all I will say at this point.  This "game" is more or less a one room demo to see if I can hack it.

On July 3rd, 4th and 5th, I had a basic version of the UI up which didn't have much.  I had a problem drawing a line past a certain point, but managed to solve it with the wonderful help of some guys on the AGS forums.






Note the last one I fixed :-)

Finally added the extra buttons and now it knows which option you're choosing

Click Image for a video of it in action.  It still needs to account for the dead zone, and I still need to implement click-drag-release.




#43
Interesting thing here.  I changed the line -
Code: AGS
screen_sprite = DynamicSprite.Create(System.ViewportWidth,  System.ViewportHeight);
to
Code: AGS
screen_sprite = DynamicSprite.Create(640, 480);
-- and it works perfectly.  For some reason at game start I guess the viewport height is set to 400 for some odd reason?

I see from your reply, about the viewport w/h not being reliable until the first room has been loaded.  Thanks for your help.

It's not documented, however.
#44
Left, 0, Top 0, Width 640, Height 480

After inspecting the actual height of the dynamic sprite, it's only showing 400 for some reason.  Whereas the height I created it with which was the viewport is still showing 480.
#45
true 640x480, use low-res coordinates in scripts is false.

the game will happen in a 640x360 center box (letterbox)

Also see this other thread - (manually seems to be working btw) - http://www.adventuregamestudio.co.uk/yabb/index.php?topic=46366.0
#46
Apparently it doesn't work that way.  It yelled at me when when I tried to set it higher than 320x200.  Also when I set the coordinates to smaller it didn't seem to stop the mouse from going past it anyway.  I'm currently doing it manually.
#47
Quick question --- Why is the mouse bounds function restricted to 320x200 when you can have games that are larger?  As it seems I can't restrict my mouse position with that function (i'm running a 640x480 game)
#48
For the most part line drawing is working.  I made a gui that's non-clickable cover the whole screen (or at least I think it's doing that, the viewport width and height is 640x480).  I then built a dynamic sprite and then draw the line to it, and then I set the graphic of the gui to this dynamic sprite.

Not sure why this is, here is the problem -



Notice how the red line does not go all the way down to the cursor?

Here's the code:

Code: AGS
// main global script file
DynamicSprite *screen_sprite;
int startx = 0;
int starty = 0;

function draw_line_on_screen(int from_x,  int from_y,  int to_x,  int to_y,  int r,  int g,  int b)
{
	DrawingSurface *surface = screen_sprite.GetDrawingSurface();
	surface.Clear();
	surface.DrawingColor = Game.GetColorFromRGB(r,  g,  b);
	surface.DrawLine(from_x,  from_y,  to_x,  to_y);
	surface.Release();
	gScreenGUI.BackgroundGraphic = screen_sprite.Graphic;
}

function clear_screen()
{
	DrawingSurface *surface = screen_sprite.GetDrawingSurface();
	surface.Clear();
	surface.Release();
	gScreenGUI.BackgroundGraphic = screen_sprite.Graphic;
}

// called when the game starts, before the first room is loaded
function game_start() 
{
	screen_sprite = DynamicSprite.Create(System.ViewportWidth,  System.ViewportHeight);
}

// put anything you want to happen every game cycle in here
function repeatedly_execute() 
{
	if( gPieMain01.Visible == true )
		draw_line_on_screen(startx,  starty,  mouse.x,  mouse.y,  192,  0,  0);
	else
		clear_screen();	
}

// put here anything you want to happen every game cycle, even when the game is blocked
function repeatedly_execute_always() 
{
}

// called when a key is pressed. keycode holds the key's ASCII code
function on_key_press(eKeyCode keycode) 
{
  if (IsGamePaused()) keycode = 0; // game paused, so don't react to keypresses
  
  if (keycode == eKeyCtrlQ) QuitGame(1); // Ctrl-Q
  if (keycode == eKeyF9) RestartGame(); // F9
  if (keycode == eKeyF12) SaveScreenShot("scrnshot.pcx");  // F12
  if (keycode == eKeyCtrlS) Debug(0,0); // Ctrl-S, give all inventory
  if (keycode == eKeyCtrlV) Debug(1,0); // Ctrl-V, version
  if (keycode == eKeyCtrlA) Debug(2,0); // Ctrl-A, show walkable areas
  if (keycode == eKeyCtrlX) Debug(3,0); // Ctrl-X, teleport to room
}

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) 
	{
		if( gPieMain01.Visible == false )
		{
			gPieMain01.SetPosition( mouse.x - (gPieMain01.Width / 2),  mouse.y - (gPieMain01.Height / 2) );
			
			//if( gPieMain01.Y < 60 ) gPieMain01.Y = 60;
			//if( (gPieMain01.Y + gPieMain01.Height) > 420 ) gPieMain01.Y = 420 - gPieMain01.Height;

			gPieMain01.Visible = true;
			startx = mouse.x;
			starty = mouse.y;
		}
		else
		{
			if( mouse.x > (gPieMain01.X + 54) && mouse.x < ( (gPieMain01.X + gPieMain01.Width) - 54) )
			{
				if( mouse.y > (gPieMain01.Y + 54) && mouse.y < ( (gPieMain01.Y + gPieMain01.Height) - 54) )
				{
					gPieMain01.Visible = false;
				}
			}
		}
	}
	else if (button == eMouseRight) // right-click, so cycle cursor
	{   
		//mouse.SelectNextMode();
		ProcessClick(mouse.x,mouse.y, mouse.Mode);
	}

}


function dialog_request(int param) {
}


Ideas on why the line is cutting off?
#49
that's about the gist of it, mouse, objects, characters, and guis.  However since you can't seem to do this I will probably just live with what we have and restrict my guis to the scene area.  Thanks though.
#50
I would like to restrict everything to a certain area of the screen.  (Letterboxing purposes).  Without having to do each thing seperately.  Mouse position, objects, sprites, gui's you name it.

Is this possible?
#51
Figured it out guys.  Create a new GUI, set the z-order to the highest number possible (I think it's 1000).  Make the gui transparent, cover the screen, initially on, and NOT CLICKABLE.

Next you can create dynamic sprites, grab a surface, draw, and set the gui to the dynamic sprite's .Graphic property.

This is how you draw over the entire screen including the GUI's :-)
#52
That works thanks.

Now i need to know if there's a way to make sure the line draws on top of everything including the guis.  I read in some other thread that it wasn't possible.  Kind of makes what I'm trying to do tough.  My gui uses a radial menu and not regular buttons.  So I need to show feedback to the player as to where he's dragging the mouse.
#53
I'm trying to draw a line over everything, using a drawing surface and an overlay (and dynamic sprite).

Code: AGS
// main global script file
DynamicSprite *screen_sprite;

// called when the game starts, before the first room is loaded
function game_start() 
{
	screen_sprite = DynamicSprite.Create(System.ViewportWidth,  System.ViewportHeight);
}

function draw_line_on_screen(int from_x,  int from_y,  int to_x,  int to_y,  int r,  int g,  int b)
{
	DrawingSurface *surface = screen_sprite.GetDrawingSurface();
	surface.DrawingColor = Game.GetColorFromRGB(r,  g,  b);
	surface.DrawLine(from_x,  from_y,  to_x,  to_y);
	surface.Release();
	Overlay *myOverlay = Overlay.CreateGraphical(0,  0, screen_sprite.Graphic,  true);	
}

Usage: (at the bottom of the function)

Code: AGS
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) 
	{
	  if( gPieMain01.Visible == false )
	  {
		  gPieMain01.SetPosition( mouse.x - (gPieMain01.Width / 2),  mouse.y - (gPieMain01.Height / 2) );
		  gPieMain01.Visible = true;
	  }
	  else
	  {
		  if( mouse.x > (gPieMain01.X + 134) && mouse.x < ( (gPieMain01.X + gPieMain01.Width) - 134) )
		  {
			  if( mouse.y > (gPieMain01.Y + 91) && mouse.y < ( (gPieMain01.Y + gPieMain01.Height) - 61) )
			  {
				  gPieMain01.Visible = false;
			  }
		  }
	  }
	}
	else if (button == eMouseRight) // right-click, so cycle cursor
	{   
		//mouse.SelectNextMode();
		ProcessClick(mouse.x,mouse.y, mouse.Mode);
	}

	draw_line_on_screen(50,  50,  100,  100,  255,  255,  255);

}


Could anyone tell me what i'm doing wrong? Thanks!
#54
That and Simon -- The colors are temporary, I just needed something to make each look different.  This is how the menus are laid out though.  I haven't decided whether I will have lines from the words to the "buttons" or not.
#56
Here's some old designs.  I was considering a stationary menu with 4 pieces in each corner, since I'm now thinking ahead to touch pad devices (A company I work for does dev for Ipad and so forth, so I could have my game ported).  But I came across an older picture of old pie menu designs, thinking of doing something along these lines.



Note how the text is a bit different than the actual actions in the "action" menu.
#57
I am considering simplifying it a bit, it has to do with the screen space and what not, plus, I don't have a talk option.

Then again I could shove in an extra button for talk so there are 6 main buttons.

I don't really like using 6 items or 8 items though.  I prefer 3, 5, or 7  (not really mattering on the submenus as i prefer them to have the same amount of options)  Just a weird eccentricity of my character.  Related to that is the fact that I think look at and on top of should probably be condensed into one action, but then there are only 3 actions for look.  It sort of needs to have the same amount of each in order to work properly.  The position of the "buttons" rely on an angle range, and although I could only use 3 options in look it is less consistent and the idea of using the radial menu is so you don't have to look at the menu and just select based on direction.  Also someone mentioned that the use button that contains things like open/close, push/pull, on/off are essentially the same option with just two options.  So if I based on context I would have to reduce that to two buttons, so now we have 3 look buttons and 2 use buttons, and still 4 sense buttons.  Well I suppose I could always put talk in the use sub-menu, but then I still have 4 sense buttons.

It's a challenge for sure.
#58
I'm going back to the idea of text parser games.  I mean sometimes you did try every single combination, but then again sometimes you didn't.  Sometimes the description will list points of interest so you can click on them.  The feeling I wanted to convey was a greater choice in what they were to do.  I obviously won't be using all 12 verbs on each and every interactive item.  Sometimes it will just repeat the general description if there's really nothing underneath or behind or whatever.  You will use each verb at least once throughout the game.  I can also make sure that the items that need to be investigated will mostly have a description for everything.  "The desk is made of solid cherry wood and the desktop appears to be a bit cluttered." <Look on top desk> "There is a notepad here on the desktop, an inkwell obviously antique, and a stick of wax."

I haven't worked out all the kinks.  I'm trying to figure out how to make it all workable.  You know on the whole I could do my game like The Dig where one cursor does everything but I think that's a bit "low brow" as-it-were.  Meaning we started by typing in commands, and then when computers were getting good enough, we simplified it into icons, and then later into less and less, until then all you were doing was essentially clicking on stuff like some computer children's books.  I figure most people that play these kinds of games (and you guys that make them) are fairly smart.  They won't resort to clicking every option until they have to (at which point I have failed as a game designer)

I want to get the thrill of clicking something completely random and getting a surprise message that's either helpful or just plain humorous.  You know maybe I've been playing all day, and I'm totally and completely stuck, and then I just decide to try something wacky <smell sewer pipe> "Prior experience has taught me that the sewer probably doesn't smell all that great, however because you hold my life in your hands, I will do this thing that you ask." <pc smells the pipe> "Quite fascinating, why in fact this doesn't smell like a sewer at all, but more like...hmm, cloves!"  And so maybe this is the wacky thing you needed to do in order to progress.

The possibilities are endless.

If I am carefully designing this I can design what needs a response and what doesn't, and what that response will be.  The player will never be penalized for being able to make an extra or odd choice.
#59
I'm actually building a radial (pie) menu for my game.  This doesn't use the typical buttons.  It requires a dead zone (ie a place in the center where it doesn't activate).  The angle of the mouse relative to the center of the clicking area (where the dead zone is), and the length of the "drag".  A drag is defined as hold down the mouse button and moving the mouse to another location.  The various buttons are at different angles and distances from the center.  To give you an idea here are two mockups.





The "buttons" won't really rely on an absolute position and this is designed to be one-button useful (makes it good for some touch screens in the near future should I port my game to some tablets or something).

So this is what I'm asking.  Do I actually develop an AGS GUI for these, or can I just put an image on screen with script?  And what is the best method to put an image on screen?  Also are there any performance issues to doing something like this verses a standard gui display?  Is it also possible to draw a line on the screen from my mouse to wherever I drag it?  And can this line drawing function be used in production games (that is, is it something other than a debug feature)?

If you need more clarity please let me know and I'll try to make myself a little clearer.
#60
You don't really have to say it looks nice.  It doesn't, but it's functional in showing me the layout and helping me figure out trouble spots (see below)

1. It will definitely match the game, however I don't have any stylistic content, or concept art yet, which will come forthwith -- It's just going to take a while.

2. Yeah that's one of the problem spots.  I might have to arrange them in a certain pattern or some such.  Or simply stack the Look menu's items one on top of another.

3. I will be creating responses for each combination (within reason).  I haven't really figured out yet how I'm going to handle highlighting interactive parts.  I might have some sort of "magic" which shows what things you can click on when you hover over them, or I might gray out the menu options, or I might just leave them alone.  If you've ever played any text adventures or the old sierra text-parser based adventures, you know they don't have descriptions for everything.  So if one tries to do "look" on the sidewalk it might print out the generic description of the scene, however within the scene will probably be some points of interest in which case if it's displayed there then it can be interacted with.  "Here you see a sidewalk running in front of both sides of the street."  Then later since sidewalk was stated you could try "tasting" it.  "The sidewalk tastes like dirt and old chewing gum and feels a bit like rough sandpaper on your tongue."  Part of the joy of some of those old games is you could type off the wall stuff and it might have a response (or it might not).
SMF spam blocked by CleanTalk