Haw change variable in event by call script with it name

tvorimvsevmeste

Villager
Member
Joined
Nov 11, 2015
Messages
12
Reaction score
2
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,350
Reaction score
332
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
449
Reaction score
149
First Language
Not English
Primarily Uses
N/A
Sorry but I don't get it
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,350
Reaction score
332
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,612
Reaction score
1,407
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
12
Reaction score
2
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,612
Reaction score
1,407
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

Stress testing my latest version of the game with my new madness engine. :LZSexcite:

Hello, where can I find the list of all watched threads? I've been using the Watch function to save the Threads I want to keep but I don't find the list anywhere....

New card design, thanks to all my free time quarantined. (Hope that's not too big of an image XD )
What do you do when you're your family's resident computer 'expert'...but you are anything but a computer expert?
I wanna be the very best, like no one ever was. To make a game is my real test. To play it is my cause.

Forum statistics

Threads
95,586
Messages
930,259
Members
125,884
Latest member
Fuzen
Top