Placing Variables into an external Sheet
Trying to Build an Online D&d program which stores the character info into Tables my problem is the game works just fine while your playing but as soon as you exit game all varibles are lost which means you have to restart from scratch the next time you log on... So this is a Two Fold Question What is the Best type of External Sheet to save it on... and two How to access sheet for saving and Loading
Below are Varibles
<SCRIPT>
Name1="Tabor Bloomfield";
Name2="Sam Wrightfield";
Name3="Gavin Hartfild";
Name4="Gail Quickfoot";
Name5="Robert Gragorian";
Name6="Peter Shain";
Class1="MagicUser";
Class2="Fighter";
Class3="Fighter";
Class4="Thief";
Class5="Cleric";
Class6="Fighter";
Level1=23;
Level2=1;
Level3=1;
Level4=2;
Level5=2;
Level6=1;
Hp开发者_运维百科ts1=145;
Hpts2=14;
Hpts3=13;
Hpts4=8;
Hpts5=12;
Hpts6=15;
Armor1="Robe of Protection +5";
Armor2="Splinted Armor";
Armor3="Chain Armor";
Armor4="Leather Armor";
Armor5="Chain Armor";
Armor6="Splinted Armor";
Ac1a=5;
Ac2a=3;
Ac3a=3;
Ac4a=4;
Ac5a=2;
Ac6a=3;
Armor1b="Ring of Protection +5";
Armor2b="Small Shield";
Armor3b="Small Shield";
Armor4b="Wooden Shield";
Armor5b="Large Shield";
Armor6b="Small Shield";
Ac1b=5;
Ac2b=1;
Ac3b=1;
Ac4b=1;
Ac5b=1;
Ac6b=1;
Str1=21;
Str2=16;
Str3=14;
Str4=13;
Str5=14;
Str6=13;
Int1=19;
Int2=11;
Int3=12;
Int4=13;
Int5=14;
Int6=13;
Wis1=18;
Wis2=12;
Wis3=14;
Wis4=13;
Wis5=14;
Wis6=12;
Dex1=19;
Dex2=14;
Dex3=13;
Dex4=15;
Dex5=14;
Dex6=12;
Con1=19;
Con2=15;
Con3=16;
Con4=13;
Con5=12;
Con6=10;
Chr1=21;
Chr2=14;
Chr3=13;
Chr4=12;
Chr5=14;
Chr6=13;
</SCRIPT>
File name ="gamestats"
Path="trellian Webpage/droves E and F/gamestats
have tryed html Page,Javascript,Creating a serperate table page and putting the varibles into cells...But at a lost on how to arrive at a solution
You have to provide more details than that Leslie. What programming language? what env? more detailed description of how the variables are stored (in Javascript memory, in a DB...?) and how your logout process works. Narrow it down first :)
You'll have to either use something like Google Gears with local storage, or use a server side language like PHP or ASP.Net to store those values.
Since you're using PHP, I recommend you use the PDO database layer with MySQL or PostgreSQL. There is plenty of documentation for all three.
OK - lets say the tags imply you're using javascript in a html page.
It's best if you start using arrays. More info here: http://www.w3schools.com/JS/js_obj_array.asp
Then you can use ajax to submit this array full of values to the a PHP script which saves this to a database. More info here: http://api.jquery.com/category/ajax/ and http://www.php.net/manual/en/function.mysql-query.php
Also, at the start of a game you can have a PHP script which reads from the database and creates the array.
Thats the basics of doing it one particular way.
精彩评论