Polymorphh

Warper
Member
Joined
Apr 5, 2019
Messages
4
Reaction score
3
First Language
English
Primarily Uses
RMMV
Hi! Sorry for my incompetence first off in this thread. I'm not good at reading Javascript code and the things I tried with this have not worked thus far, therefore I am asking here for a meagerly surmountable amount of effort (as all I really need is pointers.) If this is in the wrong place! Sorry! I have generally not posted here due to the fact that the forum isn't really my thing. Though I believe this is something worth a try.

For starters. I made this sort of 'gauge' using SumRndmDde's Hud Maker plugin, which is on his website. But I can't figure out on my own how to really get it to work, I want to bind it to a variable that is then binded to a button that the user presses for it to slowly rise (the bar itself inspired by a game I used to play years ago, called 'Rogue Lineage', but that's unimportant, but I hope it gives reference to what I'm trying to do). Problem is that I am totally lost on trying to find code that would work for this sort of thing. Thereby I am asking for a little assistance here. I'll be out of your hair afterward!

Screenshots for Reference :
1674667369392.png
(The gauge itself, empty due to the removal of code, because I couldn't get my attempts to work without crashing the game due to ... Code-logic reasons(?) )

1674667397502.png
(The thing that's giving me a hassle in question.)

Sorry once again for asking somewhat of a dumb question here! I'm just a little out of sorts.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
6,924
Reaction score
4,763
First Language
English
Primarily Uses
RMMV
Well, the current and maximum value would simply be the value of the variable and...whatever you want its maximum value to be.

You can get the value with $gameVariables.value(X) where X is the ID of the variable (no leading zeros).

To me, the trick is making your button press increase the variable - do you already have something to handle that part?
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
6,968
Reaction score
2,738
First Language
Dutch
Primarily Uses
RMMV
it's like ATT_Turan said, but it would be helpfull what the gauge exactly does?
as gauges can also take the actos HP and MHP for example or MP, TP.

as you didn't say that, you can set the variable options there.

Keep in mind that SRD_HUDMaker for onmap and battle scene,
it require basic JS knowledge on how the system works.

if you are new to the maker, try the inbuilt tutorial on how the variables
and switches and other things works.

there are some SRD_HUDMaker questions which can also answer yours,
or get more knowledge on how to set things up.
 

Polymorphh

Warper
Member
Joined
Apr 5, 2019
Messages
4
Reaction score
3
First Language
English
Primarily Uses
RMMV
Well, the current and maximum value would simply be the value of the variable and...whatever you want its maximum value to be.

You can get the value with $gameVariables.value(X) where X is the ID of the variable (no leading zeros).

To me, the trick is making your button press increase the variable - do you already have something to handle that part?
I do actually! It's a common event / parallel process that allows the user to press shift to increase the quantity of the variable. Although there is another event that constantly decreases this variable. This event only shuts off when shift is being pressed / the gauge is zero.
 

dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
1,254
Reaction score
665
First Language
German
Primarily Uses
RMMV
not sure if thats helpfull but,..

just as sidenote and little help for hudmaker script usage.. these scripts are for actor1, but can easy be used for other actors aswell
(by changing the actor number "1".. into whatever is needed)


The Scriptcalls i used for the SRD HudMaker

Actor current HP:
Code:
$gameActors.actor(1).hp

Actor Max HP:
Code:
$gameActors.actor(1).mhp

Actor current MP:
Code:
$gameActors.actor(1).mp

Actor Max MP:
Code:
$gameActors.actor(1).mmp

Actor current TP:
Code:
$gameActors.actor (1).tp

Actor current LV:
Code:
$gameActors.actor(1).level

Actor Name:
Code:
$gameActors.actor(1).name()

Actor Total current EXP:
Code:
$gameActors.actor(1).currentExp()

Actor current LV EXP:
Code:
Math.abs($gameActors.actor(1).expForLevel($gameActors.actor(1).level) - $gameActors.actor(1).currentExp())

Actor Max EXP of current LV:
Code:
Math.abs($gameActors.actor(1).nextRequiredExp()) + Math.abs($gameActors.actor(1).expForLevel($gameActors.actor(1).level) - $gameActors.actor(1).currentExp())

Actor EXP to Next LV (=> Actor Max EXP of current LV - Actor current LV EXP):
Code:
Math.abs($gameActors.actor(1).nextRequiredExp()) + Math.abs($gameActors.actor(1).expForLevel($gameActors.actor(1).level) - $gameActors.actor(1).currentExp()) - Math.abs($gameActors.actor(1).expForLevel($gameActors.actor(1).level) - $gameActors.actor(1).currentExp())

Needed in Text HUD in order to use script code where X is:
Code:
${X}

Script code to put in "Condition" :
For switches:

Code:
 $gameSwitches.value(x) == true
For variables:
Code:
 $gameVariables.value(x) == n


Script code for Variable (this one is Variable "50" )
Code:
$gameVariables.value(50)
 

Polymorphh

Warper
Member
Joined
Apr 5, 2019
Messages
4
Reaction score
3
First Language
English
Primarily Uses
RMMV
it's like ATT_Turan said, but it would be helpfull what the gauge exactly does?
as gauges can also take the actos HP and MHP for example or MP, TP.

as you didn't say that, you can set the variable options there.

Keep in mind that SRD_HUDMaker for onmap and battle scene,
it require basic JS knowledge on how the system works.

if you are new to the maker, try the inbuilt tutorial on how the variables
and switches and other things works.

there are some SRD_HUDMaker questions which can also answer yours,
or get more knowledge on how to set things up.
The main purpose of the gauge is to simply go up when shift is being pressed, otherwise it'll go down, I made it so spells would have unique effects like in the game I mentioned (Rogue Lineage). If the variables are between [eg#1] and [eg#2]. Then the spell will cast, otherwise it will cast (although weak) with a negative reaction to the user. But otherwise, like what I responded to ATT_Turan with is the actual functions of the gauge in general. Which I just want to be tied to the variable itself.

And I'll try to look through the questions, if I can't, then I think I might have to just make a new 'hud' for the mana thing. Thank you for your, and ATT_Turan's help. I genuinely appreciate it.
 

Polymorphh

Warper
Member
Joined
Apr 5, 2019
Messages
4
Reaction score
3
First Language
English
Primarily Uses
RMMV
not sure if thats helpfull but,..

just as sidenote and little help for hudmaker script usage.. these scripts are for actor1, but can easy be used for other actors aswell
(by changing the actor number "1".. into whatever is needed)


The Scriptcalls i used for the SRD HudMaker

Actor current HP:
Code:
$gameActors.actor(1).hp

Actor Max HP:
Code:
$gameActors.actor(1).mhp

Actor current MP:
Code:
$gameActors.actor(1).mp

Actor Max MP:
Code:
$gameActors.actor(1).mmp

Actor current TP:
Code:
$gameActors.actor (1).tp

Actor current LV:
Code:
$gameActors.actor(1).level

Actor Name:
Code:
$gameActors.actor(1).name()

Actor Total current EXP:
Code:
$gameActors.actor(1).currentExp()

Actor current LV EXP:
Code:
Math.abs($gameActors.actor(1).expForLevel($gameActors.actor(1).level) - $gameActors.actor(1).currentExp())

Actor Max EXP of current LV:
Code:
Math.abs($gameActors.actor(1).nextRequiredExp()) + Math.abs($gameActors.actor(1).expForLevel($gameActors.actor(1).level) - $gameActors.actor(1).currentExp())

Actor EXP to Next LV (=> Actor Max EXP of current LV - Actor current LV EXP):
Code:
Math.abs($gameActors.actor(1).nextRequiredExp()) + Math.abs($gameActors.actor(1).expForLevel($gameActors.actor(1).level) - $gameActors.actor(1).currentExp()) - Math.abs($gameActors.actor(1).expForLevel($gameActors.actor(1).level) - $gameActors.actor(1).currentExp())

Needed in Text HUD in order to use script code where X is:
Code:
${X}

Script code to put in "Condition" :
For switches:

Code:
 $gameSwitches.value(x) == true
For variables:
Code:
 $gameVariables.value(x) == n


Script code for Variable (this one is Variable "50" )
Code:
$gameVariables.value(50)
I actually think I figured out what I wanted to make through this, as I tried the variable thing. Thank you so much!
 

Latest Threads

Latest Profile Posts

On today's episode of Procrastinating on Translating my Game by Making Random Upgrades to the Engine:
arbitrary JavaScript expressions inside messages! Why? Because I can xD
RPGMV_2023-01-26_22-40-39.png
I'm looking for medieval style clothes for the character generator, does anyone have?
Decided to build a stat upgrade system, and a area unlock system. Then it's probably upgrading enemy behaviors. :LZSexcite:

And for anybody who wants to watch me do so, here's a link....
Have you gone through a situation where somebody gets desperate about an issue only because they kept ignoring, for quite some time, THE very same solution they were asking for the whole time?
I've crossed that bridge a couple of times already. XD

Forum statistics

Threads
128,269
Messages
1,193,184
Members
168,717
Latest member
jahmurai
Top