Haw change variable in event by call script with it name

In events can to change variable with default operands. One of them script. Please write an example where will use this variable SELF name/number. ;_;
Not sure what exactly you mean.


$game_variables[2] = The Id you want.


$game_variables[$game_variables[2]]
Sorry but I don't get it
Like on picture 

var.png
Sorry dont know about the name, i can just handle the ids.


Maybe a Scripter drops into this Thread.





You no need to use operator in the script box,


Sinply add your script.


Example


Select ADD or SET


and add a script Ex: $gameMap.canvasToMapX(TouchInput.x) 


◆Contrôler les Variables:#0007 LV = $gameMap.canvasToMapX(TouchInput.x)


This will example set the variable 7 to valur of the mouse position with title


You no need to enter operator in script box , like = , or ++;
Dear Jonforum! What I must do if i need write the follow expression in this script:


     1) if  0<#0007<1 then result=k*sqrt(#0007)     2) if  #0007>=1 then result=1


Please help by example (with picture if you can)
Dear Jonforum! What I must do if i need write the follow expression in this script:


     1) if  0<#0007<1 then result=k*sqrt(#0007)     2) if  #0007>=1 then result=1


Please help by example (with picture if you can)

This will not work first because you are not in the good Page Command Event.


In page 3 in script add this 

Code:
//If the gamevariable 7 are inferior to 1
if ($gameVariables.value(7)<1){
	//your code here [ setValue ( ID, Expresion )]
	$gameVariables.setValue(7, k*sqrt($gameVariables.value(7)));
}// If not than do this
else if ($gameVariables.value(7)>=1){
	$gameVariables.setValue(7, 1);
}

Original thread: https://forums.rpgmakerweb.com/threads/haw-change-variable-in-event-by-call-script-with-it-name.68305/