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

#1
No need, I got it to work as intended. I couldn't be happier  :grin:

The last thing I might need some quick advice, then I am going to leave you guys be for hopefully a little while. Seriously, thank you for all your help!

Now, my NextPage-button works like it should except for the fact that it doesn't disappear automatically once the book reaches the last page (presumably because it lies under the 'On Click-function'). Instead, it disappears when clicked one last time, which wouldn't be so bad if it wasn't for the fact that it screws up the scissors-button by making it reappear for some reason.

Is there a better place to put that line of code so that it disappears automatically? Currently the code for that button looks like this (and yes, putting the code for the visibility off the scissor-button in that specific function solved the issue I had earlier):

Code: ags

function bNextPage_OnClick(GUIControl *control, MouseButton button)//Changes page forward//
{
  
if (gJournal.BackgroundGraphic < 52) gJournal.BackgroundGraphic ++;
else bNextPage.Visible = false;

if (gJournal.BackgroundGraphic == 52)bScissors.Visible = true;
else bScissors.Visible = false; 
}
#2
Okay, I finally got it. I will admit that it is a bit of a headache for me to figure out how the code is meant to be structured sometimes (even with tutorials). I will try to keep that in mind for the future.

Now my only problem is that the button never actually shows up when I reach the intended page. Its visibility is set to false in the beginning of the game since it isn't meant to show up until the GUI-background is changed to the correct one but it never appears when I run the game, even though AGS doesn't detect anything wrong with my code. Could it be the order of the code strings?

And the player is supposed to get the item once they click the button, kind of like those browser point-and-click games (especially room escape-games) that used to be popular until Flash was discontinued.
#3
I tried using two equals-signs and it didn't change anything, I still got the same error. Besides, using one equal-sign has worked fine every other time I've used if/else-statements...
#4
Thank you all so much!

I finally realized where my error was. I kept taking the instructions way too literally (something that happens more often than it probably should) and used GUI.BackgroundGraphic all the time instead of defining exactly which GUI-background I was actually changing. I sure feel like a dingus...

Now I am almost done but I have run into a bit of a problem with the last button, which is the one that is going to add the inventory item to the player’s inventory. Considering that I only want the button to appear on the last page on the journal, I added a code that looks like this:

Code: ags

if (gJournal.BackgroundGraphic = 52) bScissors.Visible = true;

else bScissors.Visible = false;


The problem is that I keep getting an error that tells me to ‘Parse error in expr near gJournal’. This doesn’t really tell me anything about what I need to fix so I would really appreciate if anyone could help me understand what I am doing wrong.

I also wonder where I should put the string that gives the character the item: before or after this if/else-statement?
#5
Maybe I don't understand coding at all, but when I try to use the suggested method with this variable (int GUI.BackGroundGraphic = 49), I just keep getting the error that the variable has already been defined. Even when I move it outside of the function itself. How can I  solve this error?

And on a somewhat related note, does anyone know where I can find some kind of error-glossary so that I can understand what the error-text is trying to tell me? As I said, completely new to coding.
#6
I feel like a complete idiot but I have to ask, otherwise I might end up tearing my own hair out...

I am in the progress of programming a book with multiple pages where there is a retrievable inventory-item at the end. I think that I understand how the item itself is going to be programmed but the problem is that I am trying to figure out the best way to program the changing of the pages. So far, I have been using simple buttons where the 'Next Page' button changes the background-graphic of the GUI to show the next two pages (who are on the same sprite) and a 'Last Page' button that changes the background graphic to what it used to be.

What I am currently trying to figure out is a way to make the 'Next Page'-button change the Graphic to not just one specific sprite (because there are a total of four sprites) but to change it to the next one in the order until its hits the last one in the series where the button stops being clickable. How would you do that? I am still new to this so I feel kind of lost.

While I am on a similar note, I also wonder if something similar could be done for a classic combination-lock. Like how the puzzle is solved if specific spites are aligned in the correct order. I have a feeling that this is going to be really useful going forward so any advice with this one is really appreciated.
#7
With everything that I have been reading regarding GUIs, this dilemma is really making me scratch my head.

I have been thinking about the potential of using a GUI as a close-up for investigating an item closer and something that I always saw in other Point and Click-games (especially room escape-games) was hiding items for puzzles inside these kinds of closeups (like hiding a small item inside of a book that you have to flip through).

Is that possible in AGS? Or will I potentially have to use an extra room for that (which I would ideally want to avoid given you can only have so many rooms in one game)?
#8
Thank you! This was really helpful, I assume that something similar could be done with sound-effects.

Say, a sound-effect that automatically plays when the monster is in the room that you can hear from the one next to it and if you head inside that room you get a game over?
#9
Hello!

I have been thinking about adding a basic stealth-mechanic during certain areas of my game to increase the tension.

The first moment that I wish to experiment with being in a basement full of boxes with the character only being able to walk pass certain gaps between them when the enemy isn't looking (viewable through some kind of lighting-effect, walking at the wrong time and being seen will off course result in a game over).

I was a tad curious how this could be done in AGS and depending on how difficult it would be to code, I might be interested in adding a bigger stealth-area later on.

PS: I have no idea if this belong here or under Advanced questions. Please tell me if I need to relocate it.
#10
There are off course multiple rooms that I want to connect to this first room as it is meant to lead to four different hallways with two on each side, think of it as the central hub of the first area if you will. I wished that I had a screenshot to show you so that I can make it more clear what I mean (as I am not good with words) but I haven't even finished the linework yet, let alone the coloring and shading.

I just wanted to know if my idea was possible so I could redraw it in the case that it wouldn't work without having to scrap months of hard work. 
#11
Thank you!
This is super helpful! I didn't even think about hotspots as a way to transition rooms!

This was really the only room with this specific problem but it is neat to know for the future. Now I can truly start to finish up the background now that I know that I don't need to slice it up.

I am looking forward to show off the first segment once it is starting to come together!
#12
Hello!

I grew up with 2D adventure games and recently got inspired to turn some vivid imagery from my nightmares into something more productive. In this case a 2D adventure game.

Now, I have no background in coding whatsoever and so far is just playing around with the tools to get the hang of them while I am working on the art assets. Which leads me to my question.

The first room of the game takes place in the entry hall of a mansion that is separated into two floors through a staircase and the plan is that the player would move between the different hallways of the two floors as they solved the puzzles. But I realized that the game only checks for which edge the player walks off of when it transitions into the next room, which makes sense given the way the tool is designed but it doesn't really help me with my conundrum.

Is there a way to make the game check for not only which edge the player walks off of when choosing which room to transition into, but also which floor? Like through the different walkable areas or something? I'd prefer to not have to redraw the entire background again to split the room into two so solving it through the code would be really nice.
SMF spam blocked by CleanTalk