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

#1
Yes, I read what you said about switching which character is the active player character, but the phone thing was just an example I gave. There's no character in the cutaway and it's not a phone call. I'm just asking about different ways to accomplish switching rooms and retaining position in general.

Manually setting the position obviously overrides wherever the player last was. That's why I asked for a way to store wherever the player last was.

What I'm asking now though is for clarification on how player coordinates are supposed to behave regardless. Is it room specific or not? Should coordinates set in another room carry over to the next room the character changes to? What's the default behavior in AGS?

Like I said, I thought the default behavior would be that rooms function independently with player coordinates. So if I manually set player coordinates in room 1, it would only apply to when the character is in room 1. Instead, it applies to every single subsequent room they enter. Is that the normal behavior?

That makes sense if player XY is global so when you change the coordinates, it's not specific to that room. It just changes their coordinates for the entire game until they're changed again.

I just want to verify that's what's happening, and I did read the manual about XY way back when I started playing around with AGS so if it specifically states that, I don't remember.
#2
Snarky, I thought it did what I want by default because I assumed the character position is part of the room state that saves when you exit it, but it seems to carry over any coordinates set for previous rooms instead.

Meaning if I manually set the coordinates for room 2, then the player goes to room 3, they start with the same coordinates I set for room 2 unless I manually change it.

Sometimes, that's fine, but if the player walks around, once I switch to any room where the coordinates are set, they won't be wherever they walked when I go back. They again start at whatever coordinates were set in the room they just left.

Either way, I'm asking for instances where I do manually set the character's starting coordinates for that room, so I'll need to override that by going back to wherever the player just was instead of reverting to the manual coordinates I set for it.

Sticking with the example I gave, say the room with the phone in it has a visible door. I set the player's starting coordinates to always be at the door because in 99% of cases, the game will only be switching to that room because the player literally walked into it.

And I like the continuity of them entering at the door each time instead of poofing somewhere else in the room.

But for this situation, the room switch won't be from them walking in, it'll be from a cutaway, so I'll need to tell it to ignore my manual coordinates and use the last ones instead.

ETA: Khris, I'll take a look at that code, thanks! I don't think I'll be doing a cutaway like that more than once or twice so tiny script that won't impact anything else in the game is good.
#3
Okay, thanks, both of you! I wasn't sure if a gui would work because doesn't it need graphics for buttons, unlike hotspots where you just draw the area you want to be clickable? So if I went that route, I'd need to make the buttons transparent?

Khris, I'll look into the game once only thing, I've never seen that before. Thanks for the reminder about the previous room character function! That'll help with this and with the other question I posted I think. I'll post back here when I have some code that works or if I need to troubleshoot what I came up with. Will change to solved for now.
#4
Ok, thanks. I'll work out how to do that. I guess I have to get their current XY coordinates right before the room switch, save that as a variable, then use that variable to set where they'll be when switching back.

I assume by global you mean to use the global variables panel to make it, not the global script? Because I'm sure there will be multiple occasions where I'll want characters to be wherever they last were without wanting to fully script that for every single instance. I'll want to be able to just say "put them blah" where blah = last coordinates.
#5
This may be above the comfort level I'm at with code right now. If so, I can save it for later. I have dialog where the player can agree to look at something. If they refuse, the dialog goes to an exit conversation. If they accept, the game switches to what they're supposed to look at, then goes back to the exit conversation.

Setting up the dialog was fine, but I used a room as the thing they're supposed to look at so they can interact with hotspots within it. How do I tell the game to move on to the exit dialog when it switches back from that room?

Do I have to set up a variable for what just happened, then tell the room to check for it and immediately run the exit dialog if true? The player can look at that thing whenever they want after that without any dialog, so there has to be a way for the game to know to only trigger the exit dialog this one time.

The bigger question would be if there's a simpler way to do that kind of insert without switching to another room, like opening a full screen gui? Like if I want the player to look at a painting and be able to click on different hotspots on it up close to display info, can that be done with a gui or are hotspots only a room thing?

I'm not being specific because I need to learn the concepts so I can apply them to other situations I know will be similar. I don't want that derailed by focusing too much on what I happen to be doing in this one specific instance. Thanks!
#6
Sorry if I remembered this wrong but it seems the default behavior in AGS is that a character's starting coordinates stay the same from room to room unless you manually change them. How do you get them to stay where they were last instead?

For example, what if I use a room switch as a cutaway? This isn't what I'm doing, it's just to explain what I mean. Say there's a phone in the room and the player goes up to it to make a call, then the game switches to another room showing the person on the other end of the line.

When the call ends and the game returns to the room the player is in, they should still be standing where they last were (at the phone), not back at wherever they started the room. How do I handle something like that?

You can just point me to a link if you want. I couldn't get to what I was looking for from search. Thanks!
#7
Okay, thanks, guys! I'm doing so much here, I'd hate to lose everything if my laptop died out of nowhere so I want to make backing up a habit.
#8
I started the game using the default Sierra template and I currently have all of the assets for it in a subfolder of the folder AGS created for the project. That's not where stuff is going to stay. It's just for simplicity while I learn.

I just want to be able to throw a copy of the project onto my PC where if I wanted to install AGS on there to continue working on it, nothing would be missing. Would copying the project folder be enough then?
#9
Sorry if this is addressed somewhere I should've seen. I just want to know what I need to copy over to backup my game? Do I just copy the game folder (and obviously any assets I made for it)? I only work on the game on my laptop but I want to periodically save a copy of it on my PC and I don't want to miss a file or folder that's integral to it running. Thanks!
#10
Hey! Just a heads up, this forum seems pretty organized with what should be posted where. This one is for asking technical questions about using AGS, not feedback on images. Try a subreddit like https://www.reddit.com/r/IndieDev/ instead.
#11
Okay, this is what I did and it's not stuck in wait anymore, so all is well. Thanks, Snarky!

Code: ags
int mycamy = Game.Camera.Y   72;
while (Game.Camera.Y < mycamy) 
{
  Game.Camera.Y  = 2;
  if (Game.Camera.Y > mycamy) 
  {
    Game.Camera.Y = mycamy;
  }
  Wait(2); 
}


My main issue troubleshooting code I write myself is I usually end up changing something that wasn't the problem. I thought using 72 was the issue before (that's the Y the game returned, same as what I calculated now), so I tried to use something else that made it worse.

You confirming it's about factoring in the screen height plus seeing Crimson's code helped me figure out that I was right with the approach. I just messed up the loop I wrote in a way that kept it from animating.

ETA: I tried changing it to 1/1 again now that the code works and it does look smoother now. Maybe something about how the code was before was messing up the scroll.
#12
Ah, I see! The snap part stops it physically overshooting but doesn't stop the actual checks from running once it does. I just assumed it did both. Oops.

The second part goes back to why I asked about width being added there. I didn't get why moving the camera by XY needs to include the size of the camera if that size is inherent unless you change it.

Or is it only needed in Crimson's code because it didn't specify the XY coordinates, so AGS has to calculate what they would be using the cam's width/height?

At any rate, what you described is what I tried to do originally. The cam's XY coordinates control the upper left corner and its height is equal to the screen, so I wanted the final Y to match the very bottom of the room minus that height. I guess I just messed it up somehow.

Coding isn't second nature to me. I'm not a developer. I only know syntax because I did web design and fill in the gaps with the AGS manual. I can see what a code says and guess why it's being applied but don't immediately know. I have to talk through it. I'll play with it when I'm back at the laptop and post what worked!
#13
Thanks! The OP wanted the camera to scroll right, then go up in the last third. I don't need that but like I said, switching it to height changed nothing anyway, and removing it stopped the animation from working entirely, so I just left it for now.

When I tried to write a script for this on my own, I knew I wanted the cam to end at whatever the Y coordinate would normally be when the room starts with tracking on. So before I did anything, I used display to return that Y coordinate and that's what I set my variable to.

I couldn't get my code to work no matter how I tweaked it. That's why I scrapped it and looked for the simplest code I could find that does what I need to work backwards from there. Crimson's code fit the bill. I just don't know how to adjust it to my use without breaking it.

And the "snap" comment sounded like that bit was meant to prevent the thing that I suspected was the problem with it being stuck in wait. The conditions causing the cam to keep trying to go down because they're always met. But I don't know.

For the speed, I set those to whatever I felt like to visually confirm what's happening. It was originally 20 pixels and 5 cycles and I played around decreasing/increasing them to compare. 2/2 was just the first pairing that's exactly the speed and movement I want so I kept it. I just tried using 1 for both instead and it looks exactly the same to me, not smoother.

I'm not worried about that now though. I'm using a placeholder bg and don't know how tall the final bg will be because I haven't drawn it yet, so I may end up tweaking the speed anyway down the line. I'm just trying to nail how to script this movement.
#15
I want to add a simple cam animation at the start of a room. Start at the very top (0,0), move down to the normal position. No modules. The steps seemed easy. Use camera setat to disable autotracking and set the starting position, set the new position, animate between.

As usual, the simple stuff stumps me. Whatever I tried on my own, either it didn't animate or it got stuck in a loop. I found a thread where Crimson posted:

Code: ags
int new_x = Game.Camera.X + Game.Camera.Width;
while (Game.Camera.X < new_x) {
    Game.Camera.X += DISTANCE_PER_GAME_TICK;
    if (Game.Camera.X > new_x) {
        Game.Camera.X = new_x; // snap it to make sure it does not go any further
    }
    Wait(1); // makes engine update the screen
    // you may also play with the speed/delay numbers to find a good combination
}


I'm not doing what that OP did but it's a similar base, so I started with this.

Code: ags
int mycamy = Game.Camera.Y + Game.Camera.Width;
while (Game.Camera.Y < mycamy) 
{
  Game.Camera.Y += 2;
  if (Game.Camera.Y > mycamy) 
  {
    Game.Camera.Y = mycamy;
  }
  Wait(2); 
}


It does exactly what I want at the speed I want, but the scene doesn't continue after the cam reaches its final position. It stays stuck on wait. How do I fix that? Btw I tried using if statements in the room's repeat function instead in case the problem was using while, but that went worse, so let's stick with this. (laugh)

Other questions:

1) Why add width? Changing to height performed the same, removing didn't animate. What's that doing?

2) How do I enable tracking again after? I thought I'd put "Game.Camera.AutoTracking = true" after the code but can't tell if it works since the code is stuck in wait.

Thanks!

Bookmark:
https://www.adventuregamestudio.co.uk/forums/index.php?topic=59379.0
https://github.com/adventuregamestudio/ags-manual/wiki/UpgradeTo35#new-viewportcamera-system
https://adventuregamestudio.github.io/ags-manual/Camera.html
#16
Ah, cool! Thanks so much! That table is a great resource for keeping things current. Modules really do seem useful. A lot of things I considered doing, there were modules for. I just figure if I'm gonna learn, I might as well go full in, but I'll certainly make use of one if I decide to do something that would just be a nightmare for a newbie without it.
#17
I just wanted to thank all on the forum who've hopped in to answer when I have a question! I'm always reminded how much more helpful dedicated old school forums are compared to things like reddit. Honestly, if I didn't feel like I had a reliable place for guidance with AGS, I'd probably lose steam and stop. So thank you, really!  :-D

I've been trucking along with my game. It was just the main controls and text I needed to sort out. Everything else is relatively clear between the manual and tuts. It'll be a while before I get to the next point that I already know I'll need to ask about, but I know you'll be here ready to drop that knowledge when I do!

That's all I wanted to say but I don't think I can post a thread here that isn't a question so I thought of one. Is compatibility an issue with modules? I'm not looking to use any this time around since this is meant to be a learning experience where I script as much as I can from scratch.

But I do wonder if they're made in a way where using a different version of AGS could "break" them? Or would it just be if script in the modules becomes obsolete?
#18
Omg! I forgot that's a dropdown in the panel despite having the flyout arrow. Thanks! It would've been more tedious because of the generic naming so I would've had to scroll to select the edges I wanted anyway (I'm not going to memorize the order they're listed in). But the fact that it highlights the elements in red would've at least tipped to me off to their existence lol It's good that I don't have to click then, but that's how I learned it so not doing that is what I was doing wrong in my steps.
#19
Thanks so much for the detailed info, Laura! I should've been more clear about what I already know and what I don't to save you time but this will help others anyway.

What I couldn't remember was how to customize the border for my text gui. I did it when I first started AGS but going back to update it, I couldn't remember how. I knew I imported graphics for the corners but couldn't figure out where and the only options I had in properties were for the colors.

I finally realized what I was doing wrong. I was zoomed out and the corner graphics were so small I literally couldn't see them. My gui looked like a solid block with no border and the faint outline didn't give it away.

I kept clicking around in it trying to get the borders to come up but I never clicked on the actual window edges themselves. I thought I was crazy until you confirmed that's how you do it! (laugh) What I didn't know was for 2, that I can assign my own gui to the dialog box as well. I thought that might be its own thing for the Sierra template. Thanks!

It's gonna take me a while to remember every setting I see and where and what it does. There's a lot of jumping around between panels, so even though I already went through and played with this stuff and read all about it, I forget if I don't need to look at it again for a while. It took me an hour to remember how to change a character's sprite! :X

It'll stick eventually. Thanks so much for all your help! Also, newwave, the thought bubble thing doesn't have anything to do with what I'm scripting. I just saw it mentioned while reading the manual and didn't remember seeing that setting anywhere so I was curious about it.
#20
Goodness! I looked at the general settings for dialog obviously but I thought the gap between dialog options meant something else lol

For the other one, the setting says "allow speech to be skipped" and mine has always been on the default with the m/kb or timer. I thought that meant speech would stay on the screen unless I manually skipped it or scripted a timer for it to follow.

I didn't realize AGS already had its own timer it would use, so I thought the dialog was moving on its own because that's the normal behavior of speech. Not because of that setting. I switched it to m/kb and it's fine now, thanks!

Now I just need 3 and 4 and can mark it as solved.
SMF spam blocked by CleanTalk