Help with using multiple objects to fix an item

Hi Could anyone help me? I am creating an extremely basic game as part of my school homework. The game is very simple, all you have to do is find missing parts of an item (items have 2 or 3 missing parts), and then once you have these missing parts you can go to the correct item to fix it, and then use it or watch it. The first one I am trying to do is a television where the player needs to find two things, a picture tube and a speaker system. Once they have these 2 things they should be able to go to the TV, fix it, switch it on and then watch it. So far I have given the TV the feature of being switchable and inputted the message "The TV does not work, it needs a picture tube and a speaker system." in the section "Leave blank to allow the object to be turned on; give a message if it cannot be turned on (eg requires power or repair):". I have created a new verb "fix" for the tv and run a script, which is where i must be going wrong. The script is "if player is carrying object, picture tube, " then print message "Great! You have inserted the picture tube into the television." I have done the same for if the player is carrying a speaker system as well. This is where I am getting stuck, I do not know how to get the program to recognise that it needs both items and once both have been used by using the fix verb, then the player is able to switch on the TV (or the TV gets switched on automatically after the 2 items have been founds which would also be fine) and then be able to watch the TV. I have created the watch verb and run the script "If object is switched on, TV, then pint message and also play a a you tube video, but this is not working i think because the TV is not being switched on with the fix script i have done. I really hope this makes sense, i couldn't sleep in this morning and have been up since 6am trying to figure out what to do. Thank you so much to anyone that can help!


(I'll explain in code view, because it's easier than looking up all the descriptions. Also assuming your object names are picture tube, speaker, and television)

I think you probably want your 'fix' verb script to be something like this:

if (Got (picture tube)) {
  MoveObject (picture tube, television)
  msg ("Great! You have inserted the picture tube into the television.")
}

if (Got (speaker)) {
  MoveObject (speaker, television)
  msg ("Great! You have inserted the speaker into the television.")
}

if (Contains (television, picture tube) and Contains (television, speaker)) {
  msg ("You have fixed the television and you can turn it on now.")
  television.cannotswitchon = ""
}
else if (Contains (television, picture tube)) {
  msg ("You still need to find the speaker.")
}
else if (Contains (television, speaker)) {
  msg ("You still need to find the picture tube.")
}
else {
  msg ("You need to find a picture tube and a speaker to fix this television.")
}

The first part, I assume you already have. I put the parts you've used inside the television, so it's easy to check if they are installed.

The second part checks which parts are in there. If they're both there, we set the attribute television.cannotswitchon (labelled "Leave blank to allow the object to be turned on; give a message if it cannot be turned on (eg requires power or repair):" in the editor) to a blank string, so the TV can now be switched on. If they have only one part installer, it tells them they need the other. And if they haven't installed either, it tells them they need both.


Thank you so, so much, you are amazing...that code was perfect for what i wanted! I had to download the windows version and use the code view, but that helped an awful lot in understanding how the programme works. I was able to sort out all the rooms and I am so happy, so thank you again! I still need to input some more descriptive text but I am nearly there! I have tried to find out how I can make the game end though. I would like it so that when all the objects have been fixed with their relevant items then the game ends with a congratulation message. If you could once again point me in the right direction I would be most grateful....this is my code for the game so far (I know it is very simple, this is my 1st attempt at this plus the game has been designed for Ada Lovelace from the 1800's so the simpler the better I am thinking!)


Sorry it did not show my code....so I imagine my question is far too broad for an answer, but thank you again, I hope that in time I will be able to help someone in the same way you have helped me! :)


If you want to paste code in the forums, you need to put a line of 3 backticks above and below it.
So if you type:

```
code goes here
```

it will appear as

code goes here

That prevents it getting confused on bits of code that look like HTML, or like the forum's formatting codes.


Oh thank you so much, I would love to know how you learnt this...I am in year 7 at school (I am 11) and I love the way that at the minute to me computer programming seems to combine my two favourite lessons, maths and english along with my other passion for logic puzzles....and gaming of course! I will try and put the code on now. I did try and set my own using similar code that you showed me before in that if all the objects contained their items then the game would finish but sadly i failed!


<asl version="580">
  <include ref="English.aslx" />
  <include ref="Core.aslx" />
  <game name="Welcome to 21st Century Technology">
    <gameid>1a30bed1-0eb9-49cb-b291-d8d37916214b</gameid>
    <version>1.0</version>
    <firstpublished>2018</firstpublished>
    <menufont>Georgia, serif</menufont>
    <description><![CDATA[You are Ada Lovlace* and you are being introduced 21st  century technology.<br/><br/><br/><br/>*Ada Lovelace ]]></description>
  </game>
  <object name="Lobby">
    <inherit name="editor_room" />
    <isroom />
    <description type="string"></description>
    <usedefaultprefix type="boolean">false</usedefaultprefix>
    <prefix>the</prefix>
    <firstenter type="script"><![CDATA[
      msg ("Welcome to the lobby Ada, the names of these rooms might seem a bit daunting right now, but don't worry, with your logical skills you will pick it up quickly! <br/>It's been 175 years since your epic notes on Charles Babbage's Analytical Engine and here you can find out how far technology has come since then!<br/><br/>There are 8 rooms you can enter from here (either by selecting the blue links above or by using the compass you will see to the right of the screen) and each one contains a peice of 2018 technology, sadly though they are all missing crucial parts that they need in order to work.<br/>Take a look in this room for example, there is a picture tube typed in blue, that means you can select it, go ahead select it now and take a look.<br/>You can also take this item, take it now, you might need it later (see how your inventory fills up in the top right corner of the screen, and be aware that not all objects in blue can be taken but they can always be selected and interacted with in some way)<br/><br/>You will always need to come back to the lobby to enter another room as you discover the technology of the 21st Century.<br/>Good luck Ada, I cannot imagine what you will think of the tecnology of 2018!")
    ]]></firstenter>
    <onexit type="script">
    </onexit>
    <beforeenter type="script">
    </beforeenter>
    <enter type="script">
    </enter>
    <object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
    </object>
    <exit name="PC Room" alias="The PC Room" to="PC room">
      <inherit name="northdirection" />
      <runscript type="boolean">false</runscript>
      <prefix>to</prefix>
    </exit>
    <exit alias="The Smart Phone Room" to="Smart phone room">
      <inherit name="northwestdirection" />
    </exit>
    <exit alias="The 3D Printer Room" to="the 3d printer room">
      <inherit name="westdirection" />
    </exit>
    <exit alias="The Games Console Room" to="Games Consoles Room">
      <inherit name="southwestdirection" />
    </exit>
    <exit alias="The Tablet Room" to="Tablet Room">
      <inherit name="southdirection" />
    </exit>
    <exit alias="The Television Room" to="Television Room">
      <inherit name="southeastdirection" />
    </exit>
    <exit alias="The Internet Room" to="Internet">
      <inherit name="eastdirection" />
    </exit>
    <exit alias="The Smart Watch Room" to="Smart watch">
      <inherit name="northeastdirection" />
    </exit>
    <object name="Picture Tube">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <look type="script">
        picture ("")
      </look>
    </object>
  </object>
  <object name="PC room">
    <inherit name="editor_room" />
    <description type="string"></description>
    <firstenter type="script">
    </firstenter>
    <enter type="script">
      msg ("The Mother board and CPU are important parts of a PC")
    </enter>
    <beforefirstenter type="script">
      msg ("You are enerting the PC  room, unfortanately it will not work as it is missing it's parts")
    </beforefirstenter>
    <exit alias="back to the Lobby" to="Lobby">
      <inherit name="southdirection" />
    </exit>
    <object name="Sim card">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <look type="script">
        msg ("Every mobiole phone has a sim card and they carry an identification number unique to the owner, storing personal data, and preventing operation of the phone if removed.")
        picture ("sim card.png")
      </look>
    </object>
    <object name="Glass touch screen">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <look type="script">
        msg ("The glass touch screen covers the front of an ipad allowing it to used by touch alone rather than a controller that needs to be connected.")
        picture ("scn-it-flt15.0-001-003_12_19.jpg")
      </look>
    </object>
    <object name="PC personal computer">
      <inherit name="editor_object" />
      <inherit name="switchable" />
      <take type="boolean">false</take>
      <feature_usegive />
      <feature_switchable />
      <switchonmsg>Congratulations you have discovered the personal computer or PC for short!</switchonmsg>
      <cannotswitchon>It cannot be switched on you need a mother board and CPU to get it working.</cannotswitchon>
      <switchoffmsg>The fans whirring inside go quiet and the screen goes black</switchoffmsg>
      <fix type="script">
        if (Got(Mother board)) {
          MoveObject (Mother board, PC personal computer)
          msg ("You have connected up the mother board to the computer")
        }
        if (Got(CPU)) {
          MoveObject (CPU, PC personal computer)
          msg ("You have inserted thr CPU into the PC")
        }
        if (Contains (PC personal computer,Mother board) and Contains (PC personal computer, CPU)) {
          msg ("Great you have fixed the PC personal computer and it now can be switched on")
          PC personal computer.cannotswitchon = ""
        }
        else if (Contains (PC personal computer,Mother board)) {
          msg ("You still need to find the CPU")
        }
        else if (Contains (PC personal computer,CPU)) {
          msg ("You still need to find the Mother board")
        }
        else {
          msg ("You need to find a Mother board and the CPU to fix this computer")
        }
      </fix>
      <onswitchon type="script">
        msg ("A computer is a type of machine that can follow stored instructions and do many different things.")
        ShowYouTube ("lJnvq0A_7WQ")
      </onswitchon>
      <onswitchoff type="script">
        HidePreviousTurnOutput
      </onswitchoff>
      <look type="script">
        picture ("pc.png")
      </look>
    </object>
  </object>
  <object name="Smart phone room">
    <inherit name="editor_room" />
    <description type="string"></description>
    <usedefaultprefix type="boolean">false</usedefaultprefix>
    <prefix>the</prefix>
    <beforefirstenter type="script">
      msg ("You are enerting the Smart Phone room, unfortanately it will not work as it is missing it's parts")
    </beforefirstenter>
    <enter type="script">
      msg ("The Sim Card and Display are important parts of the Smart phone")
    </enter>
    <exit alias="back to the Lobby" to="Lobby">
      <inherit name="southeastdirection" />
    </exit>
    <object name="Cooling fan">
      <inherit name="editor_object" />
      <feature_usegive />
      <take />
      <look type="script">
        msg ("The cooling fan in a 3d printer direct a stream of air across the object whilst printing, to cool the object and speed up solidification.")
        picture ("cooling-fan-gdstime-1-piece-40-3d-printer.jpg")
      </look>
    </object>
    <object name="Router">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <takemsg>This allows our computers to communicate with the internet</takemsg>
      <look type="script">
        msg ("A router is a networking device that sends dta between networking device.")
        picture ("Seven-ways-to-speed-up-your-router.jpg")
      </look>
    </object>
    <object name="Smart phone">
      <inherit name="editor_object" />
      <inherit name="switchable" />
      <attr name="not_all" type="boolean">false</attr>
      <feature_usegive />
      <feature_switchable />
      <switchonmsg>Congratulatios you have discovered the smartphone!</switchonmsg>
      <cannotswitchon>You cannot use this phone as it is missing it's sim card and display</cannotswitchon>
      <switchoffmsg>It's good to keep your phone off at times.</switchoffmsg>
      <fix type="script">
        if (Got(Sim card)) {
          MoveObject (Sim card, Smart phone)
          msg ("Well done! you have inserted the sim card into the smartphone! ")
        }
        if (Got(Display)) {
          MoveObject (Display, Smart phone)
          msg ("Well done you have secured the display to the smart phone")
        }
        if (Contains (Smart phone,Sim card) and Contains (Smart phone, Display)) {
          msg ("Great you have fixed the Smart phone and it now can be switched on")
          Smart phone.cannotswitchon = ""
        }
        else if (Contains (Smart phone,Sim card)) {
          msg ("You still need to find the Display")
        }
        else if (Contains (Smart phone,Display)) {
          msg ("You still need to find the Sim card")
        }
        else {
          msg ("You need to find a Sim card and a Display to fix this Smart phone")
        }
      </fix>
      <onswitchon type="script">
        msg ("The main function of a phone is to allow you to speak to anybody at any time by dialling their number.")
        ShowYouTube ("pkNUdLxhKcE")
      </onswitchon>
      <onswitchoff type="script">
        HidePreviousTurnOutput
      </onswitchoff>
      <look type="script">
        picture ("smartphone 2.jpg")
      </look>
    </object>
  </object>
  <object name="the 3d printer room">
    <inherit name="editor_room" />
    <description type="string"></description>
    <usedefaultprefix type="boolean">false</usedefaultprefix>
    <prefix type="string"></prefix>
    <isroom />
    <beforefirstenter type="script">
      msg ("You are enerting the 3D Printer room, unfortanately it will not work as it is missing it's parts")
    </beforefirstenter>
    <enter type="script">
      msg ("The Cooling Fan and Heating Bed are important parts of a 3D printer")
    </enter>
    <exit alias="back to the Lobby" to="Lobby">
      <inherit name="eastdirection" />
    </exit>
    <object name="Controller">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <look type="script">
        msg ("A controller describes itself in in it's name It allows you to accsess your Xbox and control the characters in the games that you play.")
        picture ("6199582_R_Z001A.jpg")
      </look>
    </object>
    <object name="Wireless access point">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <look type="script">
        msg ("A wireless acsess point allows devices that can connect wirelessly to the internet to connect to the world wide web.")
        picture ("NW40040.jpg")
      </look>
    </object>
    <object name="the 3d printer">
      <inherit name="editor_object" />
      <inherit name="switchable" />
      <feature_usegive />
      <feature_switchable />
      <switchonmsg>Great! You have discovered the 3d printer!</switchonmsg>
      <cannotswitchon>Unfortunately the 3d printer cannot be turned on as you still need the cooling fan!</cannotswitchon>
      <usedefaultprefix type="boolean">false</usedefaultprefix>
      <scenery type="boolean">false</scenery>
      <displayverbs type="stringlist">
        <value>Look at</value>
        <value>Take</value>
        <value>Switch on</value>
        <value>Switch off</value>
        <value>Fix</value>
      </displayverbs>
      <switchoffmsg>The printer grinds to a halt.</switchoffmsg>
      <fix type="script">
        if (Got(Cooling fan)) {
          MoveObject (Cooling fan, the 3d printer)
          msg ("Excellent! You have inserted the coolng fan into the 3d printer!")
        }
        if (Got(Heating bed)) {
          MoveObject (Heating bed, the 3d printer)
          msg ("Brilliant! You have just added the heating bed to the 3d printer!")
        }
        if (Contains (the 3d printer,Cooling fan) and Contains (the 3d printer, Heating bed)) {
          msg ("Great you have fixed the 3d printer and it now can be switched on")
          the 3d printer.cannotswitchon = ""
        }
        else if (Contains (the 3d printer,Cooling fan)) {
          msg ("You still need to find the Heating bed")
        }
        else if (Contains (the 3d printer,Heating bed)) {
          msg ("You still need to find the Cooling fan")
        }
        else {
          msg ("You need to find a Cooling fan and a Heating bed to fix this 3d printer")
        }
      </fix>
      <onswitchon type="script">
        msg ("A 3D printer is a machine that alllows you to create physical objects from a 3 dimensional object on your computer that you create.")
        ShowYouTube ("q2rFmL2rwMo")
      </onswitchon>
      <onswitchoff type="script">
        HidePreviousTurnOutput
      </onswitchoff>
      <look type="script">
        picture ("3d printer.png")
      </look>
    </object>
  </object>
  <object name="Games Consoles Room">
    <inherit name="editor_room" />
    <description type="string"></description>
    <usedefaultprefix type="boolean">false</usedefaultprefix>
    <prefix>the</prefix>
    <beforefirstenter type="script">
      msg ("You are enerting theGames Console room, unfortanately it will not work as it is missing it's parts")
    </beforefirstenter>
    <enter type="script">
      msg ("The Controller and Flash Memory are important parts of a Games Console")
    </enter>
    <exit alias="back to the Lobby" to="Lobby">
      <inherit name="northeastdirection" />
    </exit>
    <object name="PCB Board">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <look type="script">
        msg ("PCB stands for printed circuit board and is the main conponent of a smart watch.")
        picture ("OEM-Android-Smart-Watch-PCB-PCBA-Digital.jpg_350x350.jpg")
      </look>
    </object>
    <object name="Xbox">
      <inherit name="editor_object" />
      <inherit name="switchable" />
      <alias>Xbox</alias>
      <feature_usegive />
      <feature_switchable />
      <switchonmsg>Well done, you have discovered the wonderful world of gaming!</switchonmsg>
      <cannotswitchon>The Games Console will not work, it needs its controller and its flash memory.</cannotswitchon>
      <usedefaultprefix type="boolean">false</usedefaultprefix>
      <prefix>an</prefix>
      <switchoffmsg>When you're 11 years old in 2018 you do this when you're told to by your parents!</switchoffmsg>
      <onswitchon type="script">
        ShowYouTube ("yQQkiT-Rjo8")
        msg ("An Xbox is a gaming console created by Microsoft mainly to play games on")
      </onswitchon>
      <fix type="script">
        if (Got(Controller)) {
          MoveObject (Controller, Xbox)
          msg ("Exellent! You have pluged in the controller to the Xbox! ")
        }
        if (Got(Flash memory)) {
          MoveObject (Flash memory, Xbox)
          msg ("Well done! You have inserted the flash memory into the Xbox! ")
        }
        if (Contains (Xbox,Controller) and Contains (Xbox, Flash memory)) {
          msg ("Great you have fixed the Xbox and it now can be switched on")
          Xbox.cannotswitchon = ""
        }
        else if (Contains (Xbox,Controller)) {
          msg ("You still need to find the Flash memory")
        }
        else if (Contains (Xbox,Flash memory)) {
          msg ("You still need to find the Controller")
        }
        else {
          msg ("You need to find a Controller and a Flash memory to fix this Xbox")
        }
      </fix>
      <onswitchoff type="script">
        HidePreviousTurnOutput
      </onswitchoff>
      <look type="script">
        picture ("Xbox_One_X_Screenshot_05.0.jpg")
      </look>
    </object>
    <object name="Display">
      <inherit name="editor_object" />
      <feature_usegive />
      <take />
      <look type="script">
        msg ("The display of a phone allows you to interact with the devices features.")
        picture ("phone_breakdown2.jpg")
      </look>
    </object>
  </object>
  <object name="Tablet Room">
    <inherit name="editor_room" />
    <description type="string"></description>
    <usedefaultprefix type="boolean">false</usedefaultprefix>
    <prefix>the</prefix>
    <beforefirstenter type="script">
      msg ("You are enerting the Tablet room, unfortanately it will not work as it is missing it's parts")
    </beforefirstenter>
    <enter type="script">
      msg ("The silicon chips and glass touch screen are important parts of a tablet")
    </enter>
    <exit alias="back to the Lobby" to="Lobby">
      <inherit name="northdirection" />
    </exit>
    <object name="Speaker system">
      <inherit name="editor_object" />
      <alias>Speaker system</alias>
      <take />
      <feature_usegive />
      <look type="script">
        picture ("surround_sound_system-136428985821902601.jpg")
        msg ("A sound system projects sound into the surrounding area. (A TV would be fairly boring without sound)")
      </look>
    </object>
    <object name="An Ipad">
      <inherit name="editor_object" />
      <inherit name="switchable" />
      <alias>Ipad</alias>
      <usedefaultprefix type="boolean">false</usedefaultprefix>
      <scenery type="boolean">false</scenery>
      <feature_usegive />
      <feature_switchable />
      <switchonmsg>Congratulations! You have discovered the Ipad!</switchonmsg>
      <cannotswitchon>The Ipad dosen't work, you need it's 3 silicon chips and it's glass touch screen.</cannotswitchon>
      <switchoffmsg>You hold down the off button and the screen goes black.</switchoffmsg>
      <onswitchon type="script">
        msg ("You can think of an Ipad as a mini computer that can be held in your hands and used by touch screen.")
        ShowYouTube ("OQdC_hHlS7k")
      </onswitchon>
      <fix type="script">
        if (Got(Glass touch screen)) {
          MoveObject (Glass touch screen, An Ipad)
          msg ("Well done! you have placed the Ipads glass touchscreen.")
        }
        if (Got(The 3 silicon chips)) {
          MoveObject (The 3 silicon chips, An Ipad)
          msg ("Brilliant! you have inserted the 3 silicon chips into the Ipad")
        }
        if (Contains (An Ipad,Glass touch screen) and Contains (An Ipad, The 3 silicon chips)) {
          msg ("Great you have fixed the Ipad and it now can be switched on")
          An Ipad.cannotswitchon = ""
        }
        else if (Contains (An Ipad,Glass touch screen)) {
          msg ("You still need to find the the 3 silicon chips")
        }
        else if (Contains (An Ipad,The 3 silicon chips)) {
          msg ("You still need to find the Glass touch screen")
        }
        else {
          msg ("You need to find a Glass touch screen and the 3 silicon chips to fix this Ipad")
        }
      </fix>
      <onswitchoff type="script">
        HidePreviousTurnOutput
      </onswitchoff>
      <look type="script">
        picture ("417h-w9jbhL.jpg")
      </look>
    </object>
  </object>
  <object name="Television Room">
    <inherit name="editor_room" />
    <description>Welcome to the television room to unlock the TV you must find: its speaker system and picture tube.</description>
    <beforefirstenter type="script">
      msg ("You are enerting the TV  room, unfortanately it will not work as it is missing it's parts")
    </beforefirstenter>
    <enter type="script">
      msg ("The picture tube and speaker system are important parts of a TV")
    </enter>
    <exit alias="back to the Lobby" to="Lobby">
      <inherit name="northwestdirection" />
    </exit>
    <object name="The 3 silicon chips">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <look type="script">
        msg ("A silicon chip is a tiny wafer of silicon used to make an intergrated curcuit.")
        picture ("image.jpg")
      </look>
    </object>
    <object name="TV">
      <inherit name="editor_object" />
      <inherit name="switchable" />
      <feature_switchable />
      <feature_usegive />
      <cannotswitchon>The television cannot be turned on, you need to fix it with the Picture Tube and the Speaker System</cannotswitchon>
      <switchonmsg>Congratulations you have discovered TV INFO ON TV</switchonmsg>
      <displayverbs type="stringlist">
        <value>Look at</value>
        <value>Take</value>
        <value>Fix</value>
        <value>Switch On</value>
        <value>Switch Off</value>
      </displayverbs>
      <use type="boolean">false</use>
      <drop type="boolean">false</drop>
      <switchoffmsg>Sadly we can't spend all our time watching the TV.</switchoffmsg>
      <fix type="script">
        if (Got(Speaker system)) {
          MoveObject (Speaker system, TV)
          msg ("Great you have connected the speaker system")
        }
        if (Got(Picture Tube)) {
          MoveObject (Picture Tube, TV)
          msg ("Great! You have inserted the picture tube.")
        }
        if (Contains (TV,Picture Tube) and Contains (TV, Speaker system)) {
          msg ("Great you have fixed the TV and it now can be switched on")
          TV.cannotswitchon = ""
        }
        else if (Contains (TV,Picture Tube)) {
          msg ("You still need to find the speaker system")
        }
        else if (Contains (TV,Speaker system)) {
          msg ("You still need to find the picture tube")
        }
        else {
          msg ("You need to find a picture tube and a speaker to fix this television")
        }
      </fix>
      <onswitchon type="script">
        msg ("A TV is a screen that shows an animated image and projects sound. Basically like going to the theater but in your own home but not as big!")
        ShowYouTube ("1aIc7dOSUQA")
      </onswitchon>
      <useanything type="script">
      </useanything>
      <onswitchoff type="script">
        HidePreviousTurnOutput
      </onswitchoff>
      <useon type="scriptdictionary" />
      <give type="scriptdictionary" />
      <look type="script">
        picture ("l_10158805_001.jpg")
      </look>
    </object>
    <object name="Capacitive touch panel">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <look type="script">
        msg ("A capacitive touch screen is a display that reacts to touch of a finger.")
        picture ("single_touch_1_44_inch_projected_capacitive_touch_screen_panel_for_smart_watch.jpg")
      </look>
    </object>
  </object>
  <object name="Internet">
    <inherit name="editor_room" />
    <description>To unlock the internet you must findthe wireless access point and its ICS</description>
    <beforefirstenter type="script">
      msg ("You are enerting the Internet room, unfortanately it will not work as it is missing it's parts")
    </beforefirstenter>
    <enter type="script">
      msg ("The Router and WIreless Acces Point are needed to access the internet")
    </enter>
    <exit alias="back to the Lobby" to="Lobby">
      <inherit name="westdirection" />
    </exit>
    <object name="Flash memory">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <look type="script">
        msg ("A kind of memory that retains data whithout the help of a powerr supply.")
        picture ("SanDisk-Xbox-360-8GB-USB-Flash-Drive.jpg")
      </look>
    </object>
    <object name="CPU">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <usedefaultprefix type="boolean">false</usedefaultprefix>
      <look type="script">
        msg ("A CPU carries out the instructions of a computer program.")
        picture ("cpu.jpg")
      </look>
    </object>
    <object name="computer to access the internet">
      <inherit name="editor_object" />
      <inherit name="switchable" />
      <feature_usegive />
      <feature_switchable />
      <switchonmsg>AMazing, you have discovered the Internet.</switchonmsg>
      <cannotswitchon>You can connect to the internet, you need the Router and a wireless access point</cannotswitchon>
      <switchoffmsg>The internet has gone down, you can no longer access it.</switchoffmsg>
      <onswitchon type="script">
        ShowYouTube ("7_LPdttKXPc")
        msg ("The internet is a network of computers that allows the sharing of information. It is like a big libary that you can never physically enter.")
      </onswitchon>
      <fix type="script">
        if (Got(Wireless access point)) {
          MoveObject (Wireless access point, computer to access the internet)
          msg ("Well done! You have connected the wirless accsess point to the computer!")
        }
        if (Got(Router)) {
          MoveObject (Router, computer to access the internet)
          msg ("Brilliant! your router is now connected!")
        }
        if (Contains (computer to access the internet,Wireless access point) and Contains (computer to access the internet, Router)) {
          msg ("Great you have fixed the internet and it now can be switched on")
          computer to access the internet.cannotswitchon = ""
        }
        else if (Contains (computer to access the internet,Wireless access point)) {
          msg ("You still need to find the Router")
        }
        else if (Contains (computer to access the internet,Router)) {
          msg ("You still need to find the Wireless access point")
        }
        else {
          msg ("You need to find the Wireless access point and a Router to fix the internet")
        }
      </fix>
      <onswitchoff type="script">
        HidePreviousTurnOutput
      </onswitchoff>
      <look type="script">
        picture ("MzA1NDA1OQ.jpeg")
      </look>
    </object>
  </object>
  <object name="Smart watch">
    <inherit name="editor_room" />
    <description>Welcome to the smart watch room you must find its PCB board.</description>
    <beforefirstenter type="script">
      msg ("You are enerting the Smart Watch room, unfortanately it will not work as it is missing it's parts")
    </beforefirstenter>
    <enter type="script">
      msg ("The Capacitive touch panel and the PCB Board are important parts of a Smart Watch")
    </enter>
    <exit alias="back to the Lobby" to="Lobby">
      <inherit name="southwestdirection" />
    </exit>
    <object name="Mother board">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <look type="script">
        msg ("A mother board controls all the information within a computer.")
        picture ("51XqY3bfccL.jpg")
      </look>
    </object>
    <object name="Smartwatch">
      <inherit name="editor_object" />
      <inherit name="switchable" />
      <feature_usegive />
      <feature_switchable />
      <switchonmsg>Great, you have discovered the Smart Watch</switchonmsg>
      <cannotswitchon>The smart phone won't come on, it needs it's PCB Board and the Capacitive touch panel</cannotswitchon>
      <switchoffmsg>You don't want your smartwatch to track you today, it is now switched off.</switchoffmsg>
      <onswitchon type="script">
        msg ("A smart watch is something that you wear on your wrist that can connect to your smart phone.")
        ShowYouTube ("Rwf13CBCFic")
      </onswitchon>
      <fix type="script">
        if (Got(Capacitive touch panel)) {
          MoveObject (Capacitive touch panel, Smartwatch)
          msg ("Great, you have fixed the panel to the watch")
        }
        if (Got(PCB Board)) {
          MoveObject (PCB Board, Smartwatch)
          msg ("Excellent, you have fitted the samrt watch with it's PCB board")
        }
        if (Contains (Smartwatch,Capacitive touch panel) and Contains (Smartwatch, PCB Board)) {
          msg ("Great you have fixed the Smartwatch and it now can be switched on")
          Smartwatch.cannotswitchon = ""
        }
        else if (Contains (Smartwatch,Capacitive touch panel)) {
          msg ("You still need to find the PCB Board")
        }
        else if (Contains (Smartwatch,PCB Board)) {
          msg ("You still need to find the Capacitive touch panel")
        }
        else {
          msg ("You need to find the Capacitive touch panel and a PCB Board to fix this Smartwatch")
        }
      </fix>
      <onswitchoff type="script">
        HidePreviousTurnOutput
      </onswitchoff>
      <look type="script">
        picture ("item_XL_11898051_17614082.jpg")
      </look>
    </object>
    <object name="Heating bed">
      <inherit name="editor_object" />
      <feature_usegive />
      <take />
      <look type="script">
        msg ("A heating bed is an additional module for a 3D printer that makes the cooling process of a 3D printed materials more controlled.")
        picture ("57_49a65ead-a636-44c9-a0db-dd31f8d31419_1400x.jpg")
      </look>
    </object>
  </object>
  <verb>
    <property>fix</property>
    <pattern>fix</pattern>
    <defaultexpression>"You can't fix " + object.article + "."</defaultexpression>
  </verb>
  <verb>
    <property>insert</property>
    <pattern>insert</pattern>
    <defaultexpression>"You can't insert " + object.article + "."</defaultexpression>
  </verb>
  <verb>
    <property>watch</property>
    <pattern>watch</pattern>
    <defaultexpression>"You can't watch " + object.article + "."</defaultexpression>
  </verb>
</asl>

at the end/desired result of mrangel's code, to end the game:

http://docs.textadventures.co.uk/quest/scripts/wait.html
http://docs.textadventures.co.uk/quest/functions/corelibrary/clearscreen.html
http://docs.textadventures.co.uk/quest/scripts/finish.html

if (Got (picture tube)) {
  MoveObject (picture tube, television)
  msg ("Great! You have inserted the picture tube into the television.")
}

if (Got (speaker)) {
  MoveObject (speaker, television)
  msg ("Great! You have inserted the speaker into the television.")
}

if (Contains (television, picture tube) and Contains (television, speaker)) {
  msg ("You have fixed the television and you can turn it on now.")
  television.cannotswitchon = ""
  wait {
    ClearScreen
    msg ("Congratulations, you've won the game!")
    finish
  }
}
else if (Contains (television, picture tube)) {
  msg ("You still need to find the speaker.")
}
else if (Contains (television, speaker)) {
  msg ("You still need to find the picture tube.")
}
else {
  msg ("You need to find a picture tube and a speaker to fix this television.")
}

Cool I have finally found a use for the button next to the number 1.....first time I have pressed it...ever :)


learning to code/script:

https://www.codecademy.com (free but have to register)

(tons of sites/youtube-videos/etc that help with learning to program)

(Quest Text Adventure: I actually knew nothing about programing, but through quest and all the helpful members here and no longer here, I learned to program, and am now taking programming classes, "computer science", in college now for my major)

(here's a link to more links/guides to help with learning the basics of using quest, quest's code structure, and coding with quest: http://textadventures.co.uk/forum/general/topic/ljjm32av4e2t9ot49k478g/help#710be61e-eae1-4af1-8363-520cc718ba1c )


web/scripting languages (HTML, CSS, JS: JavaScript, XML, etc):

https://www.w3schools.com


the 3 full-bore main (high level) programming languages:

  1. C++: http://www.cplusplus.com

  2. Java: https://www.tutorialspoint.com/java/index.htm and official java site's doc page: https://docs.oracle.com/en/java/javase/11/

  3. Python: https://www.python.org

Assembly (low level) Programming Language (WARNING: this is advanced programming messing with the computer's memory: you can potentially destroy your computer, so don't mess with this stuff until you know what you're doing):

http://www.plantation-productions.com/Webster/www.artofasm.com/DOS/pdf/0_AoAPDF.html


also, highly recommend you download and install this really advanced and free text editor software:

https://notepad-plus-plus.org

once you got it opened up, at the menu bar at the top, under 'languages', select 'xml', as it matches quest's custom 'aslx' programming language, for doing the color coding, it also has a lot of editing controls/features (that I need to learn, lol) as well.


Thank you hegemonkhan....I am hoping that this is the 1st and last time I say this but I am a total noob! But i think i am getting it, kind of! If i input the section u have included in the code would that finish the game when the TV was complete? I have to show Ada Lovelace around 21st century tech (please don't mention the fact that TV's no longer use tubes....my mum told me that and i have gone too far now to change it i think!) and i have eight rooms apart from the lobby, each of which shows Ada a different piece of tech, I would like it so that once she has assembled all 8 pieces of tech that the game ends....if that makes sense?


yes, just put this in at the "end" of your code/scripting of where you want the game to end:

(you can adjust it as you want, of course)

wait {
  ClearScreen
  msg ("Congratulations, you've won the game!")
  finish
}

That is what I would like to do hegemonkhan, i will try code academy....my parents will like the free bit :) (obviously as well as continuing with Quest, I want to make some games for my friends) It is amazing what you can do with a little bit of code, I am beginning to look at Fortnite in a whole different way!


learn the java full-bore programming language, as it allows you to do graphics/windows/frames/buttons/etc... so you can make real games with it, with windows/graphics and buttons and etc...

this is the java program (IDE/SDK: SE: standard edition: for individual users) you want/need to download, if you're interested in learning and using java:

https://www.oracle.com/technetwork/java/javase/downloads/index.html

https://docs.oracle.com/en/java/javase/11/install/overview-jdk-installation.html#GUID-8677A77F-231A-40F7-98B9-1FD0B48C346A (installing instructions)

ask me for help with how to use it, though I'm a bit rusty... sighs


I'd suggest though to stick with learning quest, as it'll help you learn to program, you'll be able to learn more programming easier, after learning to code with quest, as well as learning to make a game with quest (game design, game mechanics, combat, magic, etc etc etc)

you can do codecademy too, as its got a lot of fun lessons, and teaches you various scripting/coding/syntax on top of quest doing the same, as well.

the 3 full-bore programming languages... you need to hold off on them, until you get the basics of coding/scripting from quest and codecademy

and assembly language is the last thing you get into learning, after you learned one of the full-bore programming languages


That is weird....my mum said that she used for a telemarketing company selling oracle about 20 years ago....she didn't have a clue what it was, and still doesn't apparently, she can't have got very far! I am definitely going to try this and blow her mind :) I am so grateful for the help you guys have given me....now to go an try and make this ending work and get my homework handed in :)


again, learning the full-bore programming languages is not easy, there's a reason they're the 'full-bore' programming languages, there's a lot of coding concepts and etc stuff you got to learn with the full-bore programming languages

stick with quest and codecademy for now

you can study/read-up on the full-bore programming languages, trying to understand some of its stuff, but you're probably not remotely ready to actually try using it yet... its a HUGE step up, compared to just doing scripting/coding, which is just what you're doing with quest...

(quest is well made, it's very non-coder friendly)

(the full-bore programming languages are NOT non-coder friendly, lol)

the underlying code and creation of quest, uses programming shared by the full-bore programming languages (classes, constructors, etc etc etc) ... so, the full-bore programming languages are a huge jump from using quest... its learning/using real programming...


As far as checking for all of the objects being fixed, you would probably want to check this whenever an object is fixed. This means the code would be repeated in several places.

To make this simpler, it would probably be a good idea to create a function to check if the player has won the game. I'd suggest making a function called CheckVictory, and using a set of flags (attributes whose value is true or false) to check whether each item is fixed.

So either when the player fixes the television (after the television.cannotswitchon = "" line) or after the line that plays the youtube video, you would add 2 lines:

  television.fixed = true
  CheckVictory()

and similar for the other fixable objects.

Then you would create a CheckVictory function, whose script looks something like:

fixed_items = FilterByAttribute (AllObjects(), "fixed", true)
if (ListCount (fixed_objects) = 8) {
  msg ("Congratulations! You have fixed everything!")
  finish()
}

This uses three of the core functions that you might not have come across yet:

  • AllObjects gets a list of all the objects in the game
  • FilterByAttribute filters a list, to find the ones that meet some criteria. In this case, it finds all the objects whose "fixed" attribute has been set to true
  • ListCount gives you the number of objects in a list. In this case, it counts the fixed objects, and if there are 8 displays a congratulations message.

(I think there were 8 objects that needed fixing)

I hope I can manage to explain this in a way you understand (and hope I'm not being too condescending; it's hard to judge online how much you actually understand). A good deal of programming is breaking a problem down into these simple steps. If you can describe what you want to do in enough detail, you're probably there already.


Thank you so much, you have been awesome!....i fear though it may have to exist without an actual end, i have tried but it seems i have failed and it needs to be handed in tomorrow! I inputted the 1st part after each section TV.cannotswitchon = "" (and then the same for the other 7 objects and then the check victory function at the end but the error i get says:
Error running script: Error compiling expression 'true)': SyntaxError: Unexpected token ")"; expected one of

<asl version="580">
  <include ref="English.aslx" />
  <include ref="Core.aslx" />
  <game name="Welcome to 21st Century Technology">
    <gameid>1a30bed1-0eb9-49cb-b291-d8d37916214b</gameid>
    <version>1.0</version>
    <firstpublished>2018</firstpublished>
    <menufont>Georgia, serif</menufont>
    <description><![CDATA[You are Ada Lovlace* and you are being introduced 21st  century technology.<br/><br/><br/><br/>*Ada Lovelace ]]></description>
  </game>
  <object name="Lobby">
    <inherit name="editor_room" />
    <isroom />
    <description type="string"></description>
    <usedefaultprefix type="boolean">false</usedefaultprefix>
    <prefix>the</prefix>
    <firstenter type="script"><![CDATA[
      msg ("Welcome to the lobby Ada, the names of these rooms might seem a bit daunting right now, but don't worry, with your logical skills you will pick it up quickly! <br/>It's been 175 years since your epic notes on Charles Babbage's Analytical Engine and here you can find out how far technology has come since then!<br/><br/>There are 8 rooms you can enter from here (either by selecting the blue links above or by using the compass you will see to the right of the screen) and each one contains a peice of 2018 technology, sadly though they are all missing crucial parts that they need in order to work.<br/>Take a look in this room for example, there is aTV Tuner typed in blue, that means you can select it, go ahead select it now and take a look.<br/>You can also take this item, take it now, you might need it later (see how your inventory fills up in the top right corner of the screen, and be aware that not all objects in blue can be taken but they can always be selected and interacted with in some way)<br/><br/>You will always need to come back to the lobby to enter another room as you discover the technology of the 21st Century.<br/>Good luck Ada, I cannot imagine what you will think of the tecnology of 2018!")
    ]]></firstenter>
    <onexit type="script">
    </onexit>
    <beforeenter type="script">
    </beforeenter>
    <enter type="script">
    </enter>
    <object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
    </object>
    <exit name="PC Room" alias="The PC Room" to="PC room">
      <inherit name="northdirection" />
      <runscript type="boolean">false</runscript>
      <prefix>to</prefix>
    </exit>
    <exit alias="The Smart Phone Room" to="Smart phone room">
      <inherit name="northwestdirection" />
    </exit>
    <exit alias="The 3D Printer Room" to="the 3d printer room">
      <inherit name="westdirection" />
    </exit>
    <exit alias="The Games Console Room" to="Games Consoles Room">
      <inherit name="southwestdirection" />
    </exit>
    <exit alias="The Tablet Room" to="Tablet Room">
      <inherit name="southdirection" />
    </exit>
    <exit alias="The Television Room" to="Television Room">
      <inherit name="southeastdirection" />
    </exit>
    <exit alias="The Internet Room" to="Internet">
      <inherit name="eastdirection" />
    </exit>
    <exit alias="The Smart Watch Room" to="Smart watch">
      <inherit name="northeastdirection" />
    </exit>
    <object name="TV Tuner">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <look type="script">
        msg ("The TV tuner makes it possible for your television to receive and display a digital signal.")
        picture ("51kPB8R4HCL._SY355_.jpg")
      </look>
    </object>
  </object>
  <object name="PC room">
    <inherit name="editor_room" />
    <description type="string"></description>
    <firstenter type="script">
    </firstenter>
    <enter type="script">
      msg ("The Mother board and CPU are important parts of a PC")
    </enter>
    <beforefirstenter type="script">
      msg ("You are entering the PC  room, unfortanately it will not work as it is missing it's parts")
    </beforefirstenter>
    <exit alias="back to the Lobby" to="Lobby">
      <inherit name="southdirection" />
    </exit>
    <object name="Sim card">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <look type="script">
        msg ("Every mobile phone has a sim card and they carry an identification number unique to the owner, storing personal data, and preventing operation of the phone if removed.")
        picture ("sim card.png")
      </look>
    </object>
    <object name="Glass touch screen">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <look type="script">
        msg ("The glass touch screen covers the front of an ipad allowing it to used by touch alone rather than a controller that needs to be connected.")
        picture ("scn-it-flt15.0-001-003_12_19.jpg")
      </look>
    </object>
    <object name="PC personal computer">
      <inherit name="editor_object" />
      <inherit name="switchable" />
      <take type="boolean">false</take>
      <feature_usegive />
      <feature_switchable />
      <switchonmsg>Congratulations you have discovered the personal computer or PC for short!</switchonmsg>
      <cannotswitchon>It cannot be switched on you need a mother board and CPU to get it working.</cannotswitchon>
      <switchoffmsg>The fans whirring inside go quiet and the screen goes black.</switchoffmsg>
      <fix type="script">
        if (Got(Mother board)) {
          MoveObject (Mother board, PC personal computer)
          msg ("You have connected up the mother board to the computer")
        }
        if (Got(CPU)) {
          MoveObject (CPU, PC personal computer)
          msg ("You have inserted thr CPU into the PC")
        }
        if (Contains (PC personal computer,Mother board) and Contains (PC personal computer, CPU)) {
          msg ("Great you have fixed the PC personal computer and it now can be switched on")
          PC personal computer.cannotswitchon = ""
          SetObjectFlagOn (PC personal computer, PC personal computer.fixed = true)
          CheckVictory
        }
        else if (Contains (PC personal computer,Mother board)) {
          msg ("You still need to find the CPU")
        }
        else if (Contains (PC personal computer,CPU)) {
          msg ("You still need to find the Mother board")
        }
        else {
          msg ("You need to find a Mother board and the CPU to fix this computer")
        }
      </fix>
      <onswitchon type="script">
        msg ("A computer is a type of machine that can follow stored instructions and do many different things.")
        ShowYouTube ("lJnvq0A_7WQ")
      </onswitchon>
      <onswitchoff type="script">
        HidePreviousTurnOutput
      </onswitchoff>
      <look type="script">
        msg ("You will need to fix the PC first in order to find out more!")
        picture ("pc.png")
      </look>
    </object>
  </object>
  <object name="Smart phone room">
    <inherit name="editor_room" />
    <description type="string"></description>
    <usedefaultprefix type="boolean">false</usedefaultprefix>
    <prefix>the</prefix>
    <beforefirstenter type="script">
      msg ("You are entering the Smart Phone room, unfortanately it will not work as it is missing it's parts")
    </beforefirstenter>
    <enter type="script">
      msg ("The Sim Card and Display are important parts of the Smart phone")
    </enter>
    <exit alias="back to the Lobby" to="Lobby">
      <inherit name="southeastdirection" />
    </exit>
    <object name="Cooling fan">
      <inherit name="editor_object" />
      <feature_usegive />
      <take />
      <look type="script">
        msg ("The cooling fan in a 3d printer directs a stream of air across the object whilst printing to cool the object and speed up solidification.")
        picture ("cooling-fan-gdstime-1-piece-40-3d-printer.jpg")
      </look>
    </object>
    <object name="Router">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <takemsg>This allows our computers to communicate with the internet</takemsg>
      <look type="script">
        msg ("A router is a networking device that sends data between networked devices.")
        picture ("Seven-ways-to-speed-up-your-router.jpg")
      </look>
    </object>
    <object name="Smart phone">
      <inherit name="editor_object" />
      <inherit name="switchable" />
      <attr name="not_all" type="boolean">false</attr>
      <feature_usegive />
      <feature_switchable />
      <switchonmsg>Congratulations you have discovered the smartphone!</switchonmsg>
      <cannotswitchon>You cannot use this phone as it is missing it's sim card and display</cannotswitchon>
      <switchoffmsg>It's good to keep your phone off at times.</switchoffmsg>
      <fix type="script">
        if (Got(Sim card)) {
          MoveObject (Sim card, Smart phone)
          msg ("Well done! you have inserted the sim card into the smartphone! ")
        }
        if (Got(Display)) {
          MoveObject (Display, Smart phone)
          msg ("Well done you have secured the display to the smart phone")
        }
        if (Contains (Smart phone,Sim card) and Contains (Smart phone, Display)) {
          msg ("Great you have fixed the Smart phone and it now can be switched on")
          Smart phone.cannotswitchon = ""
          SetObjectFlagOn (Smart phone,  Smart phone.fixed = true)
          CheckVictory
        }
        else if (Contains (Smart phone,Sim card)) {
          msg ("You still need to find the Display")
        }
        else if (Contains (Smart phone,Display)) {
          msg ("You still need to find the Sim card")
        }
        else {
          msg ("You need to find a Sim card and a Display to fix this Smart phone")
        }
      </fix>
      <onswitchon type="script">
        msg ("The main function of a phone is to allow you to speak to anybody at any time by dialling their number.")
        ShowYouTube ("pkNUdLxhKcE")
      </onswitchon>
      <onswitchoff type="script">
        HidePreviousTurnOutput
      </onswitchoff>
      <look type="script">
        msg ("You will need to fix the Smart Phone first in order to find out more!")
        picture ("smartphone 2.jpg")
      </look>
    </object>
  </object>
  <object name="the 3d printer room">
    <inherit name="editor_room" />
    <description type="string"></description>
    <usedefaultprefix type="boolean">false</usedefaultprefix>
    <prefix type="string"></prefix>
    <isroom />
    <beforefirstenter type="script">
      msg ("You are entering the 3D Printer room, unfortanately it will not work as it is missing it's parts")
    </beforefirstenter>
    <enter type="script">
      msg ("The Cooling Fan and Heating Bed are important parts of a 3D printer")
    </enter>
    <exit alias="back to the Lobby" to="Lobby">
      <inherit name="eastdirection" />
    </exit>
    <object name="Controller">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <look type="script">
        msg ("A controller describes itself in in it's name, it allows you to accsess your Xbox and control the characters in the games that you play.")
        picture ("6199582_R_Z001A.jpg")
      </look>
    </object>
    <object name="Wireless access point">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <look type="script">
        msg ("A wireless acsess point allows devices that can connect wirelessly to the internet to connect to the world wide web.")
        picture ("NW40040.jpg")
      </look>
    </object>
    <object name="the 3d printer">
      <inherit name="editor_object" />
      <inherit name="switchable" />
      <feature_usegive />
      <feature_switchable />
      <switchonmsg>Great! You have discovered the 3d printer!</switchonmsg>
      <cannotswitchon>Unfortunately the 3d printer cannot be turned on as you still need the cooling fan!</cannotswitchon>
      <usedefaultprefix type="boolean">false</usedefaultprefix>
      <scenery type="boolean">false</scenery>
      <displayverbs type="stringlist">
        <value>Look at</value>
        <value>Take</value>
        <value>Switch on</value>
        <value>Switch off</value>
        <value>Fix</value>
      </displayverbs>
      <switchoffmsg>The printer grinds to a halt.</switchoffmsg>
      <fix type="script">
        if (Got(Cooling fan)) {
          MoveObject (Cooling fan, the 3d printer)
          msg ("Excellent! You have inserted the coolng fan into the 3d printer!")
        }
        if (Got(Heating bed)) {
          MoveObject (Heating bed, the 3d printer)
          msg ("Brilliant! You have just added the heating bed to the 3d printer!")
        }
        if (Contains (the 3d printer,Cooling fan) and Contains (the 3d printer, Heating bed)) {
          msg ("Great you have fixed the 3d printer and it now can be switched on")
          the 3d printer.cannotswitchon = ""
          SetObjectFlagOn (the 3d printer, the 3d printer.fixed = true)
          CheckVictory
        }
        else if (Contains (the 3d printer,Cooling fan)) {
          msg ("You still need to find the Heating bed")
        }
        else if (Contains (the 3d printer,Heating bed)) {
          msg ("You still need to find the Cooling fan")
        }
        else {
          msg ("You need to find a Cooling fan and a Heating bed to fix this 3d printer")
        }
      </fix>
      <onswitchon type="script">
        msg ("A 3D printer is a machine that allows you to create physical objects from a 3 dimensional object on your computer that you create.")
        ShowYouTube ("q2rFmL2rwMo")
      </onswitchon>
      <onswitchoff type="script">
        HidePreviousTurnOutput
      </onswitchoff>
      <look type="script">
        msg ("You will need to fix the 3d printer first in order to find out more!")
        picture ("3d printer.png")
      </look>
    </object>
  </object>
  <object name="Games Consoles Room">
    <inherit name="editor_room" />
    <description type="string"></description>
    <usedefaultprefix type="boolean">false</usedefaultprefix>
    <prefix>the</prefix>
    <beforefirstenter type="script">
      msg ("You are entering the Games Console room, unfortanately it will not work as it is missing it's parts")
    </beforefirstenter>
    <enter type="script">
      msg ("The Controller and Flash Memory are important parts of a Games Console")
    </enter>
    <exit alias="back to the Lobby" to="Lobby">
      <inherit name="northeastdirection" />
    </exit>
    <object name="PCB Board">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <look type="script">
        msg ("PCB stands for printed circuit board and is the main conponent of a smart watch.")
        picture ("OEM-Android-Smart-Watch-PCB-PCBA-Digital.jpg_350x350.jpg")
      </look>
    </object>
    <object name="Xbox">
      <inherit name="editor_object" />
      <inherit name="switchable" />
      <alias>Xbox</alias>
      <feature_usegive />
      <feature_switchable />
      <switchonmsg>Well done, you have discovered the wonderful world of gaming!</switchonmsg>
      <cannotswitchon>The Games Console will not work, it needs its controller and its flash memory.</cannotswitchon>
      <usedefaultprefix type="boolean">false</usedefaultprefix>
      <prefix>an</prefix>
      <switchoffmsg>When you're 11 years old in 2018 you only do this when you're told to by your parents!</switchoffmsg>
      <onswitchon type="script"><![CDATA[
        msg ("An Xbox is a gaming console created by Microsoft mainly to play games on. <br/>The video below shows my current favourite game called Fortnite, where you need to collect weapons and items and try to survive for as long as you can.")
        ShowYouTube ("yQQkiT-Rjo8")
      ]]></onswitchon>
      <fix type="script">
        if (Got(Controller)) {
          MoveObject (Controller, Xbox)
          msg ("Exellent! You have pluged in the controller to the Xbox! ")
        }
        if (Got(Flash memory)) {
          MoveObject (Flash memory, Xbox)
          msg ("Well done! You have inserted the flash memory into the Xbox! ")
        }
        if (Contains (Xbox,Controller) and Contains (Xbox, Flash memory)) {
          msg ("Great you have fixed the Xbox and it now can be switched on")
          Xbox.cannotswitchon = ""
          SetObjectFlagOn (Xbox, Xbox.fixed = true)
          CheckVictory
        }
        else if (Contains (Xbox,Controller)) {
          msg ("You still need to find the Flash memory")
        }
        else if (Contains (Xbox,Flash memory)) {
          msg ("You still need to find the Controller")
        }
        else {
          msg ("You need to find a Controller and a Flash memory to fix this Xbox")
        }
      </fix>
      <onswitchoff type="script">
        HidePreviousTurnOutput
      </onswitchoff>
      <look type="script">
        msg ("You will need to fix the Xbox first in order to find out more!")
        picture ("Xbox_One_X_Screenshot_05.0.jpg")
      </look>
    </object>
    <object name="Display">
      <inherit name="editor_object" />
      <feature_usegive />
      <take />
      <look type="script">
        msg ("The display of a phone allows you to interact with the devices features.")
        picture ("phone_breakdown2.jpg")
      </look>
    </object>
  </object>
  <object name="Tablet Room">
    <inherit name="editor_room" />
    <description type="string"></description>
    <usedefaultprefix type="boolean">false</usedefaultprefix>
    <prefix>the</prefix>
    <beforefirstenter type="script">
      msg ("You are entering the Tablet room, unfortunately it will not work as it is missing it's parts")
    </beforefirstenter>
    <enter type="script">
      msg ("The silicon chips and glass touch screen are important parts of a tablet")
    </enter>
    <exit alias="back to the Lobby" to="Lobby">
      <inherit name="northdirection" />
    </exit>
    <object name="Speaker system">
      <inherit name="editor_object" />
      <alias>Speaker system</alias>
      <take />
      <feature_usegive />
      <look type="script">
        picture ("surround_sound_system-136428985821902601.jpg")
        msg ("A speaker system projects sound into the surrounding area. (A TV would be fairly boring without sound)")
      </look>
    </object>
    <object name="An Ipad">
      <inherit name="editor_object" />
      <inherit name="switchable" />
      <alias>Ipad</alias>
      <usedefaultprefix type="boolean">false</usedefaultprefix>
      <scenery type="boolean">false</scenery>
      <feature_usegive />
      <feature_switchable />
      <switchonmsg>Congratulations! You have discovered the Ipad!</switchonmsg>
      <cannotswitchon>The Ipad dosen't work, you need it's 3 silicon chips and it's glass touch screen.</cannotswitchon>
      <switchoffmsg>You hold down the off button and the screen goes black.</switchoffmsg>
      <onswitchon type="script">
        msg ("You can think of an Ipad as a mini computer that can be held in your hands and used by touch screen.")
        ShowYouTube ("OQdC_hHlS7k")
      </onswitchon>
      <fix type="script">
        if (Got(Glass touch screen)) {
          MoveObject (Glass touch screen, An Ipad)
          msg ("Well done! you have placed the Ipads glass touchscreen.")
        }
        if (Got(The 3 silicon chips)) {
          MoveObject (The 3 silicon chips, An Ipad)
          msg ("Brilliant! you have inserted the 3 silicon chips into the Ipad")
        }
        if (Contains (An Ipad,Glass touch screen) and Contains (An Ipad, The 3 silicon chips)) {
          msg ("Great you have fixed the Ipad and it now can be switched on")
          An Ipad.cannotswitchon = ""
          SetObjectFlagOn (An Ipad, An Ipad.fixed = true)
          CheckVictory
        }
        else if (Contains (An Ipad,Glass touch screen)) {
          msg ("You still need to find the the 3 silicon chips")
        }
        else if (Contains (An Ipad,The 3 silicon chips)) {
          msg ("You still need to find the Glass touch screen")
        }
        else {
          msg ("You need to find a Glass touch screen and the 3 silicon chips to fix this Ipad")
        }
      </fix>
      <onswitchoff type="script">
        HidePreviousTurnOutput
      </onswitchoff>
      <look type="script">
        msg ("You will need to fix the Ipad first in order to find out more!")
        picture ("417h-w9jbhL.jpg")
      </look>
    </object>
  </object>
  <object name="Television Room">
    <inherit name="editor_room" />
    <description type="string"></description>
    <beforefirstenter type="script">
      msg ("")
    </beforefirstenter>
    <enter type="script">
      msg ("The TV Tuner and speaker system are important parts of a TV")
    </enter>
    <firstenter type="script">
      msg ("You are entering the TV  room, unfortunately it will not work as it is missing it's parts")
    </firstenter>
    <exit alias="back to the Lobby" to="Lobby">
      <inherit name="northwestdirection" />
    </exit>
    <object name="The 3 silicon chips">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <look type="script">
        msg ("A silicon chip is a tiny wafer of silicon used to make an intergrated circuit.")
        picture ("image.jpg")
      </look>
    </object>
    <object name="TV">
      <inherit name="editor_object" />
      <inherit name="switchable" />
      <feature_switchable />
      <feature_usegive />
      <cannotswitchon>The television cannot be turned on, you need to fix it with the TV Tuner and the Speaker System</cannotswitchon>
      <switchonmsg>Congratulations you have discovered TV</switchonmsg>
      <displayverbs type="stringlist">
        <value>Look at</value>
        <value>Take</value>
        <value>Fix</value>
        <value>Switch On</value>
        <value>Switch Off</value>
      </displayverbs>
      <use type="boolean">false</use>
      <drop type="boolean">false</drop>
      <switchoffmsg>Sadly we can't spend all our time watching the TV.</switchoffmsg>
      <fix type="script">
        if (Got(Speaker system)) {
          MoveObject (Speaker system, TV)
          msg ("Great you have connected the speaker system")
        }
        if (Got(TV Tuner)) {
          MoveObject (TV Tuner, TV)
          msg ("Great! You have inserted the picture tube.")
        }
        if (Contains (TV,TV Tuner) and Contains (TV, Speaker system)) {
          msg ("Great you have fixed the TV and it now can be switched on")
          TV.cannotswitchon = ""
          SetObjectFlagOn (TV, TV.fixed = true)
          CheckVictory ()
        }
        else if (Contains (TV,TV Tuner)) {
          msg ("You still need to find the speaker system")
        }
        else if (Contains (TV,Speaker system)) {
          msg ("You still need to find the TV Tuner")
        }
        else {
          msg ("You need to find a TV Tuner and a speaker to fix this television")
        }
      </fix>
      <onswitchon type="script">
        msg ("A TV is a screen that shows an animated image and projects sound. Basically like going to the theatre but in your own home just not as big!")
        ShowYouTube ("1aIc7dOSUQA")
      </onswitchon>
      <useanything type="script">
      </useanything>
      <onswitchoff type="script">
        HidePreviousTurnOutput
      </onswitchoff>
      <look type="script">
        msg ("You will need to fix the TV first in order to find out more!")
        picture ("l_10158805_001.jpg")
      </look>
      <useon type="scriptdictionary" />
      <give type="scriptdictionary" />
    </object>
    <object name="Capacitive touch panel">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <look type="script">
        msg ("A capacitive touch screen is a display that reacts to touch of a finger.")
        picture ("single_touch_1_44_inch_projected_capacitive_touch_screen_panel_for_smart_watch.jpg")
      </look>
    </object>
  </object>
  <object name="Internet">
    <inherit name="editor_room" />
    <description type="string"></description>
    <beforefirstenter type="script">
      msg ("You are entering the Internet room, unfortunately it will not work as it is missing it's parts")
    </beforefirstenter>
    <enter type="script">
      msg ("The Router and Wireless Access Point are needed to access the internet")
    </enter>
    <exit alias="back to the Lobby" to="Lobby">
      <inherit name="westdirection" />
    </exit>
    <object name="Flash memory">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <look type="script">
        msg ("A kind of memory that retains data whithout the help of a power supply.")
        picture ("SanDisk-Xbox-360-8GB-USB-Flash-Drive.jpg")
      </look>
    </object>
    <object name="CPU">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <usedefaultprefix type="boolean">false</usedefaultprefix>
      <look type="script">
        msg ("A CPU carries out the instructions of a computer program.")
        picture ("cpu.jpg")
      </look>
    </object>
    <object name="computer to access the internet">
      <inherit name="editor_object" />
      <inherit name="switchable" />
      <feature_usegive />
      <feature_switchable />
      <switchonmsg>Amazing, you have discovered the Internet.</switchonmsg>
      <cannotswitchon>You cannot connect to the internet, you need the Router and a wireless access point</cannotswitchon>
      <switchoffmsg>The internet has gone down, you can no longer access it.</switchoffmsg>
      <onswitchon type="script">
        ShowYouTube ("7_LPdttKXPc")
        msg ("The internet is a network of computers that allows the sharing of information. It is like a big library that you can never physically enter.")
      </onswitchon>
      <fix type="script">
        if (Got(Wireless access point)) {
          MoveObject (Wireless access point, computer to access the internet)
          msg ("Well done! You have connected the wirless accsess point to the computer!")
        }
        if (Got(Router)) {
          MoveObject (Router, computer to access the internet)
          msg ("Brilliant! your router is now connected!")
        }
        if (Contains (computer to access the internet,Wireless access point) and Contains (computer to access the internet, Router)) {
          msg ("Great you have fixed the internet and it now can be switched on")
          computer to access the internet.cannotswitchon = ""
          SetObjectFlagOn (computer to access the internet, computer to access internet.fixed = true)
          CheckVictory
        }
        else if (Contains (computer to access the internet,Wireless access point)) {
          msg ("You still need to find the Router")
        }
        else if (Contains (computer to access the internet,Router)) {
          msg ("You still need to find the Wireless access point")
        }
        else {
          msg ("You need to find the Wireless access point and a Router to fix the internet")
        }
      </fix>
      <onswitchoff type="script">
        HidePreviousTurnOutput
      </onswitchoff>
      <look type="script">
        msg ("You will need to fix the connection to the internet first in order to find out more!")
        picture ("MzA1NDA1OQ.jpeg")
      </look>
    </object>
  </object>
  <object name="Smart watch">
    <inherit name="editor_room" />
    <description type="string"></description>
    <beforefirstenter type="script">
      msg ("You are enerting the Smart Watch room, unfortanately it will not work as it is missing it's parts")
    </beforefirstenter>
    <enter type="script">
      msg ("The Capacitive touch panel and the PCB Board are important parts of a Smart Watch")
    </enter>
    <exit alias="back to the Lobby" to="Lobby">
      <inherit name="southwestdirection" />
    </exit>
    <object name="Mother board">
      <inherit name="editor_object" />
      <take />
      <feature_usegive />
      <look type="script">
        msg ("A mother board controls all the information within a computer.")
        picture ("51XqY3bfccL.jpg")
      </look>
    </object>
    <object name="Smartwatch">
      <inherit name="editor_object" />
      <inherit name="switchable" />
      <feature_usegive />
      <feature_switchable />
      <switchonmsg>Great, you have discovered the Smart Watch</switchonmsg>
      <cannotswitchon>The smart Watch won't come on, it needs it's PCB Board and the Capacitive touch panel</cannotswitchon>
      <switchoffmsg>You don't want your smartwatch to track you today, it is now switched off.</switchoffmsg>
      <onswitchon type="script">
        msg ("A smart watch is something that you wear on your wrist that can connect to your smart phone.")
        ShowYouTube ("Rwf13CBCFic")
      </onswitchon>
      <fix type="script">
        if (Got(Capacitive touch panel)) {
          MoveObject (Capacitive touch panel, Smartwatch)
          msg ("Great, you have fixed the panel to the watch")
        }
        if (Got(PCB Board)) {
          MoveObject (PCB Board, Smartwatch)
          msg ("Excellent, you have fitted the smart watch with it's PCB board")
        }
        if (Contains (Smartwatch,Capacitive touch panel) and Contains (Smartwatch, PCB Board)) {
          msg ("Great you have fixed the Smartwatch and it now can be switched on")
          Smartwatch.cannotswitchon = ""
          SetObjectFlagOn (Smartwatch, Smartwatch.fixed = true)
          CheckVictory
        }
        else if (Contains (Smartwatch,Capacitive touch panel)) {
          msg ("You still need to find the PCB Board")
        }
        else if (Contains (Smartwatch,PCB Board)) {
          msg ("You still need to find the Capacitive touch panel")
        }
        else {
          msg ("You need to find the Capacitive touch panel and a PCB Board to fix this Smartwatch")
        }
      </fix>
      <onswitchoff type="script">
        HidePreviousTurnOutput
      </onswitchoff>
      <look type="script">
        msg ("You will need to fix the Smart watch first in order to find out more!")
        picture ("item_XL_11898051_17614082.jpg")
      </look>
    </object>
    <object name="Heating bed">
      <inherit name="editor_object" />
      <feature_usegive />
      <take />
      <look type="script">
        msg ("A heating bed is an additional module for a 3D printer that makes the cooling process of a 3D printed materials more controlled.")
        picture ("57_49a65ead-a636-44c9-a0db-dd31f8d31419_1400x.jpg")
      </look>
    </object>
  </object>
  <verb>
    <property>fix</property>
    <pattern>fix</pattern>
    <defaultexpression>"You can't fix " + object.article + "."</defaultexpression>
  </verb>
  <verb>
    <property>insert</property>
    <pattern>insert</pattern>
    <defaultexpression>"You can't insert " + object.article + "."</defaultexpression>
  </verb>
  <verb>
    <property>watch</property>
    <pattern>watch</pattern>
    <defaultexpression>"You can't watch " + object.article + "."</defaultexpression>
  </verb>
  <function name="CheckVictory">
    fixed_items = FilterByAttribute (AllObjects(), "fixed", true)
    if (ListCount (fixed_objects) = 8) {
      msg ("Congratulations, you have fixed everything and completed the game!")
    }
  </function>
</asl>

That's a typo. It should be true, not true).


You've got:
SetObjectFlagOn (PC personal computer, PC personal computer.fixed = true)

There's two ways of writing that line. If you enter it in the GUI, it will end up coming out like:

SetObjectFlagOn (PC personal computer, "fixed")

or the quicker way to type it if you're editing in code view:

PC personal computer.fixed = true

Those two lines are different ways of writing the same thing. But you seem to have a line that's a combination of the two. If you pick one of those versions, it should work better.

I can't see anywhere else that error could be coming from, so I hope that works now.


I knew i had over complicated things! Thanks again, you are so kind. Its so close, the error message now is Error running script: Error compiling expression 'ListCount (fixed_objects) = 8': Unknown object or variable 'fixed_objects' I feel if I had more time I would be able to work this one out....so annoying!


I am nearly there, i noticed there was fixed_items rather than fixed_objects in the script for Check Victory, so i changed items to objects and now I only getting an error message when i fix the computer to access the internet


I am nearly there, i noticed there was fixed_items rather than fixed_objects in the script for Check Victory, so i changed items to objects and now I only getting an error message when i fix the computer to access the internet


I am nearly there, i noticed there was fixed_items rather than fixed_objects in the script for Check Victory, so i changed items to objects and now I only getting an error message when i fix the computer to access the internet


I am nearly there, i noticed there was fixed_items rather than fixed_objects in the script for Check Victory, so i changed items to objects and now I only getting an error message when i fix the computer to access the internet


I am nearly there, i noticed there was fixed_items rather than fixed_objects in the script for Check Victory, so i changed items to objects and now I only getting an error message when i fix the computer to access the internet


Eeeekk...I have done it....I have made the game end!!! Thank you so much for your help, can't wait to hand to hand it in tomorrow :)


I Loved The Way You Discuss The Topic Great Work Thanks For The Share.
Sangria Recipe


Ahh! Spam!


Log in to post a reply.

Support

Forums