Haw change variable in event by call script with it name

tvorimvsevmeste

Villager
Member
Joined
Nov 11, 2015
Messages
26
Reaction score
3
First Language
русский
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. ;_;
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
Not sure what exactly you mean.


$game_variables[2] = The Id you want.


$game_variables[$game_variables[2]]
 
Last edited by a moderator:

mrcopra

Veteran
Veteran
Joined
Jul 21, 2015
Messages
452
Reaction score
158
First Language
Not English
Primarily Uses
N/A
Sorry but I don't get it
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
Sorry dont know about the name, i can just handle the ids.


Maybe a Scripter drops into this Thread.
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,439
First Language
French
Primarily Uses
RMMV




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 ++;
 

tvorimvsevmeste

Villager
Member
Joined
Nov 11, 2015
Messages
26
Reaction score
3
First Language
русский
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)
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,439
First Language
French
Primarily Uses
RMMV
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);
}
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,863
Messages
1,017,053
Members
137,571
Latest member
grr
Top