This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
KingofGamesYami's profile picture

Game isn't working properly

Started by KingofGamesYami, 01 June 2016 - 07:37 PM
KingofGamesYami #1
Posted 01 June 2016 - 09:37 PM
http://pastebin.com/tAbhPuXN

"Red Flag Holder" and "Blue Flag Holder" are never printed, but both flags render properly until I terminate the program. Any idea how this could happen? I am using quite a few commands to draw the flags and track the players.
Emma #2
Posted 01 June 2016 - 09:42 PM
http://pastebin.com/tAbhPuXN

"Red Flag Holder" and "Blue Flag Holder" are never printed, but both flags render properly until I terminate the program. Any idea how this could happen? I am using quite a few commands to draw the flags and track the players.

I'm not sure, because I don't have the code for the "partTerm" API that is mentioned. Do you think you could provide that as well?
KingofGamesYami #3
Posted 01 June 2016 - 09:44 PM
partTerm, commandsPlus
Emma #4
Posted 01 June 2016 - 09:51 PM
http://pastebin.com/tAbhPuXN

"Red Flag Holder" and "Blue Flag Holder" are never printed, but both flags render properly until I terminate the program. Any idea how this could happen? I am using quite a few commands to draw the flags and track the players.

Ok, so the partTerm API's render function (which you call at line 13), after looking at partTerm's code, has a while true loop in the render function, so it blocks there forever rendering the flags. You need to have another parallel.waitForAny or waitForAll there to simultaneously render and perform the logic.
KingofGamesYami #5
Posted 01 June 2016 - 10:04 PM
Well, that was stupid. That line shouldn't have existed - I've removed it now, and fixed several other bugs. Thanks!