variable operations, have it as set... go down to player and on the pull down menu put it as terrain tag. That means when the game checks the numerical value of the variable you just set,it returns the number that you have assigned to that terrain in the tilesets properties.
In simple terms just in case:
YOU: So rpgmaker, what is the numerical value of Variable 001
RMXP: Well my fellow maker, the player is standing on grass... in the editor you set all grass to terrain tag 1 so the value of Variable 001 is currently 1.
YOU: Ahh... but what about if I move my player over onto this gravel...
RMXP: You know the answer! Check in your tilset's properties...
YOU: Okay it seems i set gravel to have a number 4 for it's terrain tag... so I guess the variable mustcurrently be returning 4...
RMXP: Yeah... that is right, that's why it is called a variable, because it can change values!
YOU: Thanks RPG MAKER XP, you are by best friend!
RMXP: Get out the house and go for a walk.