MV Position elements with variables in the SMR HUDMAKER plugin

Hi there.

Thank you for the help you have given me in the forum. They really helped me a lot. That being said, I have another problem.

I am using the HUD-Maker plugin from SRD. It's pretty good, actually. But the problem it has is that it doesn't let you modify the "x" or "y" of the HUD elements with numbers.

This causes me to have the following problem. I have a knife indicator in this interface for the character who is not wearing glasses. The problem is that when it moves to the second position, the indicator will continue in the same position (because I can't change it) and that's what I want to solve.

j84tfg.png


Using a variable to put it in the "X position" and make the number of the variable change according to the position.

As far as I went, I found that the data of the "X" position of the element is stored in "BattleHUD.json" in this line:

"Image":"Knife","Scale X":"1","Scale Y":"1","Opacity":"255","Hue":"0","Blend":"0", "animateInfo":{"x":{"spd":0,"loop":false,"min":0,"max":0},"y":{"spd":0,"loop": false,"min":0,"max":0},"s":{"spd":0,"loop":false,"min":1,"max":1},"r":{ "spd":0,"loop":false,"min":0,"max":0}},"id":14,"x":26,"y":396}

Where it says "x:26" I tried putting x:"${$gameVariables.value(66)}". It did not throw me an error but the knife did not appear with any number. (I really tried to try...)

I hope you can help me and thanks for reading.
if i understand correct, you putting this code edit directly in the plugin code,,so try these 2 options instead your solution :

JavaScript:
"x":($gameVariables.value(66))

or

JavaScript:
"x":$gameVariables.value(66)

the "${}" is for usage in the hudmaker interface.. and probably not for usage in the plugin code.
-> and the code you copied and showed says :
"x":26
not
"x:26" or x:26

like you can see in the javascript code parts above, that makes a difference, the code part is red, the system reads this as text
(@ mods , sry for using the red color/dark-orange this is just to show it better, no offence.. i know red text in this forum is only for mod usage)


also if that doesnt work ,you could try to contact srd over his own website for help/advice..

edit.
just incase it might be usefull..in spoiler i put all stuff i used in the hudmaker interface:
The Scriptcalls i used for the SRD HudMaker
Spoiler: Script info for SRD HUDs
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)

edit2
also it could be that no plugin edit will work, because the data from the hudmaker interface could overwright it anyway.. even if the interface has no data added it might put "no data" instead in the plugin
i have honestly no idea , because srd is using his own code-style which uses his main plugin as core plugin in order to work, and by default nobody does plugin edits for srd plugins
if i understand correct, you putting this code edit directly in the plugin code,,so try these 2 options instead your solution :

JavaScript:
"x":($gameVariables.value(66))

or

JavaScript:
"x":$gameVariables.value(66)

the "${}" is for usage in the hudmaker interface.. and probably not for usage in the plugin code.
-> and the code you copied and showed says :
"x":26
not
"x:26" or x:26

like you can see in the javascript code parts above, that makes a difference, the code part is red, the system reads this as text
(@ mods , sry for using the red color/dark-orange this is just to show it better, no offence.. i know red text in this forum is only for mod usage)


also if that doesnt work ,you could try to contact srd over his own website for help/advice..

edit.
just incase it might be usefull..in spoiler i put all stuff i used in the hudmaker interface:
The Scriptcalls i used for the SRD HudMaker
Spoiler: Script info for SRD HUDs
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)

edit2
also it could be that no plugin edit will work, because the data from the hudmaker interface could overwright it anyway.. even if the interface has no data added it might put "no data" instead in the plugin
i have honestly no idea , because srd is using his own code-style which uses his main plugin as core plugin in order to work, and by default nobody does plugin edits for srd plugins
unfortunately it hasn't worked. I was thinking of contacting the creator but since his youtube channel was inactive for 2 years I didn't think of contacting him.

I will still do it in view of the situation. Help is greatly appreciated, Dopan. Especially for the scriptcalls.

If something contacts me I will share it here.
well the only other solution would be, to not use the hudmaker for these special elements that need different positions, and seek for help in this forum, to build a miniplugin that can do single huds with more options for position changes..

or maybe there are already existing plugins for this, which need to be found^^ idk

Original thread: https://forums.rpgmakerweb.com/threads/position-elements-with-variables-in-the-smr-hudmaker-plugin.156213/