How to jump over stuff in Inform 7 - inform7

I have a "door" (a turnstile) between two rooms in Inform 7, and I want the player to have to jump over it.
I have:
The turnstile is inside of the Library. The turnstile is a door.
The turnstile is locked and closed and openable.
The turnstile can be jumped over.
Instead of jumping turnstile:
say "You jumped over the turnstile and ran into the library";
now the player is in Collab Room;
but I get the error:
Problem. You wrote 'Instead of jumping turnstile' , which seems to introduce a rule taking effect only if the action is 'jumping turnstile'. But that did not make sense as a description of an action. I am unable to place this rule into any rulebook.
See the manual: 7.1 > 7.1. Actions
I checked out that section, and googled a bunch, no luck. Any help is appreciated!

The jumping action in the Standard Rules doesn't accept a noun. You'll have to define a new action.
Jumping over is an action applying to one thing.
Understand "jump [something]" and "jump over [something]" as jumping over.
Check jumping over:
say "That seemed unnecessary." instead.
Instead of jumping over the turnstile:
say "You jumped over the turnstile and ran into the library.";
now the player is in Collab Room;
As a side note, The turnstile can be jumped over doesn't do anything by itself: it can be used as a part of the logic for custom rules but Inform doesn't actually understand English so it doesn't automatically pick up such instructions.

Related

How would I make sure that the player has to be near a shelf to search it in my game

I have been making a game in Game maker 1.4 and can't figure out how to make it so that it is required for a player to have Collison with a specific object such as a shelf, desk, Etc. To search the items in it. I'm trying to implement a inventory system. im using the Gamemaker engine language to program this game. I have my player able to walk left and right to interact with objects. If anyone has any info about how I could check for player position/ Collison from my object please help me.
You should check for collision with objects in front first, if that works well, then you can reuse that check to see if it collides with a specific object.
If you use wall objects to check collission with, then you can make an "interactable object" using the wall object as a parent.
Collision by itself is complicated though, there are many ways you can go with it.
I use collision_point() myself to check if objects are colliding in front (and side/back) of the character. https://manual.yoyogames.com/GameMaker_Language/GML_Reference/Movement_And_Collisions/Collisions/collision_point.htm
But that's just the start, you may want to search up collision handling for the game you're making to handle it smoother.

If statement won't work in Inform 7

The toggle is a device.
The toggle is switched on.
If the toggle is switched on:
say "Hi there.".
The third line shows an error about punctuation, saying the phrase doesn't make sense. How is the punctuation wrong, it seems completely fine?
The error message is a bit misleading, but the core issue is that you need context for the if phrase. In other words, you need to define when the condition should be checked, otherwise it's too vague.
It's not entirely clear what you want the code to do, but you could have for example:
Every turn:
if the toggle is switched on:
say "Hi there."

Checking for form correctness in visual basic

I'm developing a small web app using ASP.net/VB.net4 that contains an important form on one of the pages. I need to make sure that the form is filled out correctly, and have decided to go with custom logic to do this, writing each check by hand and checking every element on the page.
My question is actually more fundamental here -- I have the checks written to make sure that the form passes correctness, but I don't actually know in what programmatical structure to put these checks.
For now, I put the checks in an infinite loop in my Visual Basic code behind.
While (True)
If (...) Then
MsgBox("One or more of your phone numbers is improperly formatted. You will be given 20 seconds to correct this mistake. If the mistake is not corrected in 20 seconds, you will be eliminated. Good luck.")
ElseIf (...) Then
...............
Else
Exit While
End If
End While
Upon hitting the submit button, the loop activates and the checks are completed -- however, there is an issue with this method. When the form is not correct, then my alert message continues to pop up infinitely and does not allow the user to exit out. If anyone knows how to avoid this, that would be an appreciated place to start. Furthermore, the default alert box for VB.net is just ugly and unprofessional, I would prefer something in-browser if possible, rather than just an ugly Windows alert message box.
I've seen a lot of sites now going with a dynamic check; that is, as you fill out the form, if at any point your entry is not formatted properly or is incorrect, you get an automatic alert that tells you this and perhaps the text box color changes to red. I would like to do it this way, if possible, since this seems easier for the user. However, I do not know how to do this and have had trouble finding information online about how to implement this. I believe this is an example of AJAX/jQuery usage but it has been a while since I've used them.
This is a painfully common thing to have to do, forms logic that is. I know there are a million and a half ways to do this, but does anyone have any advice or recommendation on how to implement this? Should I be trying to use vb.net (code behind), javascript, or some other way?

GNAT GPS on the fly syntax checking and getting the best out of the IDE

I've started using GPS for coding Ada at work - does anyone have any tips for getting the best out of the IDE? or any plugins I should be aware of?
For example is there a way to enable on the fly syntax/type checking - of the sorts you get in eclipse/visual studio where errors are underlined as you go?
Also what are people's general opinions on GNAT Workbench compared to GPS?
thanks
Matt
The GPS does not have a from of background syntax checking and that is by design. The idea behind GPS is that it is the compiler who decides what code is correct and what code is not correct. It means that if you want to know if your code is correct or not you have to compile it. On a Windows computer the short cut key for that is SHIFT+F4 and will only compile the specification or body file you are currently editing. Pressing F4 will compile your whole project. You will save time by using SHIFT+F4.
Another interesting feature is that the GPS uses cross-reference (XREF) information when navigation through the code. For example, let's say you would like to find all the places in your code where a specific subprogram is called. In GPS (GNAT PRO), right click on the subprogram you are interested in a press Find references. In the GPS GNAT Libre version you don't have a menu when right clicking in your code. In this case go to the Navigate menu and click on Find references there. If the GPS does not find any references and you know that the subprogram is used in the application it means that the XREF information needs to be updated. You may compile the whole application by F4 since the XREF information will be generated along with the binary that is produced. If you go to Edit and click on Key shortcuts you can set up a short cut key to generate the XREF information only. You may also find several interesting features there that you can set up a short cut key for.
The cross-reference information (XREF) is also used for refactoring (GNAT PRO specific functionality). It often works well for changing variable and subprogram names. Just make sure the cross-reference information is up to date!
Code snippets in GPS are also useful. You use them by writing a keyword followed by CTRL+O (not zero, O as in Orwell). To see the code snippets you can choose between go to Edit and click on Aliases. You can also create your own Aliases and code snippets to become a more productive Ada Software Engineer.
Good luck!
I do not think that GPS has a form of background syntax checking like Eclipse does, at least I haven't found it.
I wrote a small sized terminal program in GPS as my first Ada program and my opinion of it is generally negative.
The browser is very confusing and it is hard to find items you are looking for.
The editor has the nasty habit of adding a column to the left and removing it dynamically based on the item under your mouse. What that does is when you are trying to select text with the mouse, your text switches right and left by one character as you move which makes precise selection a difficult thing to do
Getting in the debugger involves too many steps and it generally moves your files in the editor to the EOF position when you set breakpoints, so you will do a lot of scrolling to go back to the sections of interest.
The debugger output looks fancy with all the graphical elements but it is also cumbersome to operate.
GPS offers better help features for Ada libraries though, it's generally easier to browse the standard libraries and check them out than in Eclipse.
All in all, if Eclipse works for you, you might want to stick with it or perhaps open both on the same project and switch to GPS for things like help etc.
I had a related question out here which is on hold now (as I expect your question will soon be due to it's broad content) but I did some research and I am generally dissatisfied with what is out there in the Ada field. The language is great but it suffocates under bad tools.
One last tip: You might want to try Slick Edit as it's text editor and browsing features are quite good, although they too have flaws with Ada (for instance the beautifier).
Good luck with your venture

In Inform 7, is it possible to use a second noun construct with "pull"?

I'll eat my hat if I get a good answer to this...I suspect that although I'm a rank beginner in Inform 7, and I'm guessing this isn't that hard, there are probably not many people here who are familiar with Inform 7. Still, nothing ventured...
I'm trying to create a custom response to a "pull" action. Unfortunately, I think the "pull" action doesn't normally expect a second noun. So I'm trying something like this:
The nails are some things in the Foyer. The nails are scenery.
Instead of pulling the nails:
If the second noun is nothing:
say "How? Are you going to pull the nails with your teeth?";
otherwise:
say "I don't think that's going to do the job."
But while this compiles, and the first part works, the "I don't think..." section is never called...the interpreter just responds "I only understood you as far as wanting to pull the nails." Do I have to create my own custom action for this? Overwrite the standard pull action? Am I missing something simple that will allow me to get this to work?
Have you extended “pull” from the Standard Rules to accept a second noun? As I understand it(*), the standard “pull” doesn't know about “with”. I guess something along the lines of:
Pulling it with is an action applying to two things.
Understand "pull [something] with [something preferably held]" as pulling it with.
Instead of pulling the nails:
say "How? Are you going to pull the nails with your teeth?";
Instead of pulling the nails with something:
say "I don't think that's going to do the job."
*: Warning: I don't understand it at all, and have no idea what I've talking about. :-) I've avoided version 7 of Inform as some kind of Chomskyian nightmare...

Resources