A Foresty Game

Fayabella

  • Posts: 239
I got large objects to work!

Here's an ultra 4k HD example of placing them, not being able to place them on top of other objects, breaking them from any point, and being able to place smaller objects where they used to be (because those are definitely all really impressive things, right?):

I spent way too long on this, and twice I had the wrong variable as an input that was screwing things up. But hey, it works now!

One thing I will note is that unless the cursor is over another object, the large test crate won't turn red to show invalid, even if you can't place it. I'll fix that eventually.


Bombini

  • *
  • Posts: 1400
I spent way too long on this, and twice But hey, it works now!

Oh boy stuff like this happens ;)

Fayabella

  • Posts: 239
That's pretty impressive!
Thanks!
Oh boy stuff like this happens ;)
Yep. Working on a problem for 4 hours only to realize the first code worked, except you accidentally had two if statements instead of if/else? Happens all the time.

Also, I had nothing in mind that needed large object mechanics. I just decided to make it for some reason. It'll definitely be useful in the future, though, so I'm glad I made it now.

Fayabella

  • Posts: 239
Been a while since I've posted here. I got back to work on this today and added mouse-wheel controls for the hotbar and tools. Shift-scrolling changes the tools. I'm going to try and figure out how to replicate this behaviour for the menus, but so far it's proving to be very buggy :p

Luyren

  • *
  • Posts: 2803
If you mean the menu behaviors I made, you can simply call the cycle menu triggers when the mouse whell is scrolled.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.

Fayabella

  • Posts: 239
Well, that's pretty straightforward, haha. I was doing it the bad way: simulating keypresses when the mouse wheel is moved if the menu is open. That didn't work.

Now, I have put an 'updating' event in the "Call Menu" behaviour, just to test it in that window, and inside is an if-otherwise statement checking for mouse wheel updates. It's not updating, however. Is there any reason that the behaviour might not be updating? Actually, it's attached to the player, which is pauseable. That might be it.

Where should I put this 'updating' event, then? In the Scene Events? Is there a better way to check for mouse updates?

Also, is there any extra work I would have to do to make it so that up/down scroll moves it left/right in the top area (that selects things like Inventory, Crafting, Use Item, Move Item, and Reset Level), and once one of those is selected, the scroll up/down moves up and down in those menus?

Actually, I'd probably have to have custom controls per interface. How do I get the current screen the player is interacting with? With that, I can control what events need to be called, and from what controls.

Sorry for like, rambling  on and sort of answering some of my own questions as I wrote this, haha.

Also, while testing this out, I found a glitch: the player could still place objects while the game was paused. Fixed it, of course. :p

Luyren

  • *
  • Posts: 2803
Now, I have put an 'updating' event in the "Call Menu" behaviour, just to test it in that window, and inside is an if-otherwise statement checking for mouse wheel updates. It's not updating, however. Is there any reason that the behaviour might not be updating? Actually, it's attached to the player, which is pauseable. That might be it.

Where should I put this 'updating' event, then? In the Scene Events? Is there a better way to check for mouse updates?
Drawing events aren't paused, so you could use those instead. You can make it in a separate behavior: those menu triggers will only work if the menu is open, as far as I remember.

Quote
Also, is there any extra work I would have to do to make it so that up/down scroll moves it left/right in the top area (that selects things like Inventory, Crafting, Use Item, Move Item, and Reset Level), and once one of those is selected, the scroll up/down moves up and down in those menus?
The triggers are contextual. "NextItem" will advance the options if you are on the options section, and the next inventory if you are selecting an item. Same for "PreviousItem".

But now that I think about it, that top menu is the Call Menu behavior in your setup, and I think it uses a different trigger name (NextOption and PreviousOption). You should be able to simply call both triggers, and the behaviors will only execute them when they are allowed to.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.

Fayabella

  • Posts: 239
I have added scroll controls for each of the menu screens! I feel so powerful, navigating my menus at mach 3. I would probably get a speeding ticket, if they could catch me.

Drawing events weren't working in both the player behaviours and scene behaviours, but an Updating event in the scene behaviour did the trick. I had to check which window was being focused on because the controls did different things in each menu- for example, in the Menu Trade, I had to use PreviousItem when scrolling up and Nextitem when scrolling down, but had to reverse that whenever the player makes use of batch crafting (so they can select the amount of items to craft using the scroll wheel). All of the controls make sense now, though. Also, I disabled wrapping, because scrolling past the end of a list and going to the beginning again using the mouse wheel just felt weird. I have changed the keyboard controls for the menu to WASD instead of arrows, if you'd like to use keyboard controls instead of the mouse wheel.

Thanks for the quick help! This works a lot better, and feels more smooth. I might release an update that's just this, actually. Just have to get rid of my debug stuff first.

Fayabella

  • Posts: 239
Code: [Select]
2.1.1- May 9 2020
-Added scroll controls to hotbar. Scroll up/down to cycle through your hotbar, and use shift+scroll to cycle through your tools.

-Added scroll controls to inventory and menus. In the inventory, use shift+scroll to move horizontally, and normal scroll for vertical. The rest are pretty straightforward.

-Switched from arrow keys to WASD for menu controls.

-Trees now take over a day to grow, instead of an hour.

-Removed FPS counter because I'm probably the only one who needs it.

-Other minor tweaks.

This is good and all, except for how the page scrolls too. Whoops, haha. Is there any to lock scrolling to the game only? Or any other way to get around this?

Fayabella

  • Posts: 239
Hmm... I lost motivation to keep working on this for a bit, but now I have motivation again!

Unfortunately, I don't know what to spend it on. I have no idea what I should add. I know I need a new grass tileset, and a player character, but those are both graphical/artistic things, and I'm not too good at such things, and that's kind of what demotivated me in the first place.

Do any of you have any suggestions? Perhaps for something to add, or fix? I can probably think of things eventually, but I do quite like feedback from other people. Well, not that many (if any) people are that interested in this project. But if anyone wants to suggest anything, go ahead!

merrak

  • *
  • Posts: 2738
What is the larger goal in this game? Is it to survive? Build something?

Fayabella

  • Posts: 239
Both, I suppose. Though I could make it lean more towards either one if I wanted to.

Bombini

  • *
  • Posts: 1400
The answer should be: What is the purpose of the player?
Use your mechanics to reach this.

Could you share your latest build and i could give you some advice.
Cheers!

vicevicebingo

  • Posts: 80
Sadist: You haven't try your best yet! What a foolish slave, do it better!
The longer the game will spend player longer time to play
and be impressive after all! They won't move to next game until
they beat the long game you son of a b****.

Masochism: I am too stupid! I can't follow your best work already!
I am not worth to stay in your sight! Ar! Ar! The shorter the game will
make player goes to play ANOTHER game and not even replay the game,
ar, don't make it short! It will be my hope!! Ar!!!! Can you kick my A$$ pls??!#??