| Author |
Message |
Swaroop Reddy (Skmr)
| | Posted on Saturday, July 08, 2006 - 1:00 pm: | |
Zillions Bug? using if / add-partial Problem 1 - using "if" to "set-attribute" does not work in some situations (define TCCH ( (verify M0?) ;this line used only to show that m0? is recognized (verify (and (not M2?)(not M3?)(not M4?)(not shot?)(not Fing?)(not Ting?)canM?)) g1I (set-attribute Ting? true) (if M0?(set-attribute M0? false)(set-attribute M3? true)) ;non-working if (change-type $1) add-partial )) ;TAKE OUT THE IF AND THE ATTRIBUTEs ARE SET (define TCCH ( (verify M0?); this line used only to show that M0? is recognized (verify (and (not M2?)(not M3?)(not M4?)(not shot?)(not Fing?)(not Ting?)canM?)) g1I (set-attribute Ting? true) (set-attribute M0? false)(set-attribute M3? true) (change-type $1) add-partial )) similar code in other situations works fine Problem 2 - Add-partial does not work in the following situation - it ends the move (define shoot ( mark e e e (set-attribute shot? true) back (set-attribute moved? true) add-partial )) I have tried multiple combinations using add-partial (add-partial ...) (add-partial ) (add-partial ... ) add-copy-partial (add-copy-partial ...) (add-copy-partial ) (add-copy-partial ... ) None of these will let me continue to move the piece as a partial move. I have spent so much time trying to finish this game. Some one please help! I have looked at the memory issues also and I am within limits for the move block etc. |
Mats W (Kålroten)
| | Posted on Sunday, July 09, 2006 - 3:21 am: | |
Swaroop, I can't see anything wrong with your if clauses. I do exactly the same in my programs and it works. The only difference is that I would separate the variable from the parenthesis, like: (if M0? (... (By the way, first you verify MO?, then you change position to g1I, and then you check MO? again. Is the attribute defined on both locations?) Concerning add-partial, I always designate which move-type should be continued, e.g. (add-partial jumptype). Just name your move with a move-type clause. This method seems to work always. Mats |
Swaroop Reddy (Skmr)
| | Posted on Sunday, July 09, 2006 - 9:31 am: | |
Thanks for replying Mats, Problem 1 - if I checked and made sure that there is a space after the atribute, before the patenthesis. The "if" word still does NOTHING. The same piece is moving to g1I which is always empty. I have even tried using the if line before moving to new location. It still does'nt work. The coding is so simple and I have used it so many times before. Problem 2 - add-partial I put in (add-partial movetype). It still does not let me continue the move. I have reached a dead-end in my project if I can't resolve this problem. I am not the only one that had a problem with add-partial (based on other discussions in forum). Swaroop |
Swaroop Reddy (Skmr)
| | Posted on Sunday, July 09, 2006 - 1:37 pm: | |
After reviewing some messages on forum, I think that if the piece does not change positions then add-partial will end move. This is just somehow part of Zillions logic. I have worked around this by moving my piece to a different location with add-partial and bringing it back to original location with an other add-partial. I still cant solve the "if" problem. |
Mats W (Kålroten)
| | Posted on Monday, July 10, 2006 - 1:13 pm: | |
Swaroop, Before you move to g1I M0? is obviously set. But are you certain that M0? is set at g1I? Is there really a piece at g1I with the attribute M0? set? Remember that attributes are only set *after* an add or add-partial is executed, so one can't use these attributes as local variables. Mats |
Swaroop Reddy (Skmr)
| | Posted on Tuesday, July 11, 2006 - 3:40 pm: | |
Thanks Mats I adjusted the code and it is working. (define TCCH ( (verify M0?) ;this line used only to show that m0? is recognized (verify (and (not M2?)(not M3?)(not M4?)(not shot?)(not Fing?)(not Ting?)canM?)) (if M0? g1I (set-attribute M0? false)(set-attribute M3? true)) ;NOW THE IF WORKS (set-attribute Ting? true) (change-type $1) add-partial )) I can see now why the logic works that way. The piece with M0? is the moving piece. When it moves to g1I its attribute is now changed to M3?. Thanks again Swaroop |
|