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

#21
Every character in my game has a different "Friendship Points" variable associated with them.  If I wanted to have something happened based on who your best friend is it would obviously be the character with whom you've accumulated the highest score.  How would you do that though in practice?  How would you select the character with the highest associated Friendship Points variable?
#22
I've maybe gotten ahead of myself for a little Easter egg that probably no one will care about but it's a fun idea I've been enjoying implementing. That is, I decided it would be fun to add a game within a game and since mine takes place in the late 80s a first-person dungeon crawler on the home PC seems like the kind of thing you would have been playing.  I've managed to make it work but it seems unnecessarily labor-intensive and I'm repeating a lot of code that maybe doesn't need to get repeated this way.

In the mini-game room the player switched to a little pixel arrow I use to track the player's position on a little maze I have plotted out.  The little pixel arrow is controlled tank style with the arrow keys and moves around a walkable area inside the maze.  I track the direction the pixel arrow is pointed as well as its x and y coordinates on the room screen.  Then, I use those to display the appropriate background image of what corner or hallway of the dungeon the player would be seeing.  Now, I could just do it like this but that's hundreds of permutations even for a relatively short maze.  I have the first tile below which I put together as a proof of concept.  So, I know enough to get myself into trouble but not really enough to do this in any intelligent way.

Code: ags

  if ((player.x==3)&&(player.y==3)&&(CardinalDirection==4)){  //in the room's repeatedly execute
    DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
    surface.DrawImage(0, 0, 24);
    surface.Release();
  }

  else if ((player.x==3)&&(player.y==3)&&(CardinalDirection==3)){
    DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
    surface.DrawImage(0, 0, 23);
    surface.Release();
  }

  else if ((player.x==3)&&(player.y==3)&&(CardinalDirection==1)){
    DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
    surface.DrawImage(0, 0, 22);
    surface.Release();
  }

  else if ((player.x==3)&&(player.y==3)&&(CardinalDirection==2)){
    DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
    surface.DrawImage(0, 0, 25);
    surface.Release();
  }


As always thanks for your help!
#23
I'm not sure exactly what I did but I was working last night to fix some stuff and I got a little over my head and decided to revert back to a previous commit so I could start over.  I'm not exactly sure what I did wrong and while I have been making commits fairly regulary I don't actually revert very often.  Somehow I managed to screw everything up and I had a few conflicted files in the merge and now when I try to load the game I get this error.  I can go back to a previous previous commit so all is not lost but it doesn't really add up there either because the name of the commit explaining what I did isn't even present in it so I'm at a bit of a loss.  I think I've gotten over the panicking but it would be great to be able to claw back some of this work.

#24
So, I've got a journal in the game, and as you meet and get to know people in the game your "friendship level" so to speak increases.  Well, after scripting quite a few I realized it would be a good idea to give the player some feedback that something in their journal has changed so I had the idea to play a sound.  I could search through and find every instance of "ChefRomanFriendshipPoints++;" et al but I think it might be easier to have a couple of lines of code that plays the sound when anything changes.

I have a hunch that someone is going to tell me that this is exactly what for loops are for and how come I haven't actually learned how to use them yet.

Thanks again, everybody!!
#25
I've been screwing around with this for a few hours now and I'm close to a solution but I haven't quite nailed it yet.  I have a bar in the game where the character will sit and while the character is seated I want the player to be able to click on any hotspot in the room but I do not want the player to be able to walk anywhere and right now any click around that does not fire a hotspot will take the player back to the first frame of the sitting at the bar view and try to walk there.  I'm using the BASS template.  I know that this has something to do with putting a ClaimEvent() somewhere but I can't seem to put it in the right spot.  All I really want to do is not have the player try to walk anywhere until they stand up. but I think I might be calling things in the wrong spot.

Code: ags
function on_mouse_click(MouseButton button) {
  if (!SittingAtBar) return; // -> exit function here
  if (mouse.Mode == eModeWalkto) {
    ClaimEvent(); // prevent standard click handling, nothing further will happen
}


This just makes it so no click works and you can't actually click on anything.  SetGameOption(OPT_NOWALKMODE, 0)
  Mouse.DisableMode(eModeWalkto) aren't working for me either, probably because I need to use them in conjunction with the ClaimEvent()?  It's the click processing done by the scripts further down the chain that I think are giving me problems.

I was using a workaround by making a GUI that was really just intercepting all the clicks and just put buttons over where the other characters were sitting but that wasn't ideal because I realized I would need to make a separate GUI for each permutation of characters at the bar and also this got rid of the Action Bar which was a bit weird so I decided to actually solve the problem instead of using GUI buttons to workaround everything.  Thanks again, everybody!
#26
I have a sort of crafting/cooking puzzle in the game where the player gets into the refrigerator to pull ingredients to cook different recipes.  I don't want the player leaving the room with these ingredients for the sake of easing inventory management.  I have it working well enough with a dummy character being the inventory.  I think maybe I should have tried using Khris' crafting module instead of the weird way I started doing it but I think there's a useful lesson here for me and maybe somebody else, as well.  I want to be able to strip the player's inventory of all of the cooking inventory items easily when they leave but I don't know what those are going to be and while I could just strip the player's inventory of every possible item this feels needlessly messy.  I read about structs and arrays but these aren't variables I'm tracking so those don't really seem like a natural fit to me, either.  Well, that and I don't know how to use those, either.

I think there may be a way to set the particular inventory item's custom property to something like "Cooking" and then call that to pull out all the items with that property being true but I don't really see how to do that, either.  Thanks again for all your help!

EDIT: I guess all the inventory items are already in an array; that's what that inventory[1] and so forth refers to.  If I group all of the "cooking" inventory items together on the inventory list then I can keep them organized but I may end up adding some items later so I'd still want a way to manage this.  The only way I can think of still seems a little off:

Code: ags
player.LoseInventory(inventory[14&&15&&16&&17&&18]);
#27
I have a journal in my game that updates as the player progresses and one of the things it does is keep track of the player's relationships which can be leveled up from 1-10.  The way I have it now is that each character has a page in the journal and when you level up you get a little heart graphic for which I use a button on the GUI.  So, when that game starts you have zero hearts up to a maximum of 10 hearts.  Well, I want to track this as I test the game so I made a little GUI that I can use to update the variable I use to track the player's relationship.  While in the game I don't think you'll be able to lose these points I want to be able to add or subtract them while I test just to make sure they work so just enabling them isn't enough since if I move backward the button will have already been enabled.  What I have here works but I can't imagine this is the easiest way to code this but I've been scratching my head and I really can't think of a better way.  I'm sure I am missing something and would appreciate any help.  Thanks so much!

In repeatedly_execute:

Code: ags
if (GinaFriendshipPoints == 1){
   btnGinaFP00.Visible = true;
   btnGinaFP01.Visible = false;
   btnGinaFP02.Visible = false;
   btnGinaFP03.Visible = false;
   btnGinaFP04.Visible = false;
   btnGinaFP05.Visible = false;
   btnGinaFP06.Visible = false;
   btnGinaFP07.Visible = false;
   btnGinaFP08.Visible = false;
   btnGinaFP09.Visible = false;
 }
  
 if (GinaFriendshipPoints ==2){
   btnGinaFP00.Visible = true;
   btnGinaFP01.Visible = true;
   btnGinaFP02.Visible = false;
   btnGinaFP03.Visible = false;
   btnGinaFP04.Visible = false;
   btnGinaFP05.Visible = false;
   btnGinaFP06.Visible = false;
   btnGinaFP07.Visible = false;
   btnGinaFP08.Visible = false;
   btnGinaFP09.Visible = false;
 }
   if (GinaFriendshipPoints ==3){
   btnGinaFP00.Visible = true;
   btnGinaFP01.Visible = true;
   btnGinaFP02.Visible = true;
   btnGinaFP03.Visible = false;
   btnGinaFP04.Visible = false;
   btnGinaFP05.Visible = false;
   btnGinaFP06.Visible = false;
   btnGinaFP07.Visible = false;
   btnGinaFP08.Visible = false;
   btnGinaFP09.Visible = false;
   }
   
   if (GinaFriendshipPoints ==4){
   btnGinaFP00.Visible = true;
   btnGinaFP01.Visible = true;
   btnGinaFP02.Visible = true;
   btnGinaFP03.Visible = true;
   btnGinaFP04.Visible = false;
   btnGinaFP05.Visible = false;
   btnGinaFP06.Visible = false;
   btnGinaFP07.Visible = false;
   btnGinaFP08.Visible = false;
   btnGinaFP09.Visible = false;
   }
  
  if (GinaFriendshipPoints ==5){
   btnGinaFP00.Visible = true;
   btnGinaFP01.Visible = true;
   btnGinaFP02.Visible = true;
   btnGinaFP03.Visible = true;
   btnGinaFP04.Visible = true;
   btnGinaFP05.Visible = false;
   btnGinaFP06.Visible = false;
   btnGinaFP07.Visible = false;
   btnGinaFP08.Visible = false;
   btnGinaFP09.Visible = false;
   }
   
   if (GinaFriendshipPoints ==6){
   btnGinaFP00.Visible = true;
   btnGinaFP01.Visible = true;
   btnGinaFP02.Visible = true;
   btnGinaFP03.Visible = true;
   btnGinaFP04.Visible = true;
   btnGinaFP05.Visible = true;
   btnGinaFP06.Visible = false;
   btnGinaFP07.Visible = false;
   btnGinaFP08.Visible = false;
   btnGinaFP09.Visible = false;
   }
   
   if (GinaFriendshipPoints ==7){
   btnGinaFP00.Visible = true;
   btnGinaFP01.Visible = true;
   btnGinaFP02.Visible = true;
   btnGinaFP03.Visible = true;
   btnGinaFP04.Visible = true;
   btnGinaFP05.Visible = true;
   btnGinaFP06.Visible = true;
   btnGinaFP07.Visible = false;
   btnGinaFP08.Visible = false;
   btnGinaFP09.Visible = false;
   }
   
   if (GinaFriendshipPoints ==8){
   btnGinaFP00.Visible = true;
   btnGinaFP01.Visible = true;
   btnGinaFP02.Visible = true;
   btnGinaFP03.Visible = true;
   btnGinaFP04.Visible = true;
   btnGinaFP05.Visible = true;
   btnGinaFP06.Visible = true;
   btnGinaFP07.Visible = true;
   btnGinaFP08.Visible = false;
   btnGinaFP09.Visible = false;
   }
   
   if (GinaFriendshipPoints ==9){
   btnGinaFP00.Visible = true;
   btnGinaFP01.Visible = true;
   btnGinaFP02.Visible = true;
   btnGinaFP03.Visible = true;
   btnGinaFP04.Visible = true;
   btnGinaFP05.Visible = true;
   btnGinaFP06.Visible = true;
   btnGinaFP07.Visible = true;
   btnGinaFP08.Visible = true;
   btnGinaFP09.Visible = false;
   }
   
   if (GinaFriendshipPoints ==10){
   btnGinaFP00.Visible = true;
   btnGinaFP01.Visible = true;
   btnGinaFP02.Visible = true;
   btnGinaFP03.Visible = true;
   btnGinaFP04.Visible = true;
   btnGinaFP05.Visible = true;
   btnGinaFP06.Visible = true;
   btnGinaFP07.Visible = true;
   btnGinaFP08.Visible = true;
   btnGinaFP09.Visible = true;
   }
#28
Initially, I wanted to release Kola Queen as one long game but the more I think about it the more I like the idea of releasing it as a series of shorter games so people can play them while I work on them and maybe even build a little excitement along the way.

I've gotten the file system working so it will track a variable between play sessions like a save game and it should also work between games provided I use the same save game directory for all of them.

What I want to happen is to have an import system much like the Quest for Glory games where you import a character.  Essentially, this will just import about ten different variables not fundamentally different than the stats used in QfG.  These variables are set by decisions you have made and friendships you have built along the way which I would like to track game to game.  So, I can make it work but I can't make it work where I record all of the variables into a single file which seems absolutely best.  The problem is I'm essentially just copying and pasting code from the manual into the game without really understanding how it works.  How do I save all of these variables into a single file so that these global variables can be set all at once and keep everybody's hard drives clean?

Here's the code, which fires when a button is pushed right now:

Code: ags
  File *output = File.Open("$SAVEGAMEDIR$/importvariables.tmp", eFileWrite);
if (output == null)
  Display("Error opening file.");
else {
  output.WriteInt(WhichQuestYouAreOn);
  output.Close();
}


This is what loads the variable:

Code: ags
File *input = File.Open("$SAVEGAMEDIR$/importvariables.tmp", eFileRead);
WhichQuestYouAreOn = input.ReadInt();

input.Close();
#29
So, I've got the a GUI payphone working how I want it to with the exception that I want the pushed buttons to appear pushed.  The background art for the GUI is all of the buttons pushed in and each individual button has its own sprite.  So, to get it to looked pushed I really just need the button to disappear when it's clicked but I can't seem to make this work.  I tried to set PushedImage in the editor to -1 but it doesn't like that.  I tried to set it manually with:

Code: ags

  Button1.PushedGraphic = -1;
  Button2.PushedGraphic = -1;


in game start but that doesn't work either.  I was hoping there was an easy solution that doesn't require me to cutout and line up all the keys again.  Thanks for any help! Here's the GUI code for reference:

Code: ags

function Dial(GUIControl *control, MouseButton button) {
  if (button != eMouseLeft){
    return; // only react to left clicks
  } 
 
  TextBox1.Text = TextBox1.Text.AppendChar(control.ID + 48);  // ascii code for 0: 48, 1: 49, etc
  
  TelephoneNumber++;
  if (TelephoneNumber == 7){
    TelephoneNumber = 0;
    Game.SimulateKeyPress(eKeyReturn);  //enters the textbox contents when it reaches seven digits.
    
    
  }
  
}
#30
Code: ags
cBartender.LockViewFrame(40,1,0);
  Wait(60);
  cBartender.UnlockView();
  cBartender.LockView(38);


I want the bartender here to make a frowny face when asked a particular question.  He'll frown all right but he won't return to his regular speech view even after I unlock the view in the dialog.  I've tried locking to his speech view (38) afterward as well but it doesn't seem to work even after I end the dialog and begin a new one.  He'll just keep on frowning forever yet his dialog will play.  I tried it as a one frame animation (well, technically two identical frames) with the same result.  I'm not sure what it is I'm missing here.  Thanks for your attention.
#31
AGS Games in Production / Kola Queen
Thu 15/10/2020 05:12:26








Moline, Illinois, summer 1986. The stench of the Mississippi River, the sizzle of the parking lot asphalt. You're fresh out of community college, riding the bus around looking for a job and trying to keep your cat fed. Your Uncle Leon, a key player in the local carbonated beverage game, has been offered a chance for exclusive distribution of a brand new soda pop around the Quad Cities area, and you're just the underemployed go-getter to help him out. He needs you to help him convince the five largest pop pushers around to carry this exciting new product, using nothing but your youthful charm, anecdotal knowledge of the beverage industry and ability to make small talk about racehorses with middle-aged men in short-sleeved dress shirts. From the strip malls of Bettendorf to the smoky metal clubs of Davenport, you and your elderly Papu take to the streets with this thrilling task and you’re not taking no for an answer in this full-length adventure game. Will you find hidden treasure? A vast conspiracy to hook children on corn syrup? A grand purpose in life? Probably not, but you might meet a local TV celebrity, run into your cousin at a bar, or even learn to drive a box truck. Look for it in the first quarter of 2021 wherever games are downloaded.

Travel to all five of the Quad Cities and meet new and enthralling new people!
Drink pop!
The first ever graphic adventure game featuring a Class B commercial license at the Department of Motor Vehicles!
Captivating EGA graphics and animations!
Over thirty locations!
Pointing!
Clicking!
Even a text parser!
#32

I commissioned some animations for the game I'm working on but I don't think I'm going to use them as I went with a different artist and the style didn't quite match.  They're really not bad and I would hate to see the effort get wasted so maybe you can use them for something.


#33
So, I see there is an option to use the text parser as a feature of dialog.  I'd like to use it but I can't understand how exactly to make it function.  First things first make sure to add the word to the parser list.  TNext from the manual:

"If the text parser is enabled for this dialog and the player types something into it rather than selecting an option, the special value DIALOG_PARSER_SELECTED will be returned, and AGS will have automatically called Parser.ParseText with the player's text. Therefore, you can call Parser.Said to process it."

Okay, so far so good.  So far most of what I need is handled automatically.  I look up Parser.Said:

Code: ags

String input = txtParserInput.Text; //the "String input" is declaring that the input it's looking for is a string value and will be the word entered in the parser.
Parser.ParseText(input);
if (Parser.Said("load")) { //or in my case "pop"
  txtParserInput.Text = ""; //this clears the text box
  RestoreGameDialog(); //This is the function it runs in my case I probably want to do something something like dSpecialDialogAboutPop.Start();
}


Now, I know all this stuff needs to go somewhere specific to work but what I can't figure out is where it belongs and the places I have tried return an "undefined symbol 'txtParserInput'" Thanks for the help.  Using AGS has been a fun experience.


#34
I have a hunch that its disappearing has something to do with the BASS default template but I've looked around for quite some time trying to find where to toggle it on or off.  I can select a dialog option which lights up but the cursor is invisible.  Thanks!
SMF spam blocked by CleanTalk