if (ListCount (Object_name.Object_List_Attribute_name) = 4 and ListContains (Object_name.Object_List_Attribute_name, A_chip) and ListContains (Object_name.Object_List_Attribute_name, B_chip) and ListContains (Object_name.Object_List_Attribute_name, C_chip) and ListContains (Object_name.Object_List_Attribute_name, D_chip)) {
msg ("your board has all 4 types of chips, now do what you want it to do when it has all 4 types of chips")
}
else if (ListCount (Object_name.Object_List_Attribute_name) = 4 and ListContains (Object_name.Object_List_Attribute_name, A_chip) and ListContains (Object_name.Object_List_Attribute_name, B_chip) and ListContains (Object_name.Object_List_Attribute_name, C_chip)) {
msg ("your board has 4 items, but only 3 of those items are the correct type of chips. The chip you're missing is the D_chip")
}
// etc 'else ifs'
<object name="multiple conditions met room">
<inherit name="editor_room" />
<object name="jigsaw puzzle">
<inherit name="editor_object" />
<inherit name="surface" />
<look type="script">
</look>
<takemsg>You don't dare pick up the jigsaw puzzle. It will certainly fall apart.</takemsg>
<feature_container />
<contentsprefix>in which there are</contentsprefix>
<listchildren />
<hidechildren />
<object name="thousands of placed pieces">
<inherit name="editor_object" />
<scenery type="boolean">false</scenery>
<visible />
<takemsg>You don't want to destroy the puzzle. You want to finish it!</takemsg>
<usedefaultprefix type="boolean">false</usedefaultprefix>
</object>
</object>
<object name="standard piece">
<inherit name="editor_object" />
<look>It's kind of square shaped with notches cut out on one side and tabs on the adjacent sides.</look>
<take type="script">
if (GetBoolean(standard piece, "placed")) {
msg ("You have already placed this piece correctly. No need to take it out now!")
}
else {
msg ("Taken.")
AddToInventory (standard piece)
}
</take>
<feature_usegive />
<selfuseon type="scriptdictionary">
<item key="jigsaw puzzle">
msg ("You easily find the place that this puzzle piece goes.")
MoveObject (standard piece, jigsaw puzzle)
SetObjectFlagOn (standard piece, "placed")
MakeObjectInvisible (standard piece)
</item>
</selfuseon>
</object>
<object name="border piece">
<inherit name="editor_object" />
<look>Flat on one side with a standard puzzle cut on the other. It goes on the outside.</look>
<take type="script">
if (GetBoolean(border piece, "placed")) {
msg ("You have already placed this piece correctly. No need to take it out now!")
}
else {
msg ("Taken.")
AddToInventory (border piece)
}
</take>
<feature_usegive />
<selfuseon type="scriptdictionary">
<item key="jigsaw puzzle">
msg ("Without a problem, you find where the piece goes.")
MoveObject (border piece, jigsaw puzzle)
SetObjectFlagOn (border piece, "placed")
MakeObjectInvisible (border piece)
</item>
</selfuseon>
</object>
<object name="corner piece">
<inherit name="editor_object" />
<look>It's your typical corner piece.</look>
<take type="script">
if (GetBoolean(corner piece, "placed")) {
msg ("You have already placed this piece correctly. No need to take it out now!")
}
else {
msg ("Taken.")
AddToInventory (corner piece)
}
</take>
<feature_usegive />
<selfuseon type="scriptdictionary">
<item key="jigsaw puzzle">
msg ("In mere seconds, you connect the piece perfectly in the jigsaw puzzle.")
MoveObject (corner piece, jigsaw puzzle)
SetObjectFlagOn (corner piece, "placed")
MakeObjectInvisible (corner piece)
</item>
</selfuseon>
</object>
<object name="awkward piece">
<inherit name="editor_object" />
<look>This is one of those weird pieces that don't look typical - just an odd, irregular shape.</look>
<take type="script">
if (GetBoolean(awkward piece, "placed")) {
msg ("You have already placed this piece correctly. No need to take it out now!")
}
else {
msg ("Taken.")
AddToInventory (awkward piece)
}
</take>
<feature_usegive />
<selfuseon type="scriptdictionary">
<item key="jigsaw puzzle">
msg ("You find a place for the awkward puzzle piece.")
MoveObject (awkward piece, jigsaw puzzle)
SetObjectFlagOn (awkward piece, "placed")
MakeObjectInvisible (awkward piece)
</item>
</selfuseon>
</object>
<object name="Magoo">
<inherit name="editor_object" />
<inherit name="editor_player" />
<look>You're Magoo. A simple being trapped in a test game.</look>
<attr name="pov_look">You're Magoo. A simple being trapped in a test game.</attr>
</object>
</object>
if (Contains (treasure_chest, candy) and Contains (treasure_chest, chocolate) and Contains (treasure_chest, fire_coin)) {
// example, a script to show~upload: picture_1
} else if (Contains (treasure_chest, candy) and Contains (treasure_chest, chocolate)) {
// example, a script to show~upload: picture_2
} else if (Contains (treasure_chest, candy)) {
// example, a script to show~upload: picture_3
}
count_variable = 0
foreach (object_variable, ScopeInventory) {
count_variable = count_variable + 1
}
player.number_of_objects_held = count_variable
Now I just need to know how to check to see how many missing pieces remain in the puzzle and give an appropriate description of the puzzle (i.e. there appear to be 3 missing pieces; only two pieces remain; a single piece is missing; congratulation the puzzle is complete).
<!--Saved by Quest 5.6.5621.18142-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="puzzle">
<gameid>02d1f70c-1629-4df6-b482-019cfdaa83cd</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
</object>
<object name="multiple conditions met room">
<inherit name="editor_room" />
<object name="jigsaw puzzle">
<inherit name="editor_object" />
<inherit name="surface" />
<takemsg>You don't dare pick up the jigsaw puzzle. It will certainly fall apart.</takemsg>
<feature_container />
<contentsprefix>in which there are</contentsprefix>
<listchildren />
<hidechildren />
<MissingPieceCount type="int">4</MissingPieceCount>
<look type="script">
switch (jigsaw puzzle.MissingPieceCount) {
case (4) {
msg ("It appears to be missing four pieces.")
}
case (3) {
msg ("It appears to be missing three pieces.")
}
case (2) {
msg ("It appears to be missing two pieces.")
}
case (1) {
msg ("It is missing only one piece.")
}
case (0) {
msg ("The puzzle is completed.")
}
}
</look>
<changedMissingPieceCount type="script">
msg ("The missing piece count is now " + jigsaw puzzle.MissingPieceCount)
if (jigsaw puzzle.MissingPieceCount = 0) {
msg ("CONGRATULATIONS!! YOU HAVE COMPLETED THE PUZZLE")
SetObjectFlagOn (jigsaw puzzle, "Completed")
}
</changedMissingPieceCount>
<Completed type="boolean">false</Completed>
<object name="thousands of placed pieces">
<inherit name="editor_object" />
<scenery type="boolean">false</scenery>
<visible />
<takemsg>You don't want to destroy the puzzle. You want to finish it!</takemsg>
<usedefaultprefix type="boolean">false</usedefaultprefix>
</object>
</object>
<object name="standard piece">
<inherit name="editor_object" />
<look>It's kind of square shaped with notches cut out on one side and tabs on the adjacent sides.</look>
<feature_usegive />
<take type="script">
if (GetBoolean(standard piece, "placed")) {
msg ("You have already placed this piece correctly. No need to take it out now!")
}
else {
msg ("Taken.")
AddToInventory (standard piece)
}
</take>
<selfuseon type="scriptdictionary">
<item key="jigsaw puzzle">
msg ("You easily find the place that this puzzle piece goes.")
MoveObject (standard piece, jigsaw puzzle)
SetObjectFlagOn (standard piece, "placed")
MakeObjectInvisible (standard piece)
jigsaw puzzle.MissingPieceCount = jigsaw puzzle.MissingPieceCount - 1
</item>
</selfuseon>
</object>
<object name="border piece">
<inherit name="editor_object" />
<look>Flat on one side with a standard puzzle cut on the other. It goes on the outside.</look>
<feature_usegive />
<take type="script">
if (GetBoolean(border piece, "placed")) {
msg ("You have already placed this piece correctly. No need to take it out now!")
}
else {
msg ("Taken.")
AddToInventory (border piece)
}
</take>
<selfuseon type="scriptdictionary">
<item key="jigsaw puzzle">
msg ("Without a problem, you find where the piece goes.")
MoveObject (border piece, jigsaw puzzle)
SetObjectFlagOn (border piece, "placed")
MakeObjectInvisible (border piece)
jigsaw puzzle.MissingPieceCount = jigsaw puzzle.MissingPieceCount - 1
</item>
</selfuseon>
</object>
<object name="corner piece">
<inherit name="editor_object" />
<look>It's your typical corner piece.</look>
<feature_usegive />
<take type="script">
if (GetBoolean(corner piece, "placed")) {
msg ("You have already placed this piece correctly. No need to take it out now!")
}
else {
msg ("Taken.")
AddToInventory (corner piece)
}
</take>
<selfuseon type="scriptdictionary">
<item key="jigsaw puzzle">
msg ("In mere seconds, you connect the piece perfectly in the jigsaw puzzle.")
MoveObject (corner piece, jigsaw puzzle)
SetObjectFlagOn (corner piece, "placed")
MakeObjectInvisible (corner piece)
jigsaw puzzle.MissingPieceCount = jigsaw puzzle.MissingPieceCount - 1
</item>
</selfuseon>
</object>
<object name="awkward piece">
<inherit name="editor_object" />
<look>This is one of those weird pieces that don't look typical - just an odd, irregular shape.</look>
<feature_usegive />
<take type="script">
if (GetBoolean(awkward piece, "placed")) {
msg ("You have already placed this piece correctly. No need to take it out now!")
}
else {
msg ("Taken.")
AddToInventory (awkward piece)
}
</take>
<selfuseon type="scriptdictionary">
<item key="jigsaw puzzle">
msg ("You find a place for the awkward puzzle piece.")
MoveObject (awkward piece, jigsaw puzzle)
SetObjectFlagOn (awkward piece, "placed")
MakeObjectInvisible (awkward piece)
jigsaw puzzle.MissingPieceCount = jigsaw puzzle.MissingPieceCount - 1
</item>
</selfuseon>
</object>
<object name="Magoo">
<inherit name="editor_object" />
<inherit name="editor_player" />
<look>You're Magoo. A simple being trapped in a test game.</look>
<attr name="pov_look">You're Magoo. A simple being trapped in a test game.</attr>
</object>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
</asl>
<MissingPieceCount type="int">6</MissingPieceCount>
and with each correct placement of my 6 total parts I'd have a line like this metal plate.MissingPieceCount = metal plate.MissingPieceCount - 1
I'd have to add a changedMissingPieceCount attribute on the land mine that tells the player the land mine is ready for use 'If' the MissingPieceCount equals 0. I'd also add a flag here that makes the 'use' of the land mine effective.<GrateRemovalCount type="int">2</GrateRemovalCount>
. When the player uses the dryer sheet on themselves and sprays the room with water I'd have a line of code at the end of that script (respectively) like this grate.GrateRemovalCount = grate.GrateRemovalCount - 1
. I'd have to add a changedGrateRemovalCount attribute to the grate that gives the player a hint that removal of the grate is now possible 'If" the GrateRemovalCount equals 0. I'd also Unlock the exit leading from the grate room to the maximum security prison cell.<VehiclesDisabledCount type="int">6</VehiclesDisabledCount>
When each vehicle is disabled, I'd add a line of code like so: game.VehiclesDisabledCount = VehicleDisabledCount - 1
. I would add a changedVehicleDisabledCount attribute to the game that raises a flag that the garage door (escape route) can now be raised with the correct code 'If' the VehicleDisabledCount equals 0.