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.

Script MANIPULATION

OK, sorry to bother you guys again.

Since I'm not too sharp at scripting, I set up this topic. I'm using Mr. MO's ABS 5.5. In my game, I've created an object called the Stealth scroll, when activated, you are able to dash and sneak for long periods of time (I'm sure you're all aware that you can do this in his ABS by pressing the designated input button). In the script, there is an option where you can actually change the variables for the amount of frames you want the dash and sneak state to last. However, I want to be able to control that using a common event. Since there is no call script syntax option for this, I was just wondering:

Is it possible to change it using events? And then revert it to the original settings in the script? I'm trying to directly manipulate the script using events. This might be easy or hard, I can't really tell because I'm not good with scripting.

If anyone could help me out, I'd greatly appreciate it.
 

Haki

Member

Find these lines:
Code:
DASH_MAX = 100 
SNEAK_MAX = 100

and change to

Code:
DASH_MAX = $game_variables[1] #put the number of the variable where dash amount is stored
SNEAK_MAX = $game_variables[2] #put the number of the variable where sneak amount is stored

You can now change dash and sneak values using variables.
 

khmp

Sponsor

You have the right idea Haki but what that code will actually do is set the max for both of the items just once. And if the constants are read as soon as the game starts both of them will be set to nil. Because $game_variables haven't yet been loaded from a save file or created from selecting a new game. He's looking for a more dynamic method of altering them.

Code:
$ABS.dash_max = n
$ABS.sneak_max = n

Whenever you want to adjust the maximum's play with those values using the "Script..." event command.

Good luck with ragnaroa! :thumb:
 

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