Please clarify what you want.
Kind of "We have variable X holding value 105; and we want..."
As for now I can't get what exactly you want to do.
There is no way to make something an actual percentage ie. Print z would display "50%". What you can do, however, is possible to go z=n/100 to get .5, which you could then use as a percentage, just like someone above said.
Remember, a huge part of programming is telling the computer how to do mundane things like display percentages, draw graphs or numbers, or add numbers together. You have to tell the computer everything, minus a couple things that the compiler handles for you. Since it seems this is probably for your game, could I again recommend playing around more with syntax and algorithms before tackling a full-scale RPG? Speaking from experience, I started a little higher than you seem to be when I stated coding the JRPG engine (
and the result has been years of problems that could have been solved by anyone of mediocre experience. Try setting up an action game to try various techniques on before you run full tilt into the single hardest genre to code, script, and otherwise create. You'll thank yourself later when you're coding away, hit a simple problem, and know the solution already from code you've already written.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.