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

#1
Is there a quick and easy way to change a character's movement speed? I have a scripted sequence where I just want a character to run out of the room, while the rest of the game they'd be walking, but I can't seem to figure out how to get it to work.
#2
Sorry if this isn't in the right place, but since I'm not asking for specific criticism on art so much as general advice this seemed like the best place.

I've done a little bit of animation for my game so far, and one of the consistent problems I've had is in figuring out how big to make the canvas around the character. For a good long while it seems like any time the character moves, his character sort of shakes back and forth. I figured out that this was a canvas sizing problem, since differing widths of the picture can put the center of the character in different areas. I managed to get the character's walking animation looking smooth, but I'm not convinced my technique is going to hold up in the long run. When I was doing a search here before I made this thread I saw some people mentioning running into problems if they made their canvas width too wide, and I could see that being a problem for me too.

Basically my technique thus far has been to bring the bottom and top of the canvas so that it's touching the pixels of the character. But for the right and left sides, I've been keeping them exactly the same across the board for the animation. So for instance, if in Frame 1 my character is 190 pixels tall, and 46 pixels wide, but in frame 4 of this same animation my character is 190 pixels tall and 78 pixels wide, then I should probably have all of the frames within that animation be 78 pixels wide. But is this the best way to go about it?

My concern is that, let's say I stick to the 78 pixels wide thing, but then later on I decide I want my character to point a sword at another character, and the sword pointing frame turns out to be 150 pixels wide or something. Is that going to suddenly bite me in the butt and now I have to make all of my animations for this character 150 pixels wide, to make sure that when he points the sword he doesn't appear to suddenly teleport back 50 pixels or whatever?

It seems like there's got to be something pitifully simple about this process that I'm just overlooking, so I figured I'd ask now before I get too far with the art.

As always, thanks for all the advice!
#3
This is probably a pretty basic question, but I'm not sure of the most elegant way of handling this.

Basically my protagonist has an apartment that he will return to at various points in the story. Each time he returns, it will be under different circumstances, and I'd like for his response to be different and for the interactions with the room to be different each time he goes back. It's a linear adventure, not one in which you wander back and forth between locations while you try to figure out puzzles. So for instance, the first time he enters his house, he's by himself, and he's looking to get some stuff out of his place. The second time he enters his place, several hours will have past, and he'll be returning with a friend, and instead of simply retrieving stuff and then leaving, they'll be spending some time in the apartment working on things and talking and that sort of stuff. The third time he returns to his place, his roommate will be home and will confront him about something (the roommate was not home the first two times).

So basically, we have three very different interactions that go on with and within the same room, but the room itself is largely unchanged.

I'm trying to figure out the best way to handle this. As this is my first time using AGS, I have certain ideas on how to make this work, but they most likely won't be the most efficient or simple way to do it, so I'd like some thoughts.

For instance, I could simply use the same images and remake the room three different times, so that I'd have three identical rooms that simply handle the same. This would be very easy to handle from a programming standpoint, but it sounds awfully inefficient. Alternatively I was thinking that I could simply create a Global Variable that adds 1 each time something happens right before he's about to go back to his apartment, and then simply reuse the same room, and have every interaction within the room say if (variable == X) run interaction Y, etc. That seems doable enough, but it also seems like a pretty complicated and convoluted way of running the code.

I'm not sure if there are other, even simpler ways of handling this. Any thoughts or ideas? What have you done in the past when setting up this sort of stuff?
#4
Running into a very bizarre situation. I was pointed in the direction of the Lightweight BASS Template since I wanted an inventory bar and for the game to work with two clicks. I installed that and it's been working great. Earlier tonight I was looking for a way to have the Inventory bar slide in and out instead of simply appearing and disappearing. I'll admit that Tween seems pretty far above my head right now, but after a lot of messing around with it I've started to make headway.

The TwoClickHandler.asc from the BASS template had a pretty simple setup for making the inventory bar show up:

Code: ags

function repeatedly_execute()
{
	if (!gInventoryBar.Visible && mouse.y <= INVENTORY_POPUP_POSITION)
	{
		gInventoryBar.Visible = true;
	}
	
	if (gInventoryBar.Visible && mouse.y >= gInventoryBar.Height)
	{
    gInventoryBar.Visible = false;
	}
}



Pretty simple. I added to it just a little:

Code: ags

function repeatedly_execute()
{
	if (!gInventoryBar.Visible && mouse.y <= INVENTORY_POPUP_POSITION)
	{
		gInventoryBar.Visible = true;
    gInventoryBar.TweenPosition(0.5, 10, 0, eEaseOutTween, eNoBlockTween);
	}
	
	if (gInventoryBar.Visible && mouse.y >= gInventoryBar.Height)
	{
    gInventoryBar.TweenPosition(0.5, 10, -30, eEaseInTween, eNoBlockTween);
    gInventoryBar.Visible = false;
	}
}


In theory, this should have the bar slide in and out of position instead of simply having its visibility turned on and off. However, when I run this, it slides into view like it should, but instead of sliding back out of view it pops out of view. I suspect it's because it's changing it's visibility to false before it has a chance to fully move out of position. This seems confirmed when I put in a Wait(20) script in between .TweenPosition and .Visible. It does exactly what it should be, which would be fine if it weren't for the fact that I'd hate to force the player to wait half a second every time he leaves his inventory.

So I tried setting a timer, and the bar slid out like it was supposed to, but when I moved the mouse down to close it, I got kicked out of the game, and it sent me to the Tween.asc under function _AssertTrue(bool statement, String errorMessage) and highlighted AbortGame(errorMessage), and I got the following error: "Cannot create new tween because the Tween module is currently playing 16 tween(s), which is the maximum. You can increase this max number on the Tween module script header."

This doesn't seem right, as this is the only thing I've used the Tween module for so far. Unless it comes with 16 other Tweens automatically running, I don't get how that could be possible. I increased the Tween count to 20, and got the same message. I increased it to 30, and now I don't get the message, but instead I get a HUGE slowdown upon it sliding close. And then, weirdly, the inventory bar won't slide back out again after that.

I've messed with this a lot trying to work it out. I'm not sure if it's Tween's fault or the BASS Template or something else entirely. It sounded to me like it might have been something that repeated and got caught up by the gInventoryBar.Height line, so I changed that to mouse.y >= 40 and it still caused the same exact issue.

Does anyone have any thoughts on what could be causing this, and what might fix it?
#5
Hi all,

So I started out with the standard Default Game template and have been modifying it a bit while I try to figure out how to code using AGS. Currently I'm trying to design the interface so that it works similar to what you see in the Blackwell games, that is, with a simple, two-button interaction method, and an inventory bar that simply pops up when you move your cursor to the top of the screen. I've managed to figure out how to get it so that left clicking moves around the character and Interacts with hotspots, and right clicking Looks At hotspots. What I can't figure out is how to make the inventory bar work.

I created the inventory bar over the standard icon bar, simply removing the buttons there that I don't need (like changing the mouse cursor to Walk To, Interact, Talk, etc.). When I click on an object that's supposed to create an inventory item, that works fine, and the inventory item drops into the inventory just fine.

The problem comes in when I try to interact with the inventory. I would like left clicking on the inventory item to switch to the Use Inventory mode, while right clicking on the item would be the same as looking at it. Currently, right clicking on an inventory item does nothing at all, and left clicking on it also does nothing at all.

It seems that while my two-button system seems to be functioning in the room, it doesn't work the same way with the inventory. I tested it out by allowing the mouse wheel to cycle between mouse cursors, and sure enough, the Look at cursor will look at the item, and the Interact cursor will pick it up. But that's not what I need.

I've searched the forums pretty thoroughly and while I found a lot of somewhat similar answers, I never managed to find one that solves the problem of the inventory bar when you don't want to cycle between types of interactions.

Is this a pretty simple scripting thing? And do I put it under function on_mouse_click, or elsewhere?

Thanks!
#6
EDIT: Managed to figure this out, hopefully.

I recently added a view to my mouse cursor so that when you hovered over a hotspot or anything else that could be interacted with, the mouse cursor would light up. This works pretty much exactly how it's supposed to, but I've noticed an issue that I can't really resolve. When I access my inventory, whether I click on an inventory item or not, upon exiting the inventory window, my mouse cursor stays permanently changed to the lit up mode, and the only way to get it to go back to normal is to access the inventory again, and use an inventory item on something.

I'm not really even sure where to begin on assessing the issue. I'm not sure if this is some kind of a scripting issue, or if I did the View wrong, or if it's a problem with the inventory GUI (it shouldn't be since I'm currently using the default one).

Has anyone else run into similar issues? Any idea as to where I could start in troubleshooting it?

Thanks.
#7
I'm curious if it's possible to run if/else statements within if/else statements. Like for instance, let's say you use a specific inventory item on an object or hotspot, but you want the object/hotspot's reaction to vary depending on other factors too, such as whether or not you have another inventory item as well. Is this possible?

For example, if the player is trying to get past a guard dog, he might use a doggy treat from his inventory on the dog. But you might want to say that if the player has bacon in his inventory too, then the dog won't be distracted.

So could you write something like this?

Code: ags

function cGuardDog_UseInv()
{
  if (cEgo.ActiveInventory == iDogTreat) {
    cEgo.LockView(5);
    cEgo.Animate(3, 1, 0, eBlock, eBackwards);
    cEgo.UnlockView();
    if (cEgo.HasInventory(iBacon) {
      cGuardDog.Say("Woof! Woof!");
      cEgo.Say("He seems to be attracted to my bacon more than dog treats.");
    }
    else {
      cGuardDog.Walk(352, 451, eBlock, eWalkableAreas);
      cEgo.Say("Nice, it worked.");
    }
  }
}
[/code}

When I try something like this, I get an error message saying "end of input reached in middle of expression" aimed at the second "if" statement.

If this isn't possible, is there some other kind of a workaround?
SMF spam blocked by CleanTalk