New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Negation of a state in defining a new command #214
Comments
Hi @sultanalnahian, thanks for reaching out. The logic engine powering TextWorld uses the open-world assumption which means that not seeing a particular predicate in the state, does not mean it is false. In your example, a workaround would be to define both
NB: of course, you'll need to add all the relevant |
Hi @MarcCote, thanks for the reply. After executing the |
Yes. Your understanding is correct. If I'm not mistaking, that's what you were trying to do, right? |
Yes, that's right. But It is not working. After giving the
|
I think you need
I just create a PR that will enable you to see what Inform7 events get detected. You can enable debugging like so: |
I have corrected |
Do you have the list of i7_events detected when you try the |
I played around with the code snippet you shared. I was able to make the test_asking.pyimport textworld
M = textworld.GameMaker()
R = M.new_room("Room A")
M.set_player(R)
alice = M.new("pr", "Alice")
R.add(alice)
alice.add_property("not_asked")
M.test() output
person.twl
|
It is working now. So the only change is in the command definition of Thank you very much for helping me. |
Do not hesitate if you have other questions. |
While defining a new command in the logic file, is it possible to mention that certain state cannot be satisfied? For example, I have a game scenario where, you can ask a information to a person. The question can be asked until the person gives the answer. When the person has given the information, you cannot ask the question again. So, I have defined a predicate "asked(pr)", which represents the state when the question has been asked already. And the rule is "ask/pr(pr)" which will be available only when the question was not asked before. So how can I add not "asked(pr)" state in the rule definition?
The text was updated successfully, but these errors were encountered: