<object name="room that changes script once">
<inherit name="editor_room" />
<description type="script"><![CDATA[
if (GetBoolean(room that changes script once, "changed")) {
msg ("<b>The room looks brand new. The floor is covered in carpet and the walls and ceiling got a new colorful coat of paint!</b>")
}
else {
firsttime {
msg ("This room will change appearance twice. The first is the following:<br/><br/><b>You are in a bare room. Nothing is here. Four white walls, a ceiling, and a floor.</b><br/><br/>If you look at the room again, you will see a simplified version of the description. You can even look at the walls, ceiling, and floor.<br/><br/>These descriptions were accomplished with a first time/otherwise script. When you entered the room, a turnscript started to change the room after six turns. You'll know when to look around again.")
}
otherwise {
msg ("<b>Bare room. White walls and ceiling. Wooden floor.</b><br/><br/>In a few turns, the room will change description drastically. This was set up in the 'After entering room' script. After six turns, I raised a flag on the 'room that changes script once' room. I called it changed. In the floor, ceiling, walls, and room description, I used an 'If' script to check and see if the flag 'changed' was true.")
}
}
]]></description>
<enter type="script">
SetTurnTimeout (6) {
msg ("Without warning, a slew of construction workers and artists come rushing in. In a hysteria of carpentry and painting the room you are in gets a make-over. As soon as they arrived, they depart, leaving you in a new room! Take a look!")
SetObjectFlagOn (room that changes script once, "changed")
}
</enter>
<object name="walls1">
<inherit name="editor_object" />
<alias>walls</alias>
<alt type="stringlist">
<value>wall</value>
</alt>
<usedefaultprefix type="boolean">false</usedefaultprefix>
<look type="script">
if (GetBoolean(room that changes script once, "changed")) {
msg ("The walls are painted in an array of colors. They look like a swirl of graffiti. There are pinks and yellows and blues and whites and greens, all swirled together in a hypnotic blend.")
}
else {
msg ("Four white walls. Nothing remarkable.")
}
</look>
</object>
<object name="floor">
<inherit name="editor_object" />
<look type="script">
if (GetBoolean(room that changes script once, "changed")) {
msg ("The floor that once was boring wood is now carpeted and plush. Feels good on your feet!")
}
else {
msg ("One wooden floor. Quite boring.")
}
</look>
</object>
<object name="ceiling">
<inherit name="editor_object" />
<look type="script">
if (GetBoolean(room that changes script once, "changed")) {
msg ("The ceiling was once flat, boring, and white. It is now accessed by crown molding and has a comfortable beige tint to it. Much nicer!")
}
else {
msg ("A ceiling. Plain. Boring.")
}
</look>
</object>
<command name="explain room cmd">
<pattern>explain room</pattern>
<script><![CDATA[
msg ("There are really two ways to get the room description to change once. The easiest is the use of a 'First time/Otherwise' script.<br/><br/>1. Simply choose to run a script instead of having the default 'text' description.<br/>2. To this script, add new script and select the 'First time...' script under the scripts category in the GUI.<br/>3. In the First time section below the Run script, click add new script. Type whatever message you want for your room description.<br/>4. Repeat this for the 'Otherwise' section. Add a message that you want to print every other time the play enters the room or types 'look'.<br/>---<br/>5. In addition to this, I added a 'Run script after set number of turns' to give you another look at the room. After six turns, I printed a message to indicate that the room is now different.<br/>6. I also added a flag... add new script, set object flag (under variables), and set object flag on the room called changed.<br/>7. You can place an 'If' script in the room description box and have it look like this --> If object has flag object [current room name] flag name changed, then print the message explaining the changed script.")
]]></script>
</command>
</object>
firsttime {
if (GetBoolean(player, "shedopen")) {
msg ("There's a small shed here. The door hangs off its hinges.<br/><br/>You can go south or in.")
}
else {
msg ("There's a small shed here. The door is closed and locked with a padlock, but it all looks rather flimsy.<br/><br/>You can go south or in.")
}
}
otherwise {
if (GetBoolean(player, "shedopen")) {
msg ("The small shed sqauts miserbaly in the long grass, it's door hanging from the hinges.<br/><br/>You can go south or in.")
}
else {
msg ("The small shed sqauts miserbaly in the long grass. The door is closed and locked with a padlock.<br/><br/>You can go south or in.")
}
}
if (Got(Axe)) {
msg ("The inside is thick with dust.")
}
else {
msg ("The inside is thick with dust. There's an axe lying in the corner.")
}
<object name="outside hut">
<inherit name="editor_room" />
<description type="script">
if (GetBoolean(hut, "")) {
}
</description>
<object name="hut">
<inherit name="editor_object" />
<look type="script">
if (GetBoolean(hut door, "bashed")) {
msg ("It's a small hut with a gaping hole where the door used to be. The door lies around the threshold in ruins.")
}
else {
msg ("It's a small hut with a moderately sturdy door on its front that is supposed to keep scum like OurJud out!")
}
</look>
</object>
<object name="hut door">
<inherit name="editor_object" />
<scenery />
<look type="script">
if (GetBoolean(hut door, "bashed")) {
msg ("The door here lays in splinters. You sure showed it who is boss!")
}
else {
msg ("It's a door that with a little ramming or slamming or kicking might just collapse inward.")
}
</look>
<ram type="script">
firsttime {
msg ("You slam into the door with all your might. You hear a *CRACK* but you think that might have come from your shoulder! Maybe you should try again?")
}
otherwise {
if (GetBoolean(hut door, "bashed")) {
msg ("Why would you want to bash an already destroyed door. Just go in!")
}
else {
msg ("You throw your mighty belly against the door with all your might. *CRASH* The door is splintered into a gazillion pieces. Really... a gazillion.")
SetObjectFlagOn (hut door, "bashed")
}
}
</ram>
</object>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<exit alias="in" to="inside hut">
<inherit name="indirection" />
<locked type="boolean">false</locked>
<runscript />
<script type="script">
if (GetBoolean(hut door, "bashed")) {
msg ("You step across the recently destroyed door and into the hut.")
MoveObject (player, inside hut)
}
else {
msg ("There is a door that blocks your way.")
}
</script>
</exit>
</object>
<object name="inside hut">
<inherit name="editor_room" />
<description type="script">
if (GetBoolean(hut door, "bashed")) {
if (GetBoolean(axe, "taken")) {
msg ("You are standing in a small hut. There is little to be seen here. Even the priceless axe that once rested on the wall is missing. You can go out if you step over the remains of the busted door.")
}
else {
msg ("You are in a small hut. There is little to be seen here except for the small axe that is resting against the wall. You can go out if you step over the remains of the busted door.")
}
}
else {
if (GetBoolean(axe, "taken")) {
msg ("You are standing in a small hut. There is little to be seen here. Even the priceless axe that once rested on the wall is missing. The hut door stands firmly anchored on its hinges.")
}
else {
msg ("You are in a small hut. There is little to be seen here except for the small axe that is resting against the wall. The hut door stands firmly anchored on its hinges.")
}
}
</description>
<object name="axe">
<inherit name="editor_object" />
<take type="script">
msg ("Don't go cutting your thumbs off, Paul Bunyon.")
SetObjectFlagOn (axe, "taken")
</take>
</object>
<exit alias="out" to="outside hut">
<inherit name="outdirection" />
</exit>
<object name="hut door1">
<inherit name="editor_object" />
<scenery />
<look type="script">
if (GetBoolean(hut door, "bashed")) {
msg ("The door here lays in splinters. You sure showed it who is boss!")
}
else {
msg ("It's a door that with a little ramming or slamming or kicking might just collapse inward.")
}
</look>
<ram type="script">
firsttime {
msg ("You slam into the door with all your might. You hear a *CRACK* but you think that might have come from your shoulder! Maybe you should try again?")
}
otherwise {
if (GetBoolean(hut door, "bashed")) {
msg ("Why would you want to bash an already destroyed door. Just go in!")
}
else {
msg ("You throw your mighty belly against the door with all your might. *CRASH* The door is splintered into a gazillion pieces. Really... a gazillion.")
SetObjectFlagOn (, "")
}
}
</ram>
<alias>hut door</alias>
</object>
</object>
<verb>
<property>ram</property>
<pattern>ram; slam; kick; punch; push</pattern>
<defaultexpression>"You can't ram; slam; kick; punch; push " + object.article + "."</defaultexpression>
</verb>
OurJud wrote:• The shed location needs two descriptions - a 'first time' and 'otherwise'
• These descriptions need to recognise and output two factors:
1. Has the door already been smashed in?
2. Has the axe been taken?
firsttime {
msg ("There's a small shed here. The door is closed and locked with a padlock, but it all looks rather flimsy.<br/><br/>You can go south or in.")
}
otherwise {
if (not entrance_to_shed.locked) {
msg ("The small shed squats miserably in the long grass, it's door hanging from the hinges.<br/><br/>You can go south or in.")
}
else {
msg ("The small shed squats miserably in the long grass. The door is closed and locked with a padlock.<br/><br/>You can go south or in.")
}
}
if (not Axe.parent = this) {
msg ("The inside is thick with dust.")
}
else {
msg ("The inside is thick with dust. There's an axe lying in the corner.")
}
if (not Axe.scenery) {
msg ("The inside is thick with dust.")
}
else {
msg ("The inside is thick with dust. There's an axe lying in the corner.")
}