Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Help troubleshooting this eventing problem!

In my game, I got Aleworks Input controlling a characters JUMP. Control is the button to push to make the character jump. I have everything working fine, the character jumps in the right direction he is facing and only jumps once. It looks good so far. Now I need it to take away 5 points of stamina(SP) for each jump. I have SP linked up to a variable named Stam and I check in the common event if the variable Stam is big enough to take five away. If it isn't, well then it won't let him jump. I got that working for jumping only UP and DOWN. When my stamina reaches 0, I can't jump up or down, but I can still jump left and right. This where I am puzzled.

The event process and everything match perfectly, albeit the different player move routes for jumping. I'll give you a demo so you can give it a good look. There are no spoilers of story whatsoever in the demo.

DEMO 1.1 MB

The jump events are all in the Common Events section, and run parallel with my HUD switch. If the HUD is on, your in control, so please don't play with all that. Only touch the jump events. Thanks in advance!

Peace,
Mundane
 
Your conditional uses variable 3, but nowhere do you set variable 3 = to the player's SP in those common events.
I don't know why it works correctly for just up/down, but if you add in a
Variable 3: set to Player's SP.  Then it works for all directions

Edit:  Just noticed you do have it set in the first parallel process.  I my line into one of the jump processes, and it worked as desired.  Still looking to see why it would act this way.

Edit:  Aha!

Your time system script is using the first few variables.  Change the constants in your time system script to point to the variables you want to use.

Code:
 #====================================
    # Time System: Game Variable Options
    #====================================
    @use_vars = true      # assign time to game play variables
    @sec_var = 1          # Variable to which to store Seconds
    @min_var = 2          # Variable to which to store Minutes
    @hr_var = 3   # Variable to which to store Hours (stored using 24-hr format)
    @day_var = 4          # Variable to which to store Days
    @weekday_var = 5      # Variable to which to store Name of the Day

Change those to the variable numbers you want it to use.  To debug stuff like this in the future, use the F9 debug menu to look at your variable values during test play.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top