true third person
epicanthical
18 Jul 2016, 20:28I'm aware of resources that allow for basic third person view shifts a la "you/I" to "he/she/name." I'm interested to know the best way to take that a step further, where the game pov can actually see and interact with a player object as if it were not a pov object.
i.e., something like:
Room Description
NPC A is here.
NPC B is here.
becomes:
Room Description
NPC A is here.
NPC B is here.
PlayerPov is here.
Where interaction options are the same as well, e.g., PlayerPov is clickable and lookable.
I can see how this can be done by using a doppleganger object to follow and represent the player but isn't strictly game.pov, but I'm wondering if there's a more elegant way to just change Quest output to include game.pov directly.
hegemonkhan
19 Jul 2016, 05:09briefly:
Objects can be a Player Object ('Player' Tab -> 'look at' text box options: pov_look, and the other Attributes are: pov_alias, pov_gender, pov_article, pov_alt) and a non-player Object ('Setup' Tab -> 'look at' text box options), but not at the same time, of course. So when the Object is the 'game.pov' (the currently controlled Player Object), then its 'pov_XXX' Attributes are used, and when the Object is not the 'game.pov', then its 'pov_XXX' Attributes are not used.
so you can script, by using the 'game.pov' Object Attribute as the checking mechanism, for example (using Commands for quickness):
<game name="example">
<attr name="pov" type="object">player</attr>
<attr name="start" type="script">
msg ("Type: changepovto ('player' or 'player_2'), to change your character")
msg ("Type: viewpovinfo ('player' or 'player_2'), to see that character's info, be its 'pov' or 'non-pov' info")
wait {
msg ("")
}
</attr>
</game>
<object name="player">
<attr name="feature_player" type="boolean">true</attr>
<attr name="alias" type="string">john</attr>
<attr name="pov_alias" type="string">jeff</attr>
</object>
<object name="player_2">
<attr name="feature_player" type="boolean">true</attr>
<attr name="alias" type="string">matt</attr>
<attr name="pov_alias" type="string">mike</attr>
</object>
<command name="change_pov_command">
<pattern>changepovto #object_parameter#</pattern>
<script>
if (HasBoolean (object_parameter, "feature_player")) {
ChangePov (object_parameter)
} else {
msg ("Your inputted Object is not able to become a Player object, try again.")
}
</script>
</command>
<command name="character_information_screen_command">
<pattern>viewpovinfo #object_parameter#</pattern>
<script>
if (object_parameter = game.pov) {
msg ("Name: " + object_parameter.pov_alias)
} else {
msg ("Name: " + object_parameter.alias)
}
</script>
</command>
Jay Nabonne
20 Jul 2016, 06:45epicanthical, you have an example with "is here" for the various objects, but I don't think that's standard Quest. Is that script you have written or are going to write? If so, then you can include the player object as you see fit in that output.
If it's more hypothetical, and you can plan to use the Quest standard output, you can look in the core code and see where (for example) the room description building code is stripping the player out. In fact, in the room description where it builds the object list, this function is stripping the player object out:
<function name="RemoveSceneryObjects" type="objectlist" parameters="list">
<![CDATA[
result = NewObjectList()
foreach (obj, list) {
if (not obj.scenery and obj <> game.pov and obj.visible) {
list add (result, obj)
}
}
return (result)
]]>
</function>
(I don't know if I'd consider the player object "scenery", but...)
If you were to drop that into your game and remove the "and obj <> game.pov" part, then your player would show up as an object. I don't know what other ramifications there would be to that, but that's where I'd start.