Search found 38 matches
- Fri Mar 15, 2013 5:25 pm
- Forum: General
- Topic: Lua breaking out of a function at random
- Replies: 5
- Views: 4221
Re: Lua breaking out of a function at random
I can't say anything yet about your specific problem about the player's turn getting ignored, but there seems to be an issue with the way you remove table entries during loops. For example, call math.randomseed(455225) at the beginning of love.load. If we're lucky (and you're on Windows and have th...
- Fri Mar 15, 2013 10:26 am
- Forum: General
- Topic: Lua breaking out of a function at random
- Replies: 5
- Views: 4221
Re: Lua breaking out of a function at random
Hi thanks for the reply. When you say 'known initial state' do you mean simply having the same cards played out every time? That should be doable. As for recording and replaying actions I'm really not sure how I'd do that; I have everything printing out in the console window during the game which ba...
- Fri Mar 15, 2013 12:54 am
- Forum: General
- Topic: Lua breaking out of a function at random
- Replies: 5
- Views: 4221
Lua breaking out of a function at random
Hi Guys, I've been looking at this for a few hours now so I thought I'd bring it to you, as I've made no headway. The error occurring is that the game will simply jump out of the user's turn and jump straight into the code that allows the A.I to start determining what cards it can play (this happens...
- Thu Mar 14, 2013 3:01 pm
- Forum: General
- Topic: Help drawing images properly
- Replies: 3
- Views: 2506
Re: Help drawing images properly
Thanks for the help! And I'll remember that in the future, thanks for the info.
- Thu Mar 14, 2013 2:41 pm
- Forum: General
- Topic: Help drawing images properly
- Replies: 3
- Views: 2506
Help drawing images properly
Hi guys, I've got some code here where I'm trying to illustrate a set of 5 cards; the last five played. The problem is that they're being displayed in reverse order: http://imgur.com/AumA5MV That image shows the start of a game, 4 cards played. The first card played is displayed fully, where as the ...
- Sun Mar 10, 2013 2:37 pm
- Forum: General
- Topic: Return not returning
- Replies: 18
- Views: 11678
Re: Return not returning
Cheers, that's really helpful. I check this and let you know how I get on.
- Sun Mar 10, 2013 1:11 pm
- Forum: General
- Topic: Return not returning
- Replies: 18
- Views: 11678
Re: Return not returning
Looking at this section: print("PLAYING A CARD NON AGRESSIVELY OR BASED ON RESETS"); --Resetting Variables Opponent_AI.isMultiples = false; --A little error catch to stop it returning no cards local handNum = 0; for i = 1, #hand do if( hand[i].number >= cardPile[#cardPile].number ) then h...
- Sun Mar 10, 2013 2:11 am
- Forum: General
- Topic: Return not returning
- Replies: 18
- Views: 11678
Re: Return not returning
Maybe it's easier if I just upload my code. If you open it you should get a console window with print outs. The error is specifically happening whenever it prints out "TACTICAL TABLE:0". This should never happen. But you guys know this better than me: please, please tell me what I've done ...
- Sat Mar 09, 2013 2:02 am
- Forum: General
- Topic: Return not returning
- Replies: 18
- Views: 11678
Re: Return not returning
As for the elseif, I'll add that. Though, as I said the function shouldn't be called unless that 'hand' argument being passed in is greater than 1; though I suppose it's always a good idea to have handling for exceptional errors. Another wrong assumption here: what makes you think that if #hand>1 t...
- Fri Mar 08, 2013 9:11 am
- Forum: General
- Topic: Return not returning
- Replies: 18
- Views: 11678
Re: Return not returning
Is hand[index] a table? Not hand itself but hand[index]. If it is actually a table, is the contents of hand[index] empty? Edit: Miko is also right. If #hand is not greater than one, you assume it is 1. Instead, try elseif #hand == 1 and add in the else statement, a "false" value, and chec...