AddToInventory (Wheat Stem)
msg ("You decided to pick one of the wheat stems.")if (HasString(this, "eatmsg")) {
msg (this.eatmsg)
}
else {
msg (DynamicTemplate("Eaten", this))
}
if (HasInt(game.pov, "health")) {
game.pov.health = game.pov.health + this.eathealth
}
MoveObject (desert berry, desert shrub)
if (ListContains(ScopeVisible(), desert shrub)) {
msg ("<br/>You watch the purple gas swirl in the air, pause for a brief moment, and dive directly into the desert shrub. A flower blooms on the bush, and the flower morphs into a new berry right in front of your eyes!<br/>")
}
else if (not ListContains(ScopeVisible(), desert shrub)) {
msg ("<br/>The purple gas swirls in the air, pauses for a brief moment, and zooms off in the direction of the desert shrub from which it was plucked!<br/>")
}
<object name="edibles room">
<inherit name="editor_room" />
<description type="script">
</description>
<object name="Watermelon">
<inherit name="editor_object" />
<look>It's a big, green, seedless watermelon! Eat up!</look>
<take />
<takemsg>It's heavy, but you take it. Now eat it!</takemsg>
<eat type="script">
msg ("You annihilate that watermelon like Gallagher at a comedy show. Watermelon eaten!")
RemoveObject (Watermelon)
</eat>
</object>
<object name="Magoo">
<inherit name="editor_object" />
<inherit name="editor_player" />
<inherit name="namedmale" />
<attr name="pov_look">You're Magoo. A simple being trapped in a test game.</attr>
<look type="script">
if (game.pov = Xanadu) {
msg ("Holy moly! That looks exactly like you! To take control of Magoo, just type 'switch to Magoo'.")
}
else {
msg ("You are a simple being trapped in a test game.")
}
</look>
</object>
<object name="apple tree">
<inherit name="editor_object" />
<inherit name="surface" />
<takemsg>You can't take the entire tree!</takemsg>
<feature_container />
<hidechildren />
<listchildren />
<look type="script">
if (Contains (apple tree,apple1)) {
msg ("It's a very healthy looking apple tree, but oddly enough it only contains one apple! It is within reach so you could pick it if you wish.")
MakeObjectVisible (apple1)
}
else {
msg ("It's a very healthy looking apple tree, but oddly enough it does not contain any apples!")
}
</look>
<object name="apple1">
<inherit name="editor_object" />
<alias>apple</alias>
<visible type="boolean">false</visible>
<scenery type="boolean">false</scenery>
<look type="script">
if (GetBoolean(apple1, "picked")) {
msg ("It's a lovely looking apple. You should eat it!")
}
else {
msg ("It's a lovely looking apple. You should pick it from the tree if you want it!")
}
</look>
<pick type="script">
msg ("You stand on your tippy toes and snatch the apple from the tree.")
AddToInventory (apple1)
</pick>
<eat type="script"><![CDATA[
if (Got(apple1)) {
msg ("You scarf the apple down in one giant bite. Tasty!<br/><br/>You hear an odd sound like one you have never heard before - something on the apple tree catches your eye.")
MoveObject (apple1, apple tree)
MakeObjectInvisible (apple1)
}
]]></eat>
</object>
</object>
</object>
<verb>
<property>pick</property>
<pattern>pick</pattern>
<defaultexpression>"You can't pick " + object.article + "."</defaultexpression>
</verb>
<object name="flag setting unsetting room">
<inherit name="editor_room" />
<description><![CDATA[In this room, you will hopefully master flag setting and unsetting!<br/><br/>There are flags in the room. Look at them. To raise them, type "raise flag (of your choice)". To lower them, type "lower flag (of your choice)".<br/><br/>This room assumes you have knowledge of 'If'/'Then' statements. If you don't type "if then help".<br/><br/>Notice that when you raise a flag, I have set that particular flag on that flag object to 'raised'. If you look at the particular flag, I have used an 'If'/'Else' script to give a different viewpoint of the flag. The country's flag with a flag titled 'raised' will look as though it is standing erect. When you "lower" the flag, I unset that country's flag 'raised' so it appears in the look at description as on the ground.]]></description>
<alias>flag setting and unsetting room</alias>
<enter type="script">
</enter>
<object name="The Flag of England">
<inherit name="editor_object" />
<alt type="stringlist">
<value>english flag</value>
</alt>
<usedefaultprefix type="boolean">false</usedefaultprefix>
<look type="script">
if (GetBoolean(The Flag of England, "raised")) {
msg ("You behold the proud English flag rippling in the breeze. To lower the flag, simply type 'lower' flag.")
}
else {
msg ("The English Flag and its pole rest on the ground. To raise the flag, simply type 'raise' flag.")
}
</look>
<raise type="script"><![CDATA[
msg ("You lift the English Flag from the ground and nestle the pole it is tied to neatly into the ground. The English Flag is now raised!<br/><br/>In code, we have set flag 'object' 'The Flag of England' 'flag name' \"raised\"")
SetObjectFlagOn (The Flag of England, "raised")
]]></raise>
<lower type="script"><![CDATA[
msg ("You lift the English Flag from the earth and rest it gently on the ground.<br/><br/>In code, we have Unset flag 'object' 'The Flag of England' 'flag name' \"raised\".")
SetObjectFlagOff (The Flag of England, "raised")
]]></lower>
</object>
<object name="The Flag of the USA">
<inherit name="editor_object" />
<usedefaultprefix type="boolean">false</usedefaultprefix>
<raise type="script"><![CDATA[
msg ("You lift the American Flag from the ground and nestle the pole it is tied to neatly into the ground. The Stars and Stripes is now raised!<br/><br/>In code, we have set flag 'object' 'The Flag of the USA' 'flag name' \"raised\"")
SetObjectFlagOn (The Flag of the USA, "raised")
]]></raise>
<lower type="script"><![CDATA[
msg ("You lift the American Flag from the earth and rest it gently on the ground.<br/><br/>In code, we have Unset flag 'object' 'The Flag of the USA' 'flag name' \"raised\".")
SetObjectFlagOff (The Flag of the USA, "raised")
]]></lower>
<look type="script">
if (GetBoolean(The Flag of the USA, "raised")) {
msg ("You behold the proud American flag rippling in the breeze. To lower the flag, simply type 'lower' flag.")
}
else {
msg ("The American Flag and its pole rest on the ground. To raise the flag, simply type 'raise' flag.")
}
</look>
</object>
<object name="German Flag">
<inherit name="editor_object" />
<usedefaultprefix />
<look type="script">
if (GetBoolean(German Flag, "raised")) {
msg ("You behold the proud German flag rippling in the breeze. To lower the flag, simply type 'lower' flag.")
}
else {
msg ("The German Flag and its pole rest on the ground. To raise the flag simply type 'raise' flag.")
}
</look>
<raise type="script"><![CDATA[
msg ("You lift the German Flag from the ground and nestle the pole it is tied to neatly into the ground. The German Flag is now raised!<br/><br/>In code, we have set flag 'object' 'German Flag' 'flag name' \"raised\"")
SetObjectFlagOn (German Flag, "raised")
]]></raise>
<lower type="script"><![CDATA[
msg ("You lift the German Flag from the earth and rest it gently on the ground.<br/><br/>In code, we have Unset flag 'object' 'German Flag' 'flag name' \"raised\".")
SetObjectFlagOff (German Flag, "raised")
]]></lower>
</object>
<command name="I IE E help cmd">
<pattern>if then help</pattern>
<script><![CDATA[
msg ("An 'If' script is likely the most useful script in the game.<br/><br/>Simply put, you set a condition with the 'If' script. In the GUI change the 'expression' box to whatever condition you want to set. In this room, I have set an 'If' object has flag. Choose the object you want to conditionalize. I chose 'German Flag'. Then name the flag. In this room, I chose the flag name 'raised'.<br/><br/>Now, choose what happens next with the 'Then' script. Click 'add new script'. In this room, I set the description of the raised flag as a 'print a message' script. In this box I described the German Flag as if it had been raised.<br/><br/>In the 'Else' box, you choose what happens if the condition is NOT met. So, in this room, when the German Flag did NOT have the 'raised' flag name active, I described it as lying on the ground.<br/><br/>If you are interested in how to use the 'Else If' part of this script, visit the If Then room!")
]]></script>
</command>
<object name="Magoo">
<inherit name="editor_object" />
<inherit name="editor_player" />
<inherit name="namedmale" />
<attr name="pov_look">You're Magoo. A simple being trapped in a test game.</attr>
<look type="script">
if (game.pov = Xanadu) {
msg ("Holy moly! That looks exactly like you! To take control of Magoo, just type 'switch to Magoo'.")
}
else {
msg ("You are a simple being trapped in a test game.")
}
</look>
</object>
</object>
<verb>
<property>raise</property>
<pattern>raise</pattern>
<defaultexpression>"You can't raise " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>lower</property>
<pattern>lower</pattern>
<defaultexpression>"You can't lower " + object.article + "."</defaultexpression>
</verb>
Encrtia wrote:Oh right! Ok, will do. Wasn't aware it was complex haha, I hadn't touched attributes thinking this was going to be simple.
I'll go through the links provided, & see about understanding Attributes then.
if (Got(wheat1)) {
msg ("You can't.")
}
else if (not Got(wheat1)) {
msg ("You decided to pick one of the wheat stems.")
CloneObjectAndMove (Wheat Ste, player)
AddToInventory (wheat1)
MakeObjectInvisible (wheat1)
}if (GetBoolean(Wheat Ste, "taken")) {
msg ("You can't.")
}
else if (not GetBoolean(Wheat Ste, "taken")) {
msg ("You decided to pick one of the wheat stems.")
AddToInventory (Wheat Ste)
SetObjectFlagOn (Wheat Ste, "taken")
}msg ("You ate it...")
MoveObject (Wheat Ste, Room1)
SetObjectFlagOff (Wheat Ste, "taken")if (Got(wheat1)) {
msg ("You can't.")
}
else if (not Got(wheat1)) {
msg ("You decided to pick one of the wheat stems.")
CloneObjectAndMove (Wheat Ste, player)
AddToInventory (wheat1)
MakeObjectInvisible (wheat1)
}if (GetBoolean(Wheat Ste, "taken")) {
msg ("You can't.")
}
else if (not Got(wheat1)) {
msg ("You decided to pick one of the wheat stems.")
CloneObjectAndMove (Wheat Ste, player)
SetObjectFlagOn (Wheat Ste, "taken")
}msg ("You ate it...")
SetObjectFlagOff (Wheat Ste, "taken")