<object name="changing player object room">
<inherit name="editor_room" />
<description><![CDATA[<br/>You are in a changing player object room. If you want to give it a shot, simply type either "switch to magoo" or "switch to xanadu" to see what happens.<br/><br/>Also, there is a ladder here that leads up to the 'changing room'. Try taking your controlled character up there and type the switch commands mentioned above. <br/><br/>For more of an explanation of how this switching of characters works, type 'explain switch'.]]></description>
<object name="Xanadu">
<inherit name="editor_object" />
<inherit name="namedmale" />
<look type="script">
if (game.pov = Magoo) {
msg ("Holy moly! That looks exactly like you! To take control of Xanadu, just type 'switch to Xanadu'.")
}
else {
msg ("You are the new you. You are Xanadu. You look exactly like your former self. Nerdy and ugly!")
}
</look>
</object>
<command name="switch to xan cmd">
<pattern>switch to xanadu; switch to Xanadu; switch to xan; switch to Xan</pattern>
<script><![CDATA[
if (game.pov = Magoo) {
msg ("You close your eyes and grunt real hard. When you open them...<br/>")
wait {
msg ("<br/>You feel different, but oddly look quite similar. You have switched places with Xanadu, your alter ego. To change back to Magoo, simply type 'switch to magoo'.<br/>")
}
ChangePOV (Xanadu)
}
else {
msg ("Ummm... you already are Xanadu.")
}
]]></script>
</command>
<object name="Magoo">
<inherit name="editor_object" />
<inherit name="editor_player" />
<inherit name="namedmale" />
<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>
<attr name="pov_look">You're Magoo. A simple being trapped in a test game.</attr>
</object>
<command name="switch to magoo cmd">
<script><![CDATA[
if (game.pov = Xanadu) {
msg ("<br/>You close your eyes and grunt real hard. When you open them...<br/>")
wait {
msg ("<br/>You feel different, but oddly look quite similar. You have switched places with Xanadu, your alter ego. To change back to xanadu, simply type 'switch to xanadu'.<br/>")
}
ChangePOV (Magoo)
}
else {
msg ("You already are Magoo, dork.")
}
]]></script>
<pattern>switch to magoo; switch to Magoo; switch to mag; switch to Mag</pattern>
</command>
<object name="changing room">
<inherit name="editor_room" />
<description><![CDATA[You are in a changing room. Try to "switch to magoo" or "switch to xanadu" from here to see what happens.<br/><br/>For more of an explanation of how this switching of characters works, type 'explain switch'.]]></description>
<exit alias="down" to="changing player object room">
<inherit name="downdirection" />
</exit>
<command name="switch to magoo cmd1">
<script><![CDATA[
if (game.pov = Xanadu) {
msg ("<br/>You close your eyes and grunt real hard. When you open them...<br/>")
wait {
msg ("<br/>You feel different, but oddly look quite similar. You have switched places with Xanadu, your alter ego. To change back to xanadu, simply type 'switch to xanadu'.<br/>")
}
ChangePOV (Magoo)
}
else {
msg ("You already are Magoo, dork.")
}
]]></script>
<pattern>switch to magoo; switch to Magoo; switch to mag; switch to Mag</pattern>
</command>
<command name="switch to xan cmd1">
<pattern>switch to xanadu; switch to Xanadu; switch to xan; switch to Xan</pattern>
<script><![CDATA[
if (game.pov = Magoo) {
msg ("You close your eyes and grunt real hard. When you open them...<br/>")
wait {
msg ("<br/>You feel different, but oddly look quite similar. You have switched places with Xanadu, your alter ego. To change back to Magoo, simply type 'switch to magoo'.<br/>")
}
ChangePOV (Xanadu)
}
else {
msg ("Ummm... you already are Xanadu.")
}
]]></script>
</command>
<command name="explain switch cmd">
<pattern>explain switch</pattern>
<script><![CDATA[
msg ("To keep the switch from happening in other rooms within this tutorial, I have placed the commands 'switch to xan' and 'switch to magoo' in only the \"changing player object room\" and the \"changing room\". To make the characters switchable from any room in your game, you would put the command to switch under the room/objects tree on the left side of the GUI editor. <br/><br/>If you only want the characters to be able to switch when they are in the same room, insert an 'If/Then' script to check to see if the other controllable character is in the room, then use the change player object script. Of course, you should add an 'Else' to that script to let the player know that the switch is not allowable at this time or location using a print message script. Or, on a similar note, if you want the players to only be able to switch when they are in certain rooms, you can add 'If/Then/Else' scripts to check to see if that object is in the room or you can raise flags and check your if against a flag.")
]]></script>
</command>
</object>
<exit alias="up" to="changing room">
<inherit name="updirection" />
</exit>
<command name="explain switch cmd1">
<pattern>explain switch</pattern>
<script><![CDATA[
msg ("To keep the switch from happening in other rooms within this tutorial, I have placed the commands 'switch to xan' and 'switch to magoo' in only the \"changing player object room\" and the \"changing room\". To make the characters switchable from any room in your game, you would put the command to switch under the room/objects tree on the left side of the GUI editor. <br/><br/>If you only want the characters to be able to switch when they are in the same room, insert an 'If/Then' script to check to see if the other controllable character is in the room, then use the change player object script. Of course, you should add an 'Else' to that script to let the player know that the switch is not allowable at this time or location using a print message script. Or, on a similar note, if you want the players to only be able to switch when they are in certain rooms, you can add 'If/Then/Else' scripts to check to see if that object is in the room or you can raise flags and check your if against a flag.")
]]></script>
</command>
</object>