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

#1
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!
#2
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!
#3
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!
#4
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
#5
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?
#6
I don't want to flood the forum today so I'm putting all of these together since they're related. I don't think I've been googling the right keywords or searching here properly.

1) Is there a simple way to keep "say" lines on screen until the player advances them in the same way "display/displayat" works?

2) Is there a way to customize the look of the dialog bar that pops up on the bottom? Just changing the background color or more importantly, how close the responses are to each other. It looks smooshed to me.

3) How do I change the border of the regular text box? I know I can change the background color in the gui but I could've sworn the tutorial said you can change the border as well somehow and don't remember.

4) This is random but the manual mentions a "thought uses bubble GUI" setting. Where is that?

Thanks!

Bookmark
https://adventuregamestudio.github.io/ags-manual/Character.html
https://adventuregamestudio.github.io/ags-manual/Globalfunctions_Message.html
https://adventuregamestudio.github.io/ags-manual/Game.html
#7
I'm not at the laptop where I'm making the game so I can't post code. I'm just looking for educated guesses on what could be happening. I'm using one cursor mode (interact) and all of that works fine.

I wanted to try changing the cursor image when I hover over certain objects just to give players a visual cue that it's something they can interact with. I used the basic getlocationtype method in repeatedly execute.

It works fine for hotspots, objects, and reverting back to default when there's nothing, but it doesn't change when hovering over a character. My hunch then is something about the character is the problem but I don't know.

This is a blank room I use to test code, so nothing is actually happening in it. The character is just standing where I set in their properties, away from the player character. Any thoughts on where to dig for what could be causing the problem?
#8
I don't remember this happening before unless I just didn't notice, but when I'm viewing a room's elements in the room editor, I can't seem to have visibility toggled on for both hotspots and walkable areas at the same time. It only lets me view one or the other. Everything else, visibility stays on. Is this normal?
#9
The default controls player movement with the arrow keys and wasd does nothing. I want to also be able to use wasd. The keyboard movement module it comes with has the arrow keys defined as default here:

Code: ags
 keymap.KeyDown = eKeyDownArrow;
  keymap.KeyLeft = eKeyLeftArrow;
  keymap.KeyRight = eKeyRightArrow;
  keymap.KeyUp = eKeyUpArrow;


I thought I could just add the wasd keys using OR but it doesn't change anything if I try...

Code: ags
keymap.KeyDown = eKeyDownArrow || eKeyS;


Is that because operators don't work when defining, only for checks (like in if/else statements) or is my syntax just wrong? The global script has its own section that defines wasd for movement...

Code: ags
  //KeyboardMovement.KeyUp = eKeyW;
  //KeyboardMovement.KeyDown = eKeyS;
  //KeyboardMovement.KeyLeft = eKeyA;
  //KeyboardMovement.KeyRight = eKeyD;


If I remove the comments to actually enable those lines, it overrides the module and the player controls with wasd instead of arrows. How would I enable both? Thanks!
#10
I was reading through global functions and looking at getlocationtype, which returns what type of element is at that screen location (hotspot, character, object, nothing). The example the manual gave is...

Code: ags
if (GetLocationType(mouse.x,mouse.y) == eLocationCharacter)
    mouse.Mode = eModeTalk;


I read it as if it's a character, use the talk cursor mode. It's easy enough. But every time I see getlocationtype used in the forums, there's this...

Code: ags
int lt = GetLocationType(mouse.x, mouse.y);


I read that as defining a custom variable named lt that stores whatever value getlocationtype returns. Is that just to simplify the code by being able to type lt for checks instead of writing out that whole line or does lt actually do something on its own?

This is my main hurdle learning scripting. Telling the difference between what someone is writing because that's how it has to be written in AGS (built-in functions/variables/whatever with fixed names and uses), or if it's just their own custom stuff that can be done another way.

Like if I hadn't gone through the tutorial, I would've assumed a hotspot and character need a lowercase h and c to work. Not that it's just convention. Especially when there are other things like cursor modes where the lowercase letter in front does need to be there because that's how its script name is hard coded.

Basically, I don't want to just parrot how someone else does something. I want to understand the core way of doing it so I can then apply my own custom approach. That's why I focus so much on the manual.

The forums are great because I almost always find threads relevant to what I'm learning about. I just end up wasting a lot of time trying to figure out if something in the recommended code is built-in or custom lol

Bookmarked
https://adventuregamestudio.github.io/ags-manual/Globalfunctions_General.html
#11
I found threads for this but those users were way past where I'm at. I need to understand this from the ground up. Inventory can stay how it is. I want the game to use one cursor with this behavior:

- When you hover over an object, hotspot or character, it shows their name. 
- When you click on an object, hotspot or character, it interacts.

How it interacts depends on the thing. If it's a character, you'll talk to them. If it's a hotspot, a description will appear. If it's an object, you'll either take it or use it. I get how to script these things individually but I don't know how to do this globally.

1) Is all of this handled in the global script?
2) Which part of this can be done just by changing the built-in cursor mode settings?

I saw a thread mention setting standard mode to false for cursors you don't want. I see it removes that cursor from the list player cycles through. Is that all it does? I want to tackle this with my own custom cursor but I don't want to waste time so I'm asking about it first.

Thanks!

Bookmarked
https://adventuregamestudio.github.io/ags-manual/EditorCursor.html
https://adventuregamestudio.github.io/ags-manual/Mouse.html
#12
I've been working on an intro. I set it up where room 0 has no background so it's black. There's a room size gui with a start button. When you press start, the gui disappears to reveal the room.

Then I used the "on key press" function to trigger text I wrote with "display at" so I can alternate between it being located on one side of the room and the other to imply different people talking.

I then used the "player change room" property to change to room 1. Since I'm still learning, I kept the tutorial room built into the template as room 1.

It does what I want. You press start to begin the game, press space/enter/whatever to advance the text, then it fades to reveal room 1 with the player standing in the same location as desired.

The problem is nothing happens after that. I started both room scripts with "after fade in" from events, but with room 1, no code I add in that function actually happens except placing characters. I can't even move.

For example, I tried using display at again and the text doesn't show up. I tossed in a bunch of functions to test. No response. I don't get any compiler errors, room 1 just fades in and sits there.

Is there something I'm specifically supposed to start and end rooms with to make sure each subsequent room works? I put "player change room" inside the "on key press" function of room 0 just because that was the last function in the room. Could that be messing things up somehow? Thanks!
#13
Sorry, I've been searching for answers and rarely find what I'm looking for despite browsing the manual, the forum, etc., probably because I'm using the wrong keywords or phrasing. Also, the forum search specifically gives me an error and says to try again later.

I just started with AGS and went through the tutorial using the Sierra template. It was a breeze, very useful. Now I'm moving onto tweaking the template to fit my needs and I've been figuring everything out bit by bit except movement.

The default behavior is that the player can walk left, right, up and down. My game will have no room depth. I only want the player to be able to walk left or right, with up and down controls causing the player to face up or down. Not actually move.

I can't find anything about how to turn moving up and down off. If it's a character setting, a room's walkable area setting, if it can even be done without writing my own script. Every time I search for character movement, walking, directions, controls, I get info about animations, not movement within the room itself.

Can you point me in the right direction? Thanks!
SMF spam blocked by CleanTalk