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

Topics - Husky

#1
Ã,  Ã,  Ã, I hope that this is an alright place to post because this is more of a dream suggestion then a completely practical suggestion for AGS.Ã,  Although adventure games are traditionally played on computers, I can imagine that many would love to run their AGS game on a next-gen counsel like the Xbox360.Ã,  Interestingly enough, Microsoft has now given independent game developers the ability to make Xbox360 games with their XNA game development tool.
Ã,  Ã,  Ã, Even more interesting is that the Torque game engine has now reconfigured itself to be compatible with XNA.Ã,  Thus, any independent game made in Torque can now run through XNA right onto your Xbox360.Ã,  The dream suggestion is: what if AGS was also made to be compatible with XNA?Ã,  Thus, AGS games could play on the Xbox360.

XNA website
http://msdn.microsoft.com/directx/XNA/default.aspx
TorqueX website
http://www.garagegames.com/products/torque/x/

Thanks for your consideration,
Husky
#2
Ã,  Ã,  Ã, I'm trying to have the TAB button toggle the inventory on and off.Ã,  I'm having a problem because my code makes the inventory flicker, on , off, on ,off.
Ã,  Ã,  Ã, I've been trying to combat this by writing code that checks if the TAB button is pressed.Ã,  I think I'm going in the right direction in theory, but in practice I really have no clue what I'm doing.

In main global script file:
Code: ags

//Helps with Inventory on/off
bool pressingTAB;


In repeatedly_execute():
Code: ags

//Help with Inventory on/off
if (pressingTAB == true) {
Ã,  if (IsKeyPressed(9) == false) pressingTAB = false;Ã,  Ã, 
}


In - function on_key_press(int keycode):
Code: ags

if ((keycode==9) && (pressingTAB == false)} { // TAB, show inventory toggle
Ã,  if (gInventory.Visible == false) {
Ã,  Ã,  openInventory();
Ã,  Ã,  pressingTAB = true;
Ã,  }
Ã,  else {
Ã,  Ã,  gInventory.Visible = false;
Ã,  Ã,  Ã, pressingTAB = true;
Ã,  }


Ã,  Ã,  Ã, As usual, if anybody has any ideas, I'd be grateful to hear.
Thanks in advance.
#3
Ã,  Ã,  Ã, I have a custom Yes / No GUI for Quit Game, and Restart Game.Ã,  So far the words "Yes" and "No" are buttons which you click to answer.Ã,  However, how can I enable the game to additionally respond to the key presses “Y” and “N”?
Ã,  Ã,  Ã, My GUI is Popup Modal GUI, which sort of pauses the game, so the basic IsKeyPressed command will not work.Ã,  Is there a work around to activate key presses when a Popup Modal GUI is up?
Ã,  Ã,  Ã, I've done something similar to enable the “Enter” button for my Popup Modal Restore GUI.
This I've worked on this method in this post:
http://americangirlscouts.org/bbc.com/yabb/index.php?topic=27365.0
This method is also referred to the bottom of this post:
http://americangirlscouts.org/bbc.com/yabb/index.php?topic=27365.0
Ã,  Ã,  Ã, However, these methods use a special situation to enable “Enter” that is exclusive to the Enter key.Ã,  Basically you create an invisible text box in the GUI and use the Activate command.
Code: ags

#sectionstart tboxLoad_ActivateÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function tboxLoad_Activate(GUIControl *control) {
Ã,  btnRestoreRestore_Click(btnRestoreRestore, eMouseLeft);Ã,  //Pressing enter triggers Restore game button
}
#sectionend tboxLoad_ActivateÃ,  // DO NOT EDIT OR REMOVE THIS LINE

Ã,  Ã,  Ã, However, as stated, this method seems to be exclusive to the Enter key.Ã,  If anybody has thoughts on enabling Y / N key press activation withÃ,  a Popup Modal GUI I'd be grateful to here about it.
Ã,  Ã,  Ã, Thank you in advance.
#4
Hello.Ã,  I'm trying to implement a few different features into my custom inventory.Ã,  Although, I've found solutions in the forms to do some of these in isolation, when I try to do everything, it gets complicated and does not work.Ã,  Also, I'm pretty new to coding, but am having fun giving it a go.Ã,  However, if my approach seems mental, just let me know and we'll go in a different direction.

Goals for custom inventory:
1.) Rectangular graphic highlight boarder around inventory items on mouse over
2.) Display inventory name on GUI label on mouse over
3.) Same rectangular graphic highlight boarder on empty inventory slots on mouse over
4.) Display names like ”nothing” or “zilch” on mouse over of empty inventory slots

Attempted solution (possibly mental):
Ã,  Ã,  Ã, My solution for highlighting was to place buttons on top of the GUI inventory window.Ã,  I made the button graphics invisible by default, then I have the button graphic switch to a highlight rectangle when there is a mouse over.
Ã,  Ã,  Ã, The pros of this solution are: 1) the highlights flash on regardless if there is inventory in the slot.Ã,  2) The highlights are the exact shape and size that I want.Ã,  3.)Ã,  Using buttons lets me display things like “nothing” or “zilch”Ã,  when the mouse is over an empty slot.Ã,  See code:

In repeatedly_execute
Code: ags
 if (Button.GetAtScreenXY(mouse.x, mouse.y) == btnInv01) InvLabel.SetText("Nothing");
Ã,  else if (Button.GetAtScreenXY(mouse.x, mouse.y) == btnInv02) InvLabel.SetText ("Nil");
Ã,  else if (Button.GetAtScreenXY(mouse.x, mouse.y) == btnInv03) InvLabel.SetText ("Nada");
Ã,  else if (Button.GetAtScreenXY(mouse.x, mouse.y) == btnInv04) InvLabel.SetText ("Zilch");
Ã,  else if (Button.GetAtScreenXY(mouse.x, mouse.y) == btnInv05) InvLabel.SetText ("Zip");
Ã,  else if (Button.GetAtScreenXY(mouse.x, mouse.y) == btnInv06) InvLabel.SetText ("Zippo");
Ã,  else InvLabel.SetText("Inventory");


Ã,  Ã,  Ã, The cons of this solution are: 1) I can't select my inventory items!Ã,  Oh no!Ã,  It seems that having a button in the same place as a potential inventory item is somehow interfering.Ã,  2.) I fear the buttons may also interfere with displaying the inventory item's names (when they are actually there) on a GUI label with mouse over.Ã,  However, I don't know if this fear has any foundation because I can't get the following code to work even in isolation anyway:

In repeatedly_execute
Code: ags
 InventoryItem *item = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
if (item == null) { /* do nothing */ } // if no GUI control there, do nothing
else {
 String buffer=String.Format("%s", InventoryItem.GetAtScreenXY(mouse.x, mouse.y));
 InvLabel.SetText(buffer);
}


Anyway, I know this is a long post.Ã,  However, if you do have the inclination and time, your thoughts on this matter would be greatly appreciated and of much value to me.

Thanks in advance.
#5
Question: Is it possible to give the player the ability to toggle between windowed mode and full screen mode in the game?Ã,  What specific command words do I need to use to accomplish this?

Details: I've been trying using words like “System.Windowed” that I've found in the manual.Ã,  But I get an error saying that “System.Windowed” is read only.Ã,  This is what I have so far:

For windowed 320 x 240:
Code: ags

System.Windowed = true;
System.ScreenWidth = 320;
System.ScreenHeight = 240;


For windowed 640 x 480:
Code: ags

System.Windowed = true;
System.ScreenWidth = 640;
System.ScreenHeight = 480;


For full screen:
Code: ags

System.Windowed = false;
System.ScreenWidth = 640;
System.ScreenHeight = 480;


My high end graphics card does not support full screen 320 x 240. (I've read that others with lab top screens have this same problem)Ã,  Ã, So my theoretical work around is to simply have full screen run in 640 x 480 even though the game is drawn for 320 x 240.Ã,  Ã, I wonder if this will work?

Any thoughts you have on this matter are greatly appreciated.Ã,  Thank you in advance.
#6
Question 1:Ã,  Is there a way to change the graphic of the Text Box cursor line “_”?

Details:Ã,  I made a nice large blocky custom font for my game. (The theme and style of the game require it to be large â€" each letter is 24 pix high in 320x240 rez)Ã,  It looks great, in general.Ã,  However, when I use my custom Save GUI, and I'm typing in letters for the save game name, I just can't help but to notice the difference between the little Text Box cursor line “_” and my large blocky custom font.Ã,  Thoughts?

Question 2:Ã,  Is there a way to make the Text Box cursor line blink?

Details:Ã,  I would like the cursor line to blink in the Save GUI Text Box â€" just because I think it would look more professional and polished, and kind of prompt the user to start typing.

Thank you in advance for your thoughts.
#7
I've made a custom Save GUI and a custom Restore GUI and they are both working great (thanks to examples in other people's past posts.)Ã,  Now, I'm trying to add a little extra finesse but I'm getting stumped.Ã,  Thus, I have 2 separate questions regarding my Restore GUI:

Question 1: How can I enable double clicking on the Restore List Box?

Details:Ã,  I am not using SelectionChanged to automatically restore the first game you click.Ã,  I have it set up so you first highlight the restore game you want, then you click a restore button to initiate the restoring.Ã,  (this is a style decision that I'm hoping to preserve)Ã,  However, when testing this out I notice that additionally I sometimes intuitively just want to double-click a restore game slot and have it just restore.Ã,  Is this possible â€" to register a double-click on a slot on a List Box?

I've been trying to modify the examples in this post, but I'm not having success.
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=12190.0

Here is the new code I've come up with, the good news is it doesn't crash, the bad news is it doesn't do anything either.

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) {
Ã,  Ã,  GUIControl *theControl = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
Ã,  Ã,  Ã,  if (theControl == lboxLoad) {
Ã,  Ã,  Ã,  Ã,  int double_click;
Ã,  Ã,  Ã, //SetMouseCursor(GetCursorMode()); // this should stop the wait cursor from appearing however it is old version code so it needs to be updated to work.
Ã,  Ã,  Ã,  Ã,  double_click = WaitMouseKey(40)*Mouse.IsButtonDown(eMouseLeft);
Ã,  Ã,  Ã, //SetDefaultCursor(); // this should restore the cursor however  it is old version code so it needs to be updated to work.
Ã,  Ã,  Ã,  Ã,  Ã, if (double_click) {
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  int LoadGame = lboxLoad.SelectedIndex;
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  RestoreGameSlot(savegameindex[LoadGame]);
Ã,  Ã, }
}
Ã,  else {
Ã,  Ã,  ProcessClick(mouse.x, mouse.y, mouse.Mode );
Ã,  Ã, }
}

Thoughts?


Question 2:Ã,  How can I enable the “enter” key for my Restore GUI so it can initiate a restore on whatever game is highlighted?

I've been studying this post (the last two entries).Ã,  Ã, 
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=25066.0
Here I learned how to add a similar functionality to my Save GUI.Ã,  When you press enter, it will save as whatever name is in the Text Box.Ã,  I was able to do this because a Text Box has an “Activate” function:

Code: ags

function tboxSave_Activate(GUIControl *control) {
Ã,  btnSaveSave_Click(btnSaveSave, eMouseLeft);Ã,  //Pressing enter triggers save game button
}


However, there is no Text Box on my Restore GUI, just a List Box, so the“activate” function is not available.Ã,  So, I've been trying to set this up in the On_Key_Press section of the Global Script.Ã,  I'm trying to get the enter key to trigger Restore Selected when the Restore GUI is open.Ã,  However, unfortunately, my code just triggers the following error:Ã,  parse error in expr near “gLoad”

Code: ags

if (keycode==13) {Ã,  // Enter Pressed
Ã,  if (gLoad.Visible=true) {Ã,  //Ã,  Restore selected game if Restore GUI is open
Ã,  Ã,  int LoadGame = lboxLoad.SelectedIndex;
Ã,  Ã,  RestoreGameSlot(savegameindex[LoadGame]);
Ã,  Ã, }
}


Any ideas on either question would be greatly, greatly appreciated.Ã,  Thank you in advance.
#8
Specific question: How can I keep GUI button animations running while the Text Window is open while keeping the rest of the game paused as usual?

Details: For my character's speech, I'm opening a GUI with the character's portrait on a button, then I'm opening a separate Text Window next to the portrait using DisplayAt.Ã,  While this works great with still portrait images, for animated portraits I'm having trouble keeping the portrait animated in the GUI while the Text Window is active.Ã,  The Text Window seems to pause the game (actually a good thing) but unfortunately this includes pausing the portrait animations (a bad thing.)

Here is what I have been doing:
Code: ags

gPortrait.Visible=true;Ã,  // opens portrait GUI
ButtonFace.Animate(2, 0, 4, eRepeat);Ã,  // Sets the animation for the button on the portrait
DisplayAt (72,44,236, "A few words.");Ã,  // Text appears next to the portrait.Ã,  Oh no!Ã,  The portrait animation has paused.
gPortrait.Visible=false;Ã,  //closes portrait GUI


Of note, the portrait button image is changed a lot in the game based on who is talking and what they are doing.Ã,  Sometimes it is an animation and sometimes it is still.Ã,  I'm hoping to discover a solution that is flexible enough to accommodate this.

I'd greatly appreciate anyone's thoughts.
Thank you in advance.
#9
I'm stumped on how to get the middle mouse wheel to select both the next and previous mouse modes.Ã,  I know that Select Previous Mouse Mode is currently unsupported.Ã,  However, I've been unsuccessfully trying to script a workaround.Ã,  Here is what I have so far (please note, I have no programming background, except for studying the AGS manual and reading past posts, so if I've made obvious mistakes, know I'm diligently working to improve.):

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) {
			ProcessClick(mouse.x, mouse.y, mouse.Mode );
Ã,  Ã,  }
		else if (button == eMouseRight || eMouseMiddle || eMouseWheelSouth) {
			//Any of these mouse events trigger Select Next Mouse Mode
			mouse.SelectNextMode();
Ã,  Ã,  }
		else if (button == eMouseWheelNorth) { 
			// simulate "Mouse Select Previous Mode" which is currently unsupported
			if (mouse.Mode == eModeUseinv)
			mouse.Mode == eModeInteract;
			else if (mouse.Mode == eModeInteract)
			mouse.Mode == eModeLookat;
			else if (mouse.Mode == eModeLookat)
			mouse.Mode == eModeWalkto;
			else if (mouse.Mode == eModeWalkto && (cCharacter.ActiveInventory != null)
			mouse.Mode == eModeUseinv;
			// player has inventory item active so go to Useinv
			else if (mouse.Mode == eModeWalkto && (cCharacter.ActiveInventory == null)
			mouse.Mode == eModeUseinv;
			// player has no active inventory item so skip to Talkto
		}
}


If any of you programming gurus have any advice for me, I'd greatly appreciate it.Ã,  Thanks in advance.
SMF spam blocked by CleanTalk