0 Members and 2 Guests are viewing this topic.
About the number case on the previous page, you can also doif tonumber(char) then your codeend
function equipment() --Define strings for current equipment --Helmet descriptions str_helm = {"Level 1 Leather Cap", "Level 2 Iron Guard", "Level 3 Mithril Helm", "Level 4 Mage Helm", "Level 5 3rd Age Helm", "Level 6 Ultimate Visage", "L3v31 7 L33t H31m"} curhelm = str_helm[helm] --Armor descriptions str_armor = {"Level 1 Leather Body", "Level 2 Iron Mail", "Level 3 Mithril Plate", "Level 4 Enchanted Armor", "Level 5 3rd Age Armor", "Level 6 Champion's Plate", "L3v31 7 L33t P1@t3"} curarmor = str_armor[armor] --Sword descriptions str_sword = {"Level 1 Bronze Dagger", "Level 2 Iron Shortsword", "Level 3 Mithril Longsword", "Level 4 Godsword", "Level 5 3rd Age Greatsword", "Level 6 Great Broadsword", "L3v31 7 L33t D3s1r0Y3r"} cursword = str_sword[sword] --Shield descriptions str_shield = {"Level 1 Wooden Guard", "Level 2 Iron Buckler", "Level 3 Mithril Square Shield", "Level 4 Mirror Shield", "Level 5 3rd Age Heraldic Shield", "Level 6 Champion's Kiteshield", "L3v31 7 L33t D3f3?d?r"} curshield = str_shield[shield] --Robe descriptions str_robe = {"Level 1 Brown Robe", "Level 2 Grey Robe", "Level 3 Blue Robe", "Level 4 White Robe", "Level 5 Black Robe", "Level 6 Epic Robe", "L3v31 7 l33t r0b3"} currobe = str_robe[robe] --Shoes descriptions str_shoes = {"Level 1 Leather Shoes", "Level 2 Iron Studded Boots", "Level 3 Mithril Studded Boots", "Level 4 Shoes of Light", "Level 5 3rd Age Runners", "Level 6 Boots of Lightness", "L3v31 7 L33t R?pp3rs"} curshoes = str_shoes[shoes] --Ring descriptions if ring == 0 then cur_ring = "None" else if ring_sight == 2 then cur_ring = "Ring of Sight" elseif ring_fear == 2 then cur_ring = "Ring of Fear" elseif ring_train == 2 then cur_ring = "Training Ring" elseif ring_wealth == 2 then cur_ring = "Ring of Wealth" elseif ring_cure == 2 then cur_ring = "Ring of Curing" elseif ring_health == 2 then cur_ring = "Ring of Health" elseif ring_l33t == 2 then cur_ring = "L33t R1ng" end end --Bow descriptions str_bow = {"None", "Level 2 Oak Shortbow", "Level 3 Maple Bow", "Level 4 Righteous Longbow", "Level 5 3rd Age Horn Bow", "Level 6 Champion's Bow", "L3v31 7 L33t b0W"} curbow = str_bow[bow] --Arrow descriptions if arrow_type == "normal" then cur_arrows = "Normal" elseif arrow_type == "fire" then cur_arrows = "Fire " elseif arrow_type == "poison" then cur_arrows = "Poison " elseif arrow_type == "ice" then cur_arrows = "Ice " elseif arrow_type == "magic" then cur_arrows = "Magic ?" elseif arrow_type == "light" then cur_arrows = "Light " else cur_arrows = "L33t " endend
--Define the height and width of the screen to be used the rest of on.painth = platform.window:height()w = platform.window:width()function on.paint(gc) --Sets the initial font and color gc:setFont("sansserif", "b", 10) gc:setColorRGB(0, 0, 0) ---values used throughout on.paint() local string_h = gc:getStringHeight(line[1]) local pos_x = 0 local pos_y = 0 local shape_h = 0 local shape_w = 0-----------------------------Intro Screen of the game----------------------------------------------- if mainMenu == 1 then intro(gc) ---With mainMenu = 0 and init = 0, it means we are out of the Title screen, but in the middle of initialization aka character select elseif mainMenu == 0 and init == 0 then ... endendfunction intro(gc) --placing credits to superbany gc:setFont("sansserif", "b", 10) gc:drawString("Presenting Superbany's...", 4, 20) --placing credits to myself gc:setFont("sansserif", "b", 8) gc:drawString("Ported to Lua by Ghezra", w-gc:getStringWidth("Ported to Lua by Ghezra"), h) ...end
...spellstats = {"spell_bolt", spell_bolt, 20, (spell_bolt+1)*5, 25}......assert(loadstring(spellstats[1].." = "..spellstats[1].." + 1"))()...
...spell_bolt = spellbolt + 1...
Code: [Select]...spellstats = {"spell_bolt", spell_bolt, 20, (spell_bolt+1)*5, 25}......assert(loadstring(spellstats[1].." = "..spellstats[1].." + 1"))()...That runs as if it was:Code: [Select]...spell_bolt = spellbolt + 1...
_G[ spellstats[1] ] = _G[ spellstats[1] ] +1
Heya and welcome to the forums. I hope you enjoy your stay (and calc programming). I unfortunately cannot help you, but I was wondering if you had some screenshots and more information on what the RPG will be about, or if it's still too early for that? Of course for such info you may want to use the projects and ideas section, though.I would like to see a graphical RPG for the TI-Nspire eventually.