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

#1
Ã,  Ã,  Ã, Acknowledging that this is simply a dream suggestion, please consider the following…Ã,  Many AGS users dream of finding a way to make some form of profit with their AGS games.Ã,  The distribution channels offered on Xbox Live may open new potential revenue streams.Ã,  Many wish that the genera of Adventure Games would be re-introduced to the general public in a big way.Ã,  Simple, no nonsense, downloads on Xbox Live may give AGS games exposure to such an audience.
Ã,  Ã,  Ã, The idea behind XNA development is that you can create a program once, and have it run both on windows and on Xbox360.Ã,  AGS users could continue to create for the computer - just as before.Ã,  Then with some additional considerations for the GUI and controls, simply have it run the Xbox360.
Ã,  Ã,  Ã, With Scotch's mentioning that XNA is C# based, I fully understand that creating XNA AGS would be a serious undertaking.Ã,  However, many great achievements begin with a simple dream.Ã,  And this community knows how to make dreams a reality.
#2
Ã,  Ã,  Ã, 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
#3
Excellent!  It works perfect.  Thanks, Ashen.
#4
Ã,  Ã,  Ã, 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.
#5
It works PERFECT.Ã,  Thanks Ashen.Ã,  I didn't realize that repeatedly_execute_always truly works always, including when the game is paused with a Popup Modal GUI.
#6
Ã,  Ã,  Ã, 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.
#7
The deep reasoning behind all this is a little over my head.Ã,  However, from what I'm gathering, I should change all instances of Button.GetAtScreenXY(mouse.x, mouse.y) to GUIControl.GetAtScreenXY(mouse.x, mouse.y).
For instance:
Code: ags

if (Button.GetAtScreenXY(mouse.x, mouse.y) == btnIconWalk) LowLabel.Text = "Walk to";
 

is now
Code: ags

if (GUIControl.GetAtScreenXY(mouse.x, mouse.y) == btnIconWalk) LowLabel.Text = "Walk to";

Simple as that?Ã,  Yes?Ã,  The code runs fine both ways, but I'm gathering that the second way is proper and not simply benefiting from a programming loophole.

Monkey_05_06, thank you for the explanation of InventoryItem.Name being a String.Ã,  I have fine tuned my code per your suggestion.

Thanks everybody.Ã,  The code is running great and accomplishing what I hoped for.

[EDIT:] monkey_05_06, thanks for the additional explanation.Ã,  The deeper reasoning is now more clear to me.
#8
Hey guys,
Here is the post where I learned about the Button.GetAtScreenXY(mouse.x, mouse.y) command.
http://americangirlscouts.org/bbc.com/yabb/index.php?topic=24804.0
See Ashen's quote second from the last.
I've been using this code all over my script.
I want to be using the proper code to prevent future trouble.Ã,  Is this truly wrong?
Thanks again.
#9
KhrisMUC,
Regarding Button.GetAtScreenXY(mouse.x, mouse.y).
Ã,  Ã,  Ã, My bad.
Ã,  Ã,  Ã, I'm using v2..72.650, however, it looks like I've had enforce new-style strings unchecked the whole time I've been working on this.
Ã,  Ã,  Ã, Maybe this is what let me get away with using that command?
Ã,  Ã,  Ã, It's a little tough on my end because I'm new-ish at programming and I'm mostly teaching myself from reading past posts.Ã,  So, it is sometimes hard for me to distinguish between what is the new code and what is the old code or simply between good code and bad code.
Ã,  Ã,  Ã, I do appreciate your pointing this out so I can continue improving my coding technique.
Ã,  Ã,  Ã, Thanks again for the help.

[EDIT:]Ã,  As pointed out by KhrisMUC, having enforce new-style strings unchecked is unrelated to this situation afterall.
#10
Got it!!!
Thank you very much for the help, KhrisMUC and SSH.

First, I turned off the clickable properties for the GUI buttons.

Next, here is the final code for one of the buttons: it says “nothing” with no inventory in slot and says the proper inventory name when inventory is in the slot, and highlights regardless if there is inventory or not.

Code: ags

if (Button.GetAtScreenXY(mouse.x, mouse.y) == btnInv01) {
Ã,  btnInv01.NormalGraphic = (77);Ã,  //Makes highlight regardless of inventory present
Ã,  InventoryItem*item = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
Ã,  Ã,  if (item == null) {Ã,  //no inventory, say "nothing"
Ã,  Ã,  Ã,  InvLabel.SetText("Nothing");
Ã,  }
Ã,  Ã,  else {Ã,  //otherwise, say the inventory name 
Ã,  Ã,  Ã,  String buffer=String.Format("%s", item.Name);
Ã,  Ã,  Ã,  InvLabel.SetText(buffer);
Ã,  }
}


...and then to turn off the highlights...

Code: ags

if (Button.GetAtScreenXY(mouse.x, mouse.y) != btnInv01) btnInv01.NormalGraphic = (68);


It took me a while to get the code just right, figuring out the syntax and all, but it was well worth it.
Thanks again.
#11
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.
#12
Thanks for the help GarageGothic.Ã,  I realize now that it is not so easy (or really possible) to just switch resolutions mid game.Ã,  Therefore, I think I'll abandon my pursuit in doing this.Ã,  The reason I wanted to do this in the first place, was simply to give the player more control â€" that's all.Ã,  This is no biggy.Ã,  I'll be moving on and focusing on other areas of the game.Ã,  Thanks again.
#13
Thank you for the reply, GarageGothic.
These new graphic filters are interesting indeed, thank you for informing me about them!Ã,  I've been playing around with these filters and finding what I can about them in the manual, but I still have a question:Ã,  Is it possible for the player to initialize these filter modes while playing the game?Ã,  Where I find the command words to do this?Ã,  What I want is for the player to have the ability to change resolution in game (ideally toggle to full screen, but I understand that it is not supported), so they do not have to exit and restart the game to accomplish resolution changes.
Thanks, again.
#14
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.
#15
Ashen, SSH:Ã,  You guys Rock!Ã,  Thank you for the responses.

Regarding Question 1:Ã,  Brilliant!Ã,  Works great.Ã,  Thank you, I don't know if I'd ever have thought of linking a Label to a hidden Text Box to sneak that custom cursor line in.

Regarding Question 2:Ã,  More Brilliancy!Ã,  I just copied and pasted the code (in repeatedly_execute not repeatedly_execute_always) and adjusted for my differing text box name.Ã,  My cursor is now blinking perfectly.Ã,  Love it!Ã,  Watch that curser go!!!Ã,  Ah, this is good stuff.
#16
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.
#17
Ashen, thank you very much for the reply.

Regarding the answer to Question 1
Ã,  Ã,  Ã, Excellent!Ã,  Perfect solution.Ã,  I declared the int at the way top of the Global Script â€" and it works fine there.Ã,  The int in the untested code was sometimes called “PrevSelect” and sometimes called “PrevSelected”, so I just made sure they were the same in the final.
Ã,  Ã,  Ã, Additionally, I took things one step farther.Ã,  The top item was still responding to a single click because it is pre-selected when you open the Restore GUI.Ã,  To get the top item to wait for the second click, I put this code in the place where I open the GUI.

Code: ags

function btnMenuRestore_Click(GUIControl *control, MouseButton button) {
Ã, Ã,  Ã, lboxLoad.FillSaveGameList();		
Ã,  Ã,  if (PrevSelected == 0) PrevSelected = -1;Ã,  // makes sure top item needs 2 clicks to restore
Ã,  Ã,  gLoad.Visible=true;
Ã,  Ã, }
}


Regarding Ashen's answer to Question 2
Ã,  Ã,  Ã, Excellent again!Ã,  I put a Text Box in the Restore GUI and hid it off to the side.Ã,  I used the same code in the Restore Text Box's Activate function as I did before with the Save Text Box's Activate function.Ã,  Works like a charm.

Regarding the parse error in expr near “gLoad”
Ã,  Ã,  Ã, Yes, you spotted it, it was a typo, = instead of ==.

Thanks again Ashen, I appreciate it.
#18
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.
#19
Yes, it'll be Sierra Style until I become more comfortable with AGS.Ã,  Thanks again Ashen.Ã,  You've been a lot of help to me not just on this thread, but because I've been learning TONS from your past posts on other topics while you were helping others.
#20
Ashen, Thank you for the reply.Ã,  Originally I was avoiding Sierra Style speech because I wanted a little bit more control.Ã,  However, after reading your post and your helpful link, I realize that there might be virtue in the simple answer.Ã,  I will therefore now use Sierra Style for simplicity.Ã,  Thanks again.

EDIT:
Just to explain why I originally wanted more control: I thought I'd put the portrait on one button, then overlay facial expression on another button (or overlapping GUI) â€" thus hopefully making the game file smaller by not needing to include graphics for all portraits with all possible expressions.Ã,  I guess I can be an optimization freak.Ã,  However, because I know so little about programming, I really don't know if these optimizations would help the file size very much anyway (the file size is already very small).Ã,  Additionally, being relatively new at programming and in the interest of not biting of more then I can chew, I'll take the simple road today (Sierra Style), but perhaps one day I'll revisit this and the suggestion by Ashen for using Label.Text to simulate a text window with a GUI â€" which is a great solution, yet I'm just a little intimated by it just now because I'm not sure how I'd tackle scaling the simulated background window to accommodate the text, alternating left and right portraits, lining up the simulated background window and text to be perfectly next to the portrait when on both left and right sides, and pausing the rest of the game during this display.Ã,  Wow â€" this is a long edit / explanation, thanks for bearing with me, anyway the point is simplicity.Ã,  Arrgh!Ã,  My perfectionist nature is tearing me up for abandoning this battle.Ã,  Focus.Ã,  Simplicity.Ã,  I will choose simplicity.
SMF spam blocked by CleanTalk