Help a newbie out

Hello guys, I’m new to the website and IF in general so i’m not entirely sure where this topic belongs so please forgive me if i put it in the wrong place. So as i said before I am new to this and am currently creating my first story. I have setup the first room the way I want it and with a door to the next room but I want to make it so it won’t open without a certain item being used.
This is what i have so far:
The Mysterious forest is a room. “The forest hums with mysterious energy,there is a dusty path to the north” .
The tree stump is in The mysterious Forest. The tree stump is a container. The Tree stump contains the sharpened piece of stone.
Instead of taking the tree stump, say “Its rooted firmly into the ground, you cannot lift it”.
The sharpened piece of stone is a thing. It is edible. The description is " Upon further examination, you decide that while not useful as a weapon it could be used to cut through obstacles".
The Clearing is a room.
There is a dusty path.“The path is blocked by a thorn bush”.The dusty path is a door in the mysterious forest. The dusty path is north of the mysterious forest. The Dusty path is south of the clearing.
Before going through the dusty path:say " There is a thorn bush in the way.";stop the action.

I want it to be necessary for the sharpened stone to be picked up before being able to transition to the next room (the clearing).
Thank you in advance for the help!

This rule in your story prevents the player character from going through the door to the next room.

Before going through the dusty path:say " There is a thorn bush in the way.";stop the action.

In Inform 7, you can make a rule switch on or off depending on a condition using the syntax when condition.
To make the story rule switch off when the player character takes the stone from the stump, you can use the condition “the stone is in the tree stump”. This means that as soon as the player takes the stone (so it is not in the tree stump), the rule will be switched off - so now the player can go to the clearing.

Before going through the dusty path when the stone is in the tree stump:say " There is a thorn bush in the way.";stop the action.

In this case I think it’d probably be best not to implement the path as a door, or you’ll get funky messages like “(first opening the dusty path)” when you actually go through it. A rule that prevents the player from going north from the mysterious forest when they aren’t holding the stone should work fine.

So something like:

The Mysterious forest is a room. "The forest hums with mysterious energy,there is a dusty path to the north" . The tree stump is in The mysterious Forest. The tree stump is a container. The Tree stump contains the sharpened piece of stone. Instead of taking the tree stump, say "Its rooted firmly into the ground, you cannot lift it". [Note: You can also say "The tree stump is not portable" to accomplish something similar, I think, though this way you have a customized message which is nice.] The sharpened piece of stone is a thing. It is edible. [!] The description is "Upon further examination, you decide that while not useful as a weapon it could be used to cut through obstacles". The Clearing is north of the Mysterious Forest. [removed the door so we need this map connection.] The dusty path is scenery in the Mysterious Forest. [This guarantees that the player won't be able to take it, and that it won't show up in the "You can also see a dusty path here" paragraph.] "The path is blocked by a thorn bush". Check going north in the Mysterious Forest: if the player holds the stone: say "You cut through the bush with the sharpened stone."; otherwise: say "There is a thorn bush in the way." instead. ["instead" here works the same as "stop the action."] Before entering the dusty path: try going north instead. [So commands like "go on dusty path" or whatever will get redirected to attempts to go north.]

I haven’t tested this so it could mess up! Also, if you do this it’d be nice to program in responses to “Cut bush” and “cut bush with stone,” telling the player that if they have a way of hacking through the bush they can just try to go north. Something like, if the player has the stone, “The stone cuts the bush nicely. You could probably go north through the bush as long as you have it with you to clear a path.”

He could actually make a path that is an open, unopenable door. It’s how stairs are sometimes done.

Do you know how to solve this problem then? It’s an otherwise that says it’s incorrect.

The Luxuria Castle is a room. The Luxuria Castle is northwest of the Desolate Path. “You arrive at a strange castle worshipping the Sin called Lust. [line break] A provocative voice lures you in…”. The Dead Man is in the Luxuria Castle. The Dead Man is a container. The Dead Man contains the Note. The Note is a thing. The description is “BEWARE!!! TAKE THE ORB FROM THE CASTLE CHAMBERS AND GET OUT BEFORE THE S-. It appears he was killed before he could finish his note. [line break] The voice you heard earlier is getting closer and closer, until you can see the Succubus. She stands in front of you with a dagger poised in her hand, ready to strike. She smiles seductively as she licks the dagger and beckons you to come closer.”. The Succubus is a person in the Luxuria Castle.

A person has a number called maximum hit points. A person has a number called current hit points.

The maximum hit points of the player is 100. The maximum hit points of the Succubus is 95.

The current hit points of the player is 100. The current hit points of the Succubus is 95. The Succubus can be slain or alive. The Succubus is alive.

Instead of attacking The Succubus:
let the damage be a random number between 20 and 40;
say “You attack the Succubus, hitting it for [damage] damage!”;
decrease the current hit points of The Succubus by the damage;
say “Succubus health: [current hit points of Succubus]”;
if the current hit points of The Succubus is less than 0:
say “[line break]The Succubus has been slain, and is banished back to the Underworld!”;
now The Succubus is slain;
stop the action;
let the enemy damage be a random number between 15 and 20;
say “[line break]The Succubus attacks you, damaging you for [enemy damage] health!”;
decrease the current hit points of the player by the enemy damage;
if the current hit points of the player is less than 0:
say “[line break]You have been killed by The Succubus!”;
end the story.

Check going north in the Luxuria Castle:
if The Succubus is slain:
say “Now that the Succubus has been slain, you can now proceed through north of the Luxuria Castle.”.
otherwise:
say “The Succubus blocks your path, you must fight it.” instead.

The Lust Chamber is a room. The Lust Chamber is north of Luxuria Castle. The Lux Pedestal is in the Lust Chamber. The Lux Pedestal is a container. The Lux Pedestal contains the Orb of Lust. The Orb of Lust is a thing. The description is “Upon examining the orb, you can hear spirits whispering desires through it, and screams of pain as the spirits are those which were slain by the Succubus.”. The Lux Pedestal is fixed in place.

You’ve made a pretty good start, but there’s still a few problems that need ironing out. Since you said you’re new to this, I took the liberty of making some adjustments to your code, and added some explanations about why I made those changes and what they do. You can copy the code below and paste this right into Inform to see how it works.

[code]The Mysterious Forest is a room. “The forest hums with mysterious energy.”

[I’ve moved the sentence about the path to further down in the code. I’ll explain why when we get there.]

The tree stump is in the Mysterious Forest. The tree stump is a container. The tree stump contains the sharpened piece of stone. The tree stump is fixed in place.

[Making the tree stump “fixed in place” means it will also respond appropriately if you try to push, pull, or turn it. It also means that if some later bit of code accidentally bypasses or invalidates your instead rule, the player still won’t be able to take it.]

Instead of taking the tree stump, say “Its rooted firmly into the ground, you cannot lift it”.

The sharpened piece of stone is edible. The description is “Upon further examination, you decide that while not useful as a weapon it could be used to cut through obstacles.”

[You don’t need to declare that the sharpened piece of stone “is a thing.” That was already assumed when you mentioned it in the paragraph about the tree stump. So you can skip that and jump right in with saying that it’s edible and providing a description.]

The Clearing is a room.

The dusty path is an open, unopenable door. “There is a dusty path to the [if the location is the Mysterious Forest]north[otherwise]south[end if].” The dusty path is north of the mysterious forest. The dusty path is south of the Clearing.

[First, I made the dusty path “open” and “unopenable”. This means that it will always stay open, and the player can’t ever close it, on purpose or on accident. (The “unopenable” property also makes a thing uncloseable.
Second, I put your sentence about the dusty path here, as the path’s initial appearance. This means that the sentence will always appear on its own line, after the room description, which helps signal the player that it’s important. In your original code, your description of the path talked about a thorn bush. However, there was no way to change that description, so even if the player hacked through the thorn bush, the game would still describe it as blocking the path.
Third, notice the words in brackets in the path’s description. Those are text substitutions and they allow the text to change depending on where the player is located. See section 5.6 in “Writing with Inform” for more information about how to do that trick.
Finally, I removed the sentence that said the dusty path was “in” the Mysterious Forest. Technically a door is not “in” any room – it’s always between two rooms. Even if your game compiled, that sentence could have ended up causing problems.]

A thorn bush is in the Mysterious Forest. It is fixed in place. “The path is blocked by a thorn bush.”

Instead of taking the thorn bush:
say “You cut your hands on the sharp thorns.”

Instead of going through the dusty path when the thorn bush is in the location:
say “There is a thorn bush in the way.”

[I’ve added a thorn bush object to your world, so that the player can refer to it and interact with it. There’s an instead rule that prevents the player from taking it (and also it’s fixed in place, like the tree stump), so the player knows they need to figure out how to remove it or get around it. I changed your before rule to an instead rule, because you don’t have to specifically tell an instead rule to stop the action; they do it automatically. If you want a rule to stop the action, the instead rules are usually the best place to put it. Finally, I added a condition to your rule – it only blocks the player’s action when the thorn bush is in the location. If the bush is not in the location, then the rule doesn’t apply and the player can proceed. See section 7.12 of “Writing with Inform” for more information about putting conditions on a rule.]

Instead of cutting the thorn bush when the player is carrying the sharpened piece of stone:
say “You cut through the bush with the sharpened stone.”;
remove the thorn bush from play.

[Inform has a built-in “cutting” action, but it doesn’t do anything unless you write rules for it. This rule applies when the player cuts the thorn bush while carrying the sharpened stone. It prints the message, and then it removes the thorn bush from play. Now the thorn bush is gone from the location, which means that the player can now go north without being stopped.]

Test me with " go north / take bush / cut bush / look in stump / take stone / examine stone / cut bush / look / go north / eat stone "

[When you run the game, type “test me” to enter all these commands automatically.][/code]

I hope this makes sense, and helps you when figuring out how to add more stuff as you get further along.

The issue is the period at the end of the say in the if part which ends the phrase and inform sees otherwise outside of any phrase. Change to a semicolon and all should be fine:

Check going north in the Luxuria Castle: if The Succubus is slain: say "Now that the Succubus has been slain, you can now proceed through north of the Luxuria Castle."; otherwise: say "The Succubus blocks your path, you must fight it." instead.

PS: Use the code tag to preserve indentation (you may have noticed that inform is just as picky as python within those indented forms of blocks).

Thanks everyone for all the help, I very greatly appreciate it. I have progressed quite a bit in my story and come across a problem with combat.

[code]The Bandit Chief is wearing hide armor . The bandit chief is carrying an iron sword.The Bandit chief can be alive or dead. The Bandit chief is alive. The Bandit Chief has a number called maximum hit points. The Bandit Chief has a number called current hit points. The Maximum Hit points of the bandit chief is 20. The current hit points of the bandit chief is 20.

Instead of attacking the bandit chief:
let the damage be a random number between 2 and 12;
say “You attack the chief, causing [damage] points of damage!”;
decrease the current hit points of the bandit chief by the damage;
if the current hit points of the bandit chief is less than 0:
say “[line break]The bandit chief expires and his body falls to the floor lifelessly, taking his hide armor wouldn’t be a bad idea.”;
now The bandit chief is dead;
stop the action;
if the player is carrying bear fur:
let the bandit chief damage be a random number between 2 and 6;
otherwise:
let the bandit chief damage be a random number between 3 and 7;
say “[line break] The chief slashes with his sword, causing [bandit chief damage] points of damage!”;
decrease the current hit points of the player by the bandit chief damage;
if the current hit points of the player is less than 0:
say “[line break] The chief lunges at you with his sword and it finds its mark in the center of your abdomen, you crumple to the floor lifelessly.”;
end the story. [/code]
Inform 7 says that

Can someone help me please? I did combat like this before and it worked but that was without using an item to change the values.

At a glance (and I may be wrong) I’d say it’s because the bandit chief damage temporary variable isn’t defined at the level at which it is referred to. I’d make damage a property of people (a person has a number called damage), so then you can always refer to [the damage of the bandit chief] without having to define a temporary value each time.

try putting:

let bandit chief damage be a number;

just before:

if the player is carrying bear fur: let the bandit chief damage be a random number between 2 and 6; otherwise: let the bandit chief damage be a random number between 3 and 7;

Local variables are known only at the block (or any subordinate block) they are defined in. In this case the if/otherwise is a subordinate block so any new local defined within it is not available to the outer block where the say attempting to use it is located.

I am guessing you are going to be replicating the battle logic for every entity that could be fought which is probably a bad way to go about it. You are going to want to generalize the hostile mob concept into some common fight logic.

One way to do is with a boolean property:

a person can be hostile.

Now you can generalize the movement restriction to:

instead of going when a hostile person is in the location:
    [...]

A similar pattern may be used to generalize the fight sequence as well.

understand "attack [hostile person]" as attacking.

Should get you started…