I'm coding an RPG and and when I set a variable that I want to be a name,
when I "echo My name is %name%", which I stored the name in,
it shows as "My name is 0".
However, when I code a smaller program, it works. Can someone please help me?
(For some funny reason i can't comment)
You may have used the /a parameter while setting the variable previously. That would mean that the variable would be treated as if it was holding a number. This set /a name=Name should be set name=Name.
Also, as dbenham mentioned, set /a name=Name evaluates to 0, explaining your problem.
set /a name=SomeName evaluates to 0 if there does not exist a variable named SomeName. This would explain the source of the 0 value.
nameto 0 at some point. If the variable was unset, you would see the messageMy name is %name%.setlocalcommand at beginning of all your programs!