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

#21
Ah darn, thanks anyway for the info and the module. If you do ever decide to put it in the module, please let me know..!
#22
OK, I've stuck your script into my game and am having a look around, but nothing obvious is leaping out that I can do to solve my problem. Any advice?
#23
Thanks a bunch, I'll give that a try when I'm near my computer sometime this week!
#24
Hi guys, hope you're all good today.

I have a keyboard controlled character running around in a top down maze type environment.
I'm currently using the “pressing” mode for arrow key control as in the keyboard movement script that comes with the default template.

My question is - if I'm holding for example up and left when I hit a wall (or rather the edge of the walkable area),how can I have the character continue moving left along the wall instead of stopping outright? Sort of the same way many characters in top-down games like Zelda move.

I hope this is clear enough! Cheers.
#25
Thanks a bunch, it's working great now. Cheers!
#26
Hi guys, hope you can help me out!

I'm making a quick game for a friend, using an adaptation of the sierra template that comes with AGS 3.4 and wanted to really strip out all the interactions and have one mouse click handle everything. Initially I simply disabled everything except the walk function and thought I'd put all the interactions with hotspots, objects and characters into anyclick script and use conditionals to check if an item is being used and so on.

I then discovered that the walk mode doesn't appear to use the anyclick script and is its own entity, so ended up keeping interact, so I now have two mouse modes which I can swap between using a right click.

However, I wanted to have the inventory open with a right click and had really got myself set on just having one interaction mode, so I attempted to have the interact function also walk the character. I put a command in game_start forcing the cursor to interact mode (essentially disabling the walk mode) and tried this in the global script:

Code: ags


function on_mouse_click(MouseButton button) {
  // called when a mouse button is clicked. button is either LEFT or RIGHT
  if (IsGamePaused() == 1) {
    // Game is paused, so do nothing (ie. don't allow mouse click)
  }
  else if (button == eMouseLeft) {
    Room.ProcessClick(mouse.x, mouse.y, mouse.Mode); 
    player.Walk(mouse.x,mouse.y, eNoBlock, eWalkableAreas);
    
  }


Initially it seemed fine - the cursor still interacts with my hotspots, and the character seemed to walk around, like I intended. However, something a little odd happens - the character walks fine in one direction, follows my clicks to the pixel, but if I turn the other direction, the character refuses to walk. He just takes a couple of half steps and won't go any further. He even walks in the opposite direction from my click! I've checked my walkable areas and they're all fine, tried starting him in a different room, and even returned the script to its previous state and the problem disappeared. One thing I noticed is that this only seems to happen in scrolling rooms. Is there something obvious I'm missing? Let me know if you have any ideas! Thanks guys.
#27
Hi Crimson, just thought I'd check in and let you know how I solved it in the end.

I ended up using two hotspots, one at the top of the ladder and one at the bottom, and sightly modifying the code you gave me so a downwards scroll is triggered when the player steps on the top of the ladder (which also switches off that hotspot and turns on the second one), and an upwards one triggered by the bottom hotspot (which turns off that hotspot and turns the first one back on). Thanks for all your help in the face of my amateurishness! Appreciated mate.
#28
It throws up an error message:

An internal error has occurred. Please note down yada yada

Error: prepare script error -18. (no such function in script)
trying to run 'room_Afterfadein' (Room 12)

Here's what my room script looks like:

Code: ags

// room script file
bool moving_viewport;
int viewport_speed;
 
function room_Load()
{   gMaingui.Visible=false;
    gAction.Visible=false;
    SetViewport(0, 0);
    moving_viewport = true;
    viewport_speed = 3; // adjust if needed
}
 
function room_RepExec()
{
    if (moving_viewport)
    {
        int y = GetViewportY();
        if (y + viewport_speed >= player.y)
        {
            moving_viewport = false;
            ReleaseViewport();
        }
        else
        {
            SetViewport(0, y + viewport_speed); 
        }
    }
}



I'm going to bed now (It's 3am where I live), but thanks a lot for you help, let me know if you can see what I'm getting wrong!
#29
OK, can't get that to work. Where does the

bool moving_viewport;
int viewport_speed;

go? I've put it in the room script file. Does it need to go in a specific place?
#30
You want it to accelerate and "catch up" with player as he moves and then continue as normal (having character in the center of screen)?

This!
#31
OK, you're just going to have to assume I'm a moron who doesn't understand coding..! Sorry if this is frustrating.

The SetViewport command you first gave me centers the camera on the top of the background, check. I can see the top of the background image, the player is where I want him to be, it's all good.

From that point I want the background to behave like normal. The player can click below the starting point and go down a ladder. I want the background to scroll as normal, following the player character down that ladder to the bottom without a camera jump.

Once again, apologies if this seems like baby talk.




#32
Not quite, sorry. I'll try to explain!

I want the player to see the top of a vertical background, and then for the background to scroll normally after that.

Effectively, I want the player character standing at a door towards the middle of a vertically scrolling background, so that the player can see the top of the background image. This is taken care of by the "viewport" command you specified earlier, thanks! However after that I want to background to scroll downwards as normal when the player clicks below. Everything I've tried so far (including a "releaseviewport" command), results in a jump-cut rather than regular scrolling.

So I basically want the player to start at a place where the top of the background image is visible, but then be able to scroll downwards normally when clicking around the image.
#33
The first part works great, thanks.

However using that second script in the rep ex doesn't seem to make any difference. I then decided to put it in a script called by the player walking to a region, which resulted in a jarring "jump cut" type effect. Is there any way to set the original setviewport command just at room load, and then have it immediately released so the background scrolls normally from then on?
#34
I have a vertical background early in my game. It's about 320/400 and the character emerges from a door approximately halfway down. AGS defaults to showing the immediate environment, approximately the middle 3rd of the background, ie centered around the character, but I want to show the top of the background upon entering the room, with the character appearing at the bottom. How can I make AGS display the entire background from the top?

I hope this makes sense.

#35
Quote from: InCreator on Wed 26/04/2017 13:02:10
Absolutely loving it!
Some hints could appear here and there though. Reached to the very end and... it took me almost an hour to figure out the portrait. Red herrings in inventory didn't help either.

Red herrings? Everything you can get in the demo is useable in some (usually more than one) way. Everything burnable will go in the fire if you trap Thursleigh in the window for example. While this doesn't contribute to the "main" ruin (burning the portrait), it adds a score behind the scenes which in the demo doesn't do much but piss Thursleigh off and lead to some silly dialogues, but in the full game will contribute to unlocking locations/events etc. I am glad you stuck with it for an hour though, thanks!
#36
Thanks for the feedback guys - anyone spot any bugs?

I've let this one sit since I finished the demo, but I've got some time off work next week, so I'll be starting on the rest of the game - got to get a mapscreen and a few more locations in and try to tie it all together. In the meantime do let me know if you have any feedback or thoughts, and watch this space!
#37
Quote from: Cassiebsg on Fri 14/04/2017 19:59:27
PS. I may have spotted a glitch?
Spoiler

Spoilers ahead
Spoiler

I'm pretty sure that after I destroyed the tap downstairs, I went upstairs and destroyed both taps in the bathroom, yet once he started burning, he went downstairs, then up and used the bath tap to save himself...  8-0 Had to go up and destroy it, again....  (wtf)
Not sure what happened there.
[close]
[close]

Hmm, I've just tried that myself and everything seems fine. Can you tell me exactly how it happened, is it repeatable? I discovered a small bug myself in the process, if you just click on the moose's head without selecting a verb, it plays the interaction for when you attempt to use the spanner on it. There's always something...

But yeah, can't get it to do what you said there. If anyone else had the same problem let me know!
#38
Blondbraid - I'd never thought of that but there is a definite resemblance both physical and in character! Perhaps I should give him a chronic wine habit. In fact he was almost called Bernard (I was going for mundane names) but I changed it to Keith because of DOTT. Weird eh?

Thanks for the positive comments everyone, please do let me know what you think of the game, I was trying to do something a bit different and really have no idea if this sort of thing (bitter, destructive protagonist breaks things belonging to other people and tries to put them in hospital) will work in a lucasartsy point and clicker.

On a side note, I've been away from these forums for ten years, so it's nice to be back, even though it seems a lot quieter than it used to be.
#39


Meet Keith Stump (the scruffy guy in the black suit) - he's down on his luck. He woke up one morning to find his wife, car, house and job all gone. Luckily he has lots of friends who want to help him, including bespectacled hipster Thursleigh Worplesdon. Help Keith rebuild his life by running errands for his friends and solving puzzles! Or, if you like, smash Thursleigh's TV with a spanner, set him on fire and generally make sure his life is as RUINED as yours is! Fun for all the family in glorious 320/240 resolution.

Get the demo here: http://s000.tinyupload.com/index.php?file_id=86701505766470831380

This is a demo which comprises the first location of many in the town of Blandville. It is incredibly silly and childish. No real idea when the full game will be ready (it's probably quite a way off), just thought I'd put this out as an experiment and see what people think. You start with a spanner and a monkey in your inventory, though you won't in the full game. Start off by trying to use them on anything you can until you get the hang of things. The ultimate goal of the demo is to hospitalise Thursleigh Worplesdon. GOod luck!

It's still a little rough, some of the interactions aren't done (the oven and washing machine are basically useless at this point), but it's fully completeable. There will probably be bugs here and there so if you come across one, let me know!




SMF spam blocked by CleanTalk