by loafingcoyote » Sun Nov 11, 2012 11:46 pm
Hi jjsonique! Thanks for weighing in on this discussion. I understand if you don't have much time for this since, in reality, neither do I. However, any advice or information you have concerning ZIL would be invaluable to me or anyone else around here interested in learning ZIL.
To me it presents an intriguing puzzle and a genuine mystery. It's my understanding that ZIL is the first language made exclusively for writing IF, so I can't believe more people aren't involved with it. Of course, I can understand how daunting it is since, in its current form, it resembles a salvage operation more than anything. That's not to disparage all the hard work that's been put into it, by the way. Without it we wouldn't have anything to work with now!
jjsonique wrote:That's not to say that making a ZILF game at this point would not be some rough going, especially with things like TAKE ALL and OOPS not implemented, and AGAIN apparently broken again.
Yeah, whoever makes a game in ZIL is going to have to approach the project with limited expectations on what they can accomplish. That's why Hugo Comp is the perfect place for new ZIL games. No one is going to be torn appart by wolves for contributing a game that is less than perfect(in either ZIL or Hugo). We're just just glad for new Hugo games, no matter what they look like.
Roody_Yogurt wrote:As far as the A/T token stuff goes, no, it has not been implemented yet, so it was moved to "feature requests." In the meantime, loafingcoyote's earlier code is a good example of how it's within our abilities to contribute on the library/code side of things, so that's cool.
What ZIL needs, other than full time users, is more example code. So, yeah, we can contribute a lot by simply writting functioning code. I've focused on adding simple verb-stub type verbs so far. I also wrote a working version of the verbs "lock"/"unlock". I cheated a bit, since what I wanted to do was add a "KEYOBJECT" property to lockable items, just like Hugo. After an exasperating couple of hours I had to admit that it was beyond my current ability. I ended up having the PRSI(indirect object) handle the locking and unlocking part while the verb routines handle all the default messages. Here is the code:
Code: Select all
<SYNTAX UNLOCK OBJECT WITH OBJECT = V-UNLOCK>
<ROUTINE V-UNLOCK ()
<COND (<NOT <FSET?, PRSO, LOCKABLE>>
<TELL "You can't unlock">
<THEARTICLE .PRSO>
<TELL D PRSO "." CR>)
(<FSET?, PRSO, OPENBIT>
<CTHEARTICLE .PRSO>
<TELL D PRSO " is open." CR>)
(<NOT <FSET?, PRSO, LOCKEDBIT>>
<CTHEARTICLE .PRSO>
<TELL D PRSO " isn't locked." CR>)
(<NOT <FSET?, PRSI ,KEYBIT>>
<CTHEARTICLE .PRSI>
<TELL D PRSI " wont unlock anything." CR>)
(ELSE <TELL "That isn't going to work." CR>)>>
<SYNTAX LOCK OBJECT WITH OBJECT = V-LOCK>
<ROUTINE V-LOCK ()
<COND (<NOT <FSET?, PRSO, LOCKABLE>>
<TELL "You can't lock">
<THEARTICLE .PRSO>
<TELL D PRSO "." CR>)
(<FSET?, PRSO, OPENBIT>
<CTHEARTICLE .PRSO>
<TELL D PRSO " is open." CR>)
(<FSET?, PRSO, LOCKEDBIT>
<CTHEARTICLE .PRSO>
<TELL D PRSO " is already locked." CR>)
(<NOT <FSET?, PRSI ,KEYBIT>>
<CTHEARTICLE .PRSI>
<TELL D PRSI " wont unlock anything." CR>)
(ELSE <TELL "That isn't going to work." CR>)>>
I'm sure this isn't optimal but It works. What the above needs most is for the verb to to be able to match the subject in the messages (whether the PRSO is plural or singular). It's easy to do but I ran out of time.
Now, for any key object, you would need this code in its action routine.
Code: Select all
<ROUTINE SILVERKEY-F ()
<COND (<AND <VERB? UNLOCK>
<EQUAL? ,PRSO ,WOODENBOX>
<FSET?, PRSO, LOCKEDBIT>>
<TELL "You unlock">
<THEARTICLE .PRSO>
<TELL D PRSO " with">
<THEARTICLE .PRSI>
<TELL D PRSI "." CR>
<FCLEAR, PRSO, LOCKEDBIT>)
(<AND <VERB? LOCK>
<EQUAL? ,PRSO ,WOODENBOX>
<NOT <FSET?, PRSO, OPENBIT>>
<NOT <FSET?, PRSO, LOCKEDBIT>>>
<TELL "You lock">
<THEARTICLE .PRSO>
<TELL D PRSO " with">
<THEARTICLE .PRSI>
<TELL D PRSI "." CR>
<FSET, PRSO, LOCKEDBIT>)>>
In this example the silver key unlocks the wooden box, which has the LOCKABLE flag. To use this action routine with other key objects all you would have to do is change the "WOODENBOX" object to the object that the given key unlocks(You would also, of course, have to change the name of the action routine).
That's not quite all. You need to drop one more piece of code into the V-OPEN routine found in parser.zil.
Code: Select all
(<FSET?, PRSO, LOCKEDBIT>
<PRINTR "You'll have to unlock that first.">)
I put it in just before the ELSE statement.
You know, I'm starting to get a little self conscious about posting all this ZIL code in the Hugo Comp thread. I would like to keep this up, but I wonder where would be the best place to post new ZIL code? I can focus on it for about another week before I have to bear down on my Hugo Comp game. Then I expect it will dominate my life(for about four weeks anyway).
Roody_Yogurt wrote:Some more ZILF news. The new release 0.4 is now available here.
The AGAIN issue was tracked down to some specific code.
All right. It's nice to see progress already.
-lc
Hi jjsonique! Thanks for weighing in on this discussion. I understand if you don't have much time for this since, in reality, neither do I. However, any advice or information you have concerning ZIL would be invaluable to me or anyone else around here interested in learning ZIL.
To me it presents an intriguing puzzle and a genuine mystery. It's my understanding that ZIL is the first language made exclusively for writing IF, so I can't believe more people aren't involved with it. Of course, I can understand how daunting it is since, in its current form, it resembles a salvage operation more than anything. That's not to disparage all the hard work that's been put into it, by the way. Without it we wouldn't have anything to work with now!
[quote="jjsonique"]That's not to say that making a ZILF game at this point would not be some rough going, especially with things like TAKE ALL and OOPS not implemented, and AGAIN apparently broken again.[/quote]
Yeah, whoever makes a game in ZIL is going to have to approach the project with limited expectations on what they can accomplish. That's why Hugo Comp is the perfect place for new ZIL games. No one is going to be torn appart by wolves for contributing a game that is less than perfect(in either ZIL or Hugo). We're just just glad for new Hugo games, no matter what they look like.
[quote="Roody_Yogurt"]As far as the A/T token stuff goes, no, it has [b]not[/b] been implemented yet, so it was moved to "feature requests." In the meantime, loafingcoyote's earlier code is a good example of how it's within our abilities to contribute on the library/code side of things, so that's cool.[/quote]
What ZIL needs, other than full time users, is more example code. So, yeah, we can contribute a lot by simply writting functioning code. I've focused on adding simple verb-stub type verbs so far. I also wrote a working version of the verbs "lock"/"unlock". I cheated a bit, since what I wanted to do was add a "KEYOBJECT" property to lockable items, just like Hugo. After an exasperating couple of hours I had to admit that it was beyond my current ability. I ended up having the PRSI(indirect object) handle the locking and unlocking part while the verb routines handle all the default messages. Here is the code:
[code]
<SYNTAX UNLOCK OBJECT WITH OBJECT = V-UNLOCK>
<ROUTINE V-UNLOCK ()
<COND (<NOT <FSET?, PRSO, LOCKABLE>>
<TELL "You can't unlock">
<THEARTICLE .PRSO>
<TELL D PRSO "." CR>)
(<FSET?, PRSO, OPENBIT>
<CTHEARTICLE .PRSO>
<TELL D PRSO " is open." CR>)
(<NOT <FSET?, PRSO, LOCKEDBIT>>
<CTHEARTICLE .PRSO>
<TELL D PRSO " isn't locked." CR>)
(<NOT <FSET?, PRSI ,KEYBIT>>
<CTHEARTICLE .PRSI>
<TELL D PRSI " wont unlock anything." CR>)
(ELSE <TELL "That isn't going to work." CR>)>>
<SYNTAX LOCK OBJECT WITH OBJECT = V-LOCK>
<ROUTINE V-LOCK ()
<COND (<NOT <FSET?, PRSO, LOCKABLE>>
<TELL "You can't lock">
<THEARTICLE .PRSO>
<TELL D PRSO "." CR>)
(<FSET?, PRSO, OPENBIT>
<CTHEARTICLE .PRSO>
<TELL D PRSO " is open." CR>)
(<FSET?, PRSO, LOCKEDBIT>
<CTHEARTICLE .PRSO>
<TELL D PRSO " is already locked." CR>)
(<NOT <FSET?, PRSI ,KEYBIT>>
<CTHEARTICLE .PRSI>
<TELL D PRSI " wont unlock anything." CR>)
(ELSE <TELL "That isn't going to work." CR>)>>
[/code]
I'm sure this isn't optimal but It works. What the above needs most is for the verb to to be able to match the subject in the messages (whether the PRSO is plural or singular). It's easy to do but I ran out of time.
Now, for any key object, you would need this code in its action routine.
[code]
<ROUTINE SILVERKEY-F ()
<COND (<AND <VERB? UNLOCK>
<EQUAL? ,PRSO ,WOODENBOX>
<FSET?, PRSO, LOCKEDBIT>>
<TELL "You unlock">
<THEARTICLE .PRSO>
<TELL D PRSO " with">
<THEARTICLE .PRSI>
<TELL D PRSI "." CR>
<FCLEAR, PRSO, LOCKEDBIT>)
(<AND <VERB? LOCK>
<EQUAL? ,PRSO ,WOODENBOX>
<NOT <FSET?, PRSO, OPENBIT>>
<NOT <FSET?, PRSO, LOCKEDBIT>>>
<TELL "You lock">
<THEARTICLE .PRSO>
<TELL D PRSO " with">
<THEARTICLE .PRSI>
<TELL D PRSI "." CR>
<FSET, PRSO, LOCKEDBIT>)>>
[/code]
In this example the silver key unlocks the wooden box, which has the LOCKABLE flag. To use this action routine with other key objects all you would have to do is change the "WOODENBOX" object to the object that the given key unlocks(You would also, of course, have to change the name of the action routine).
That's not quite all. You need to drop one more piece of code into the V-OPEN routine found in parser.zil.
[code]
(<FSET?, PRSO, LOCKEDBIT>
<PRINTR "You'll have to unlock that first.">)
[/code]
I put it in just before the ELSE statement.
You know, I'm starting to get a little self conscious about posting all this ZIL code in the Hugo Comp thread. I would like to keep this up, but I wonder where would be the best place to post new ZIL code? I can focus on it for about another week before I have to bear down on my Hugo Comp game. Then I expect it will dominate my life(for about four weeks anyway).
[quote="Roody_Yogurt"]Some more ZILF news. The new release 0.4 is now available here.
The AGAIN issue was tracked down to some specific code.
[/quote]
All right. It's nice to see progress already.
-lc