Jump to content




Why is my program not executing everything?


  • You cannot reply to this topic
4 replies to this topic

#1 Tjakka5

  • Members
  • 256 posts

Posted 05 May 2013 - 12:45 PM

Hey guys,

As you might (MIGHT) know, I'm working on a gigant RPG game.
Now, I was trying to (finally) import the saving and loading of the game, it suddenly didnt execute the last few lines.
Help?

The code:
Watch out, its over 450 lines!
Spoiler

Or get it in your game from here:
http://pastebin.com/Fjv8e5eA

The problem is basicly the last few lines, where I put
print("Baaad")
to test, however, it aint printing it.

Also, just so you know, the waitOs() does aaaaal the work.

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 16 July 2013 - 12:36 PM

There is some weird stuff going on with line breaks in this code (like numerous endfunction() instances), so you may want to verify that the code is exactly as it appears here. This may be why you hadn't received any help previously.

#3 immibis

    Lua God

  • Members
  • 1,033 posts
  • LocationWellington, New Zealand

Posted 16 July 2013 - 04:28 PM

Not the problem, but here:
if map == testMap1 then
          o = testMap1[i]
    elseif map == testMap2 then
          o = testMap2[i]
    elseif map == testMap3 then
          o = testMap3[i]
    elseif map == testMap4 then
          o = testMap4[i]
    elseif map == testMap5 then
          o = testMap5[i]
    end 
why not do this?
    o = map[i]



#4 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 16 July 2013 - 05:01 PM

Have you checked that a term.clear() is not called after you print "baaad"? That is the most likely issue. I have not looked at the entirety of your program yet, but you may find that more quickly than I do.

#5 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 16 July 2013 - 05:05 PM

Indeed, I found it. You call gameMenu through the waitOs function. gameMenu clears the screen every 0.15 seconds. So you actually are printing "baaad", but it is being quickly cleared away by gameMenu.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users