Computer Science Canada RPG Game Help |
Author: | Planet_Fall [ Wed Dec 25, 2013 3:20 pm ] | ||
Post subject: | RPG Game Help | ||
What is it you are trying to achieve? To get back to the dungeon menu after the fight with the Thief. What is the problem you are having? After you win the battle with the thief, it clears the screen and shows the EXP and GOLD you earned and just freezes there. Describe what you have tried to solve this problem I tried making an exit and made the battle a procedure, but after the battle it just won't jump back. Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Please specify what version of Turing you are using Turing 4.1.1 |
Author: | Raknarg [ Wed Dec 25, 2013 5:01 pm ] |
Post subject: | RE:RPG Game Help |
Just figured out what happens. It goes through and exits the fight sequence. it puts the YOU WON stuff, then it jumps to line 171, where you choose to go to an inn, adventurers guild or the theifves' den. However, because of how it is written, it doesn't show that part again. Try it. Once you get to the part where it freezes, press 1. |
Author: | evildaddy911 [ Wed Dec 25, 2013 8:19 pm ] |
Post subject: | RE:RPG Game Help |
if something like this is happening, try using the trace execution tool. go into preferences\editor window and check the "show debugger menu" box. hit ok, click the debugger dropdown menu at the top and "show debugger controls" check trace execution, shrink the window so you can see the whole run window and then try running the program That should help show whats going wrong, and from there, you should easily be able to fix it (all you have to do is add one small command) |
Author: | evildaddy911 [ Wed Dec 25, 2013 8:21 pm ] |
Post subject: | RE:RPG Game Help |
if something like this is happening, try using the trace execution tool. go into preferences\editor window and check the "show debugger menu" box. hit ok, click the debugger dropdown menu at the top and "show debugger controls" check trace execution, shrink the window so you can see the whole run window and then try running the program That should help show whats going wrong, and from there, you should easily be able to fix it (all you have to do is add one small command) |
Author: | Raknarg [ Wed Dec 25, 2013 9:43 pm ] |
Post subject: | RE:RPG Game Help |
That is true. Did you try following your code to see what it does? |
Author: | Planet_Fall [ Wed Dec 25, 2013 10:44 pm ] |
Post subject: | Re: RPG Game Help |
Thanks! I tried following my code to see what was happening and I figured out what the problem was. loop get place if place = 1 then cls % DEN OF THEIVES MISSION put "You go into the ADVENTURERS GUILD to see if you could find a easy job to start with." put "After much thought you think that the DEN OF THEIVES is your best bet." put "Do you accept the mission? (y/n): " .. loop get choice if choice = "y" then Mission_Accepted_Den := true exit elsif choice = "n" then exit else put "Please enter a vaild entry." end if end loop % END OF DEN OF THEIVES exit elsif place = 2 then cls INN exit elsif place = 3 and Mission_Accepted_Den = true and Mission_Accepted_Den_Completed = false then var FLOOR1, FLOOR2, FLOOR3 : boolean := false loop cls put "You enter the DEN OF THEIVES and look around aimlessly, the den is held in a mystical space." put "" put "Where do you go? (Enter Number): " put "1. First Floor" if FLOOR2 = true then put "2. Secound Floor" elsif FLOOR3 = true then put "3. Boss Floor" end if get place if place = 1 then put "You go up to the first floor." delay (500) put " You encounter a THIEF!" name_E := "THIEF" battle_normal exit elsif place = 2 and FLOOR2 = true then elsif place = 3 and FLOOR3 = true then else put "Please enter a vaild entry." end if exit end loop end if exit <---- It was this line right here ![]() end loop end loop It turns out I forgot a 'exit' command so when the battle ended it couldn't loop back to the start. |
Author: | Raknarg [ Wed Dec 25, 2013 10:53 pm ] |
Post subject: | RE:RPG Game Help |
Good work. |