Having trouble with the switch pov function

So I coded into my game that when you reach a certain point the pov is switched from the original player object to another. I enabled the second player object to function as such, and set up the player tab. Now in this scene where you switch character's the other player object is in third person. But even though I set up the alias as the characters name, gender as he and possessive as him, and what not when the game makes the switch it still uses the alias you, and your and such. How come it didn't change the alias as I set it up and what not?


Not sure quite how you set it up, but...

When you change the POV, it should still use "you", but the "you" refers to a different character.

Say you have two characters, Adam and Bill. When the player is Adam, Quest will use the setting on Adam's Player tab for Adam, which is "you" by default", and the settings on Bill's Setup tab for Bill ("he" by default).

When she switches to Bill, that gets reversed, so now it uses the setting on Bill's Player tab for Bill, which again is "you" by default".


Mr. Parser

even though I set up the alias as the characters name, gender as he and possessive as him, and what not when the game makes the switch it still uses the alias you, and your and such.

When you set an object up as "Can be player", it adds a "Player" tab to that object (which Pixie referenced). THAT is where you change the POV alias and such.


(filler for getting my edited post, updated/posted)
(again, filler for getting my edited post, updated/posted)


as has been stated:

in the GUI/Editor, you can set Objects as being 'can be player' on whatever TAB, which enables the 'player' TAB to show up.

on/in the 'player' Tab, you now got the various 'pov' Attributes, which are used when you're currently controlling that Object (game.pov = NAME_OF_OBJECT)

but, there's still also the normal (for when being NON-currently-controlled) various Attributes under the 'setup' Tab


many people often set up the normal Attributes (for example, the 'alias' and 'look' Attributes) and are confused as why they don't have/see those Attributes when they're controlling the Object, not realizing that there's the 'pov' Attributes under the 'player' Tab, for when you're currently controlling the Object

when NOT currently controlling the Object: the normal Attributes (under the 'setup' Tab) are used

when you ARE currently controlling the Object: the 'pov' Attributes (under the 'player' Tab) are used


also, there's the usage of the universal:

'game.pov' ('game' Object -> whatever Tab -> option: currently controlled Player, pov: point of view, or something like this, as scripting it is this: game.pov = NAME_OF_OBJECT)

(and in code, it looks like this, see code box below)

<game name="EXAMPLE_GAME">
  <attr name="pov" type="object">player</attr>
  // or
  // <attr name="pov" type="object">john</attr>
</game>

<object name="player">
  <inherit name="editor_object" />
  <inherit name="editor_player" />
</object>

<object name="john">
  <!--
  the 'editor_player' Object Type enables the 'player' Tab in the GUI/Editor, I think, but it may also set the 'game.pov' too... which if so, would cause an error if you also gave 'john' the 'editor_player' Object Type (along with the 'player' also having the 'editor_player' Object Type), as you can't be controlling two Objects at the same time, lol

  but I think there's some other Attributes involved... I'm not exactly sure how the built-in features/coding/Attribute stuff of the 'pov' works

  using scripting and/or the GUI/Editor makes it work fine, but I don't know how the built-in stuff works with the 'pov' feature when doing this in code manually with these creation tags... there's some more stuff that the GUI/Editor and.or scripting does, that I'm not aware of, so I'm probably missing some stuff with trying to do this via the code and these creation tags, attributes, and etc
  -->
</object>

which acts upon whichever Object is currently being controlled

so for example, say you got two Objects that can be controlled:

john and jeff

when you're controlling john, and you do this for example:

game.pov.strength = 100

john's strength is set at 100

now, if you change over to controlling jeff, and you do this for example:

game.pov.strength = 100

jeff's strength is set at 100

so, the 'game.pov' is good and bad, if you want things to happen to who-ever is the currently controlled Object, then using the 'game.pov' is good, but if you only want some things to happen to only certain Objects that can be controlled, than using the 'game.pov' is bad.

So, if you only want certain controllable Objects to be effected, then use those specific Object's names, for example:

john.strength = 75
jeff.strength = 25

but if you want the effect to be applied to who-ever is the currently controlled Object, then use, for example:

game.pov.strength = 100


Well like I said I did enable the player tab on the other character and set the player tab alias to the character's name does that mean it will always refer to the character as I regardless of what I set the player tab alias too?


It says "you" in a lot of the default messages. You'll have to change the templates as well, I think.
The alias/gender on the player tab is mostly used when you're trying to use a command on yourself.


“Berk want to hep but me no how to how. Much easier when payer assume one person roe. Good uck!”
(An odd screech, thump, screech accompanies this useless message)


@ thickar:


you'd need to use for the Object, either:

  1. NAME_OF_OBJECT
  2. game.pov

and, for the Object.Attribute, either:

  1. NAME_OF_OBJECT.NAME_OF_ATTRIBUTE
  2. game.pov.NAME_OF_ATTRIBUTE

and I believe there's options under the Tabs (the 'game' Object's Tabs and/or the individual Objects' Tabs), for controlling whether it uses 'you' as well as for 'prefix' and 'suffix' usages as well (over-riding/over-writing the default messages), as 'mrangel' was talking about, as well as what he mentioned with the templates (changing the default messages)


It says "you" in a lot of the default messages. You'll have to change the templates as well, I think.

I recently created a library to do just that:
https://github.com/ThePix/quest/wiki/Library:-Third-Person,-Past-Tense

It is also in the past tense, but you can easily edit the text as required. If you want want character to be "you" and another to be named, however, that will be a problem.


I reviewed all the replies and none of them provide an answer I can understand, still need help here?


Go into code view. I still have Imgur screenshots I used from another thread.

https://i.imgur.com/3mK7PC3.png
https://i.imgur.com/Qt5DJ1D.png

If you are coding for the player, and you change the player, you'd need to have player.pov.

Then you do this....
player.pov.article = Split("he;him;his", ";")
player.pov.gender = male
player.pov.name = guy
player.pov.alias = Jack

Or this...
this.pov.article = Split("he;him;his", ";")
this.pov.gender = male
this.pov.name = guy
this.pov.alias = Jack

Or this...

player.pov.article = Split("he;him;his", ";")
player.pov.gender = "male"
player.pov.name = "guy"
player.pov.alias = "Jack"

Or this...

this.article = Split("he;him;his", ";")
this.gender = "male"
this.name = "guy'
this.alias = "Jack"

I'm sure someone will correct me, but feel free to try these out.


@jmnevil54
The OP has already changed the pov_article, pov_alias, pov_alt, pov_gender, and pov_article.
They said that in the first post.

The problem now is templates.
To get Quest to stop referring to the player as "you", it would be necessary to go through English.aslx and change a lot of the templates.

For example, changing
<dynamictemplate name="DropSuccessful">"You drop " + object.article + "."</dynamictemplate>
to
<dynamictemplate name="DropSuccessful">WriteVerb(game.pov, "drop") + object.article + "."</dynamictemplate>
so that it will say "You drop it." if the player's gender is "you", and "He drops it." if the player's gender is "he".

Nearly all of the messages in the default language template use "you" for the player, even if the attributes on the player tab of the object are changed.


I reviewed all the replies and none of them provide an answer I can understand, still need help here?

OK, here's a library file. I can't test this, because I don't have the desktop version of Quest and I think you can't do this in the online version. So hopefully someone else will be able to help if you're not sure how to add libraries.

You need to add a library file containing the following code:

<library>
	<dynamictemplate name="UnresolvedLocation">CapFirst(game.pov.gender) + " can't go there."</dynamictemplate>
	<dynamictemplate name="TakeSuccessful">WriteVerb(game.pov, "pick") + " " + object.article + " up."</dynamictemplate>
	<dynamictemplate name="TakeUnsuccessful">CapFirst(game.pov.gender) + " can't take " + object.article + "."</dynamictemplate>
	<dynamictemplate name="MaxObjectsInInventory">CapFirst(game.pov.gender) + " can't carry any more items."</dynamictemplate>
	<dynamictemplate name="MaxObjectsInContainer">CapFirst(game.pov.gender) + " can't put more items in " + object.article + "."</dynamictemplate>
	<dynamictemplate name="SeeListHeader">CapFirst(game.pov.gender) + " can see"</dynamictemplate>
	<dynamictemplate name="GoListHeader">CapFirst(game.pov) + " can go"</dynamictemplate>
	<dynamictemplate name="NotCarryingAnything">WriteVerb(game.pov, "be") + " not carrying anything."</dynamictemplate>
	<dynamictemplate name="CarryingListHeader">WriteVerb(game.pov, "be") + " carrying"</dynamictemplate>
	<dynamictemplate name="DropSuccessful">WriteVerb(game.pov, "drop") + " " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DropUnsuccessful">CapFirst(game.pov.gender) + " can't drop " + object.article + "."</dynamictemplate>
	<dynamictemplate name="ObjectCannotBeStored">CapFirst(game.pov.gender) + " can't put " + object.article + " there."</dynamictemplate>
	<dynamictemplate name="AlreadyTaken">"You are already carrying " + object.article + "."</dynamictemplate>
	<dynamictemplate name="NotCarrying">"You are not carrying " + object.article + "."</dynamictemplate>
	<dynamictemplate name="CantUse">CapFirst(game.pov.gender) + " can't use " + object.article + "."</dynamictemplate>
	<dynamictemplate name="CantGive">CapFirst(game.pov.gender) + " can't give " + object.article + "."</dynamictemplate>
	<dynamictemplate name="YouAreIn">WriteVerb(game.pov, "be") + " in"</dynamictemplate>
	<dynamictemplate name="CantOpen">CapFirst(game.pov.gender) + " can't open " + object.article + "."</dynamictemplate>
	<dynamictemplate name="CantClose">CapFirst(game.pov.gender) + " can't close " + object.article + "."</dynamictemplate>
	<dynamictemplate name="OpenSuccessful">WriteVerb(game.pov, "open") + " " + object.article + "."</dynamictemplate>
	<dynamictemplate name="CloseSuccessful">WriteVerb(game.pov, "close") + " " + object.article + "."</dynamictemplate>
	<dynamictemplate name="CannotDoThat">CapFirst(game.pov.gender) + " can't do that."</dynamictemplate>
	<dynamictemplate name="NoKey">WriteVerb(game.pov, "do") + " not have the key."</dynamictemplate>
	<dynamictemplate name="CannotLockOpen">CapFirst(game.pov.gender) + " cannot lock " + object.article + " when " + object.gender + " " + Conjugate(object, "be") + " open."</dynamictemplate>
	<dynamictemplate name="SwitchedOn">WriteVerb(game.pov, "turn") + " " + object.article + " on."</dynamictemplate>
	<dynamictemplate name="SwitchedOff">WriteVerb(game.pov, "turn") + " " + object.article + " off."</dynamictemplate>
	<dynamictemplate name="Eaten">WriteVerb(game.pov, "eat") + " " + object.article + "."</dynamictemplate>
	<dynamictemplate name="YouLooking">WriteVerb(game.pov, "be") + " looking " + text +"."</dynamictemplate>
	<dynamictemplate name="NothingToDrop">WriteVerb(game.pov, "have") + " nothing to drop."</dynamictemplate>
	<dynamictemplate name="NothingToWear">WriteVerb(game.pov, "have") + " nothing to wear."</dynamictemplate>
	<dynamictemplate name="NothingToRemove">WriteVerb(game.pov, "have") + " nothing to take off."</dynamictemplate>
	<dynamictemplate name="WearSuccessful">WriteVerb(game.pov, "put") + " " + object.article + " on."</dynamictemplate>
	<dynamictemplate name="WearUnsuccessful">CapFirst(game.pov.gender) + " can't wear " + object.article + "."</dynamictemplate>
	<dynamictemplate name="CannotWearIfNotHeld">CapFirst(game.pov.gender) + " would need to get " + object.article + " before " + game.pov.article + " can put " + object.article + " on."</dynamictemplate>
	<dynamictemplate name="CannotRemoveIfNotHeld">CapFirst(game.pov.gender) + "would need to get " + object.article + " before " + game.pov.article + " can take " + object.article + " off."</dynamictemplate>
	<dynamictemplate name="AlreadyWearing">WriteVerb(game.pov, "be") + " already wearing " + object.article + "."</dynamictemplate>
	<dynamictemplate name="CannotRemoveIfNotWearing">WriteVerb(game.pov, "be") + " not wearing " + object.article + "."</dynamictemplate>
	<dynamictemplate name="NotRemovable">CapFirst(game.pov.gender) + " cannot remove " + object.article + "!"</dynamictemplate>
	<dynamictemplate name="CannotWearOver">CapFirst(game.pov.gender) + " cannot wear that over " + GetDisplayGarment(object) + "."</dynamictemplate>
	<dynamictemplate name="CannotWearWith">CapFirst(game.pov.gender) + " cannot wear that while wearing " + GetDisplayGarment(object) + "."</dynamictemplate>
	<dynamictemplate name="RemoveSuccessful">WriteVerb(game.pov, "take") + " " + object.article + " off."</dynamictemplate>
	<dynamictemplate name="RemoveFirst">CapFirst(game.pov.gender) + " can't remove that while wearing " + GetDisplayGarment(object) + "."</dynamictemplate>
	<dynamictemplate name="DefaultBuy">CapFirst(game.pov.gender) + " can't buy " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultClimb">CapFirst(game.pov.gender) + " can't climb " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultDrink">CapFirst(game.pov.gender) + " can't drink " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultEat">CapFirst(game.pov.gender) + " can't eat " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultHit">CapFirst(game.pov.gender) + " can't hit " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultKill">CapFirst(game.pov.gender) + " can't kill " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultKiss">CapFirst(game.pov.gender) + " can't kiss " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultKnock">CapFirst(game.pov.gender) + " can't knock " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultLick">CapFirst(game.pov.gender) + " can't lick " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultLie">CapFirst(game.pov.gender) + " can't lie on " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultListenTo">WriteVerb(game.pov, "listen") + ", but " + object.gender + " makes no sound."</dynamictemplate>
	<dynamictemplate name="DefaultLock">CapFirst(game.pov.gender) + " can't lock " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultMove">CapFirst(game.pov.gender) + " can't move " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultPull">CapFirst(game.pov.gender) + " can't pull " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultPush">CapFirst(game.pov.gender) + " can't push " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultRead">CapFirst(game.pov.gender) + " can't read " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultSearch">CapFirst(game.pov.gender) + " can't search " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultShow">CapFirst(game.pov.gender) + " can't show " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultSit">CapFirst(game.pov.gender) + " can't sit on " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultSmell">WriteVerb(game.pov, "sniff") + ", but " + object.gender + " doesn't smell of much."</dynamictemplate>
	<dynamictemplate name="DefaultTaste">CapFirst(game.pov.gender) + " can't taste " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultThrow">CapFirst(game.pov.gender) + " can't throw " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultTie">CapFirst(game.pov.gender) + " can't tie " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultTouch">CapFirst(game.pov.gender) + " can't touch " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultTurnOn">CapFirst(game.pov.gender) + " can't turn " + object.article + " on."</dynamictemplate>
	<dynamictemplate name="DefaultTurnOff">CapFirst(game.pov.gender) + " can't turn " + object.article + " off."</dynamictemplate>
	<dynamictemplate name="DefaultTurn">CapFirst(game.pov.gender) + " can't turn " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultUnlock">CapFirst(game.pov.gender) + " can't unlock " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultUntie">CapFirst(game.pov.gender) + " can't untie " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultUseOn">CapFirst(game.pov.gender) + " can't use " + object2.article + " that way."</dynamictemplate>
	<dynamictemplate name="DefaultWear">CapFirst(game.pov.gender) + " can't wear " + object.article + "."</dynamictemplate>
	<dynamictemplate name="DefaultListen">CapFirst(game.pov.gender) + " can't hear much."</dynamictemplate>
	<dynamictemplate name="DefaultJump">WriteVerb(game.pov, "jump") + ", but nothing happens."</dynamictemplate>
	<dynamictemplate name="EditorVerbDefaultExpression">CapFirst(game.pov.gender) + " can't #verb# " + object.article + "."</dynamictemplate>
</library>

I'm not sure how to do this, as I don't have the desktop version of Quest; you probably just need to paste the code into a file with the .aslx extension, save it in the right place, and import that file into your game somehow.

Or possible open your game in full code view, and add all those lines except the <library> and </library> immediately after the line </game>.


Okay thanks for your replies so far I am trying to keep up but to save some time I have a question to zero in on the solution that gives me the result I want. So guys do any of the solutions you suggested so far make it so I can specify on individual player object basis which one is referred to as you and another referred to as a person's name or gender separately. Or would all them simply make it that every player object in the game would be referred to by a name or he or she and I couldn't make an different one referred to as you?


K.V.

Hello.

If you are using the desktop version of Quest, that last post by mrangel should be exactly what you want.


Okay so I finally added the code that Mrangel suggested by adding it into the games code view exactly where he said to, and the game functions still, but I don't know how to make the code work now that I have?


Unless I'm missing something, I think that should work.
Just to make sure we're on the right page, can you give an example of some output that isn't coming out right?

And can someone who has the desktop editor tell me what I've got wrong? To implement this in my own game (as I'm using the web editor), I think I'll have to download the published version and add these lines into the .quest file. So I'd really like to get my head around this stuff better.

(In case it's relevant, I'm setting the alias/gender/article/possessive on the player tab to "yourself/I/myself/my" to get the player to speak in the first person)


Oh, one thing I noticed.
If you have the "You are in…" at the start of a location, that can't easily change to the right gender of the player, because every room has a string attribute containing the string "You are in".

If you want that to change when you change character, you'd need to add a function containing something like…

foreach (obj, AllObjects()) {
  if (HasString (obj, "descprefix")) {
    if (not HasString (obj, "descprefixtemplate")) {
      obj.descprefixtemplate = obj.descprefix
    }
    obj.descprefix = Replace (obj.descprefixtemplate, "You are", GetDisplayAlias(game.pov) + " " + Conjugate (game.pov, "be"))
  }
}

(to run at the start of the game, and after changing POV).


@Mrangel
Not sure this will actually help me, I realize now I forgot to specify that by third person I wanted the alternate player character to be addressed by their name or to be specific their alias, not as he or she. is that possible?


I was thinking about ways to do that.

In the code I posted above, you could replace game.pov.gender with GetDisplayAlias (game.pov), and WriteVerb(game.pov, " with CapFirst(GetDisplayAlias (game.pov)) + " " + Conjugate (game.pov, ".

Might lead to other issues; I'm not sure.


@Mrangel, but I tried your library a second time, and still nothing changes, it's still you on the second player character, is there something further I have to do besides load the library?


I can't test it because I don't have the desktop version.
Which statements remain unchanged? All of them?

I've just gone through changing "you" to "I" using the online editor, which is a lot less flexible.
Can you confirm which part of the script isn't working?


Well none of it seems to be, but I', unclear exactly what? im' looking for?


Hi Thickar not sure if it will help but i made a video awhile ago going over how to switch your character to another, im just giving you a time stamped link where i start going over character selection https://youtu.be/gKwVvT5Tyy0?t=13m21s

Hope it helps

Edit: Also in another video I go over gender and switching to male or female

Note: Tutorial uses offline editor.


@Onimike,
Wow that was a colossal waste of my time, did you even read the first post, I didn't ask anything about creating characters or assigning names and genders, I already figured those out, what I'm having a problem with is changing the pov to another player character and having them referred to in the third person by their name. so for example when you enter a room ,it says Max is in the kitchen instead of saying you are in the kitchen.

Look what I think I want to do is change the template so it changes the I statement, especially in the your in statement to the objects alias, is it possible to write a script or something that does this when run along with the code to change the pov?


It should automatically be using the player/objects name. Why wouldn't it?


especially in the your in statement

This is the only part of the code I can test using the online editor; so this is the part I know works.

Can you please share the game, so we can take a look and try to wotk out why it isn't working?


Okay I'm starting to figure this out on my own, but here is my first question to do so, so lets see if I want to check the result of the variable of who is the current player object.
Do I call it in an if statement using the variable player, or game.pov, or something else?


The variable game.pov refers to the object that the player is currently controlling. You can examine it if you need to find out who the player currently is.

player is not a variable; when your code contains player, it means an object whose name is player. This is what the default player object is called.

So if you have code that you want to work differently depending which person is the player, you should use game.pov.


<game name="NAME_OF_GAME">

  <attr name="pov" type="object">player_1</attr>

  <attr name="start" type="script">

    game.player_objectlist_attribute = NewObjectList ()
    list add (game.player_objectlist_attribute, player_1)
    list add (game.player_objectlist_attribute, player_2)
    list add (game.player_objectlist_attribute, player_3)

    game.pov = ObjectListItem (game.player_objectlist_attribute, GetRandomInt (0, ListCount (game.player_objectlist_attribute) -1))

  </attr>

</game>

<object name="room">

  <inherit name="editor_room" />

</object>

<object name="player_1">

  <inherit name="editor_object" />
  <inherit name="editor_player" />

  <attr name="parent" type="object">room</attr>

</object>

<object name="player_2">

  <inherit name="editor_object" />
  <inherit name="editor_player" />

  <attr name="parent" type="object">room</attr>

</object>

<object name="player_3">

  <inherit name="editor_object" />
  <inherit name="editor_player" />

  <attr name="parent" type="object">room</attr>

</object>

<command name="change_pov_command">

  <pattern>changepov</pov>

  <script>

    show menu ("Player?", game.player_objectlist_attribute, false) {
      game.pov = result
    }

  </script>

</command>

Still having trouble, but I have a new question, is there code to check which object is the current player object or by which I mean the pov is set to?


<command name="view_pov_command">

  <pattern>viewpov</pattern>

  <script>

    msg ("Current Game Pov: " + game.pov.name) // if you do/use 'game.pov' then you'll get an Object (hyperlink and etc) instead of just a string/text of its name

  </script>

</command>

// -------------------

<game name="NAME_OF_GAME">

  <attr name="pov" type="object">player</attr>

  <attr name="changedpov" type="script">

    if (game.pov = player or game.pov.name = "player") {
      msg ("player")
    } else if (game.pov = hegemonkhan or game.pov.name = "hegemonkhan") {
      msg ("hegemonkhan")
    }

    switch (game.pov) {
      case (player) {
        msg ("player")
      }
      case (hegemonkhan) {
        msg ("hegemonkhan")
      }
    }

    switch (game.pov.name) {
      case ("player") {
        msg ("player")
      }
      case ("hegemonkhan") {
        msg ("hegemonkhan")
      }
    }

  </attr>

</game>

<object name="room">

  <inherit name="editor_room" />

</object>

<object name="player">

  <inherit name="editor_object" />
  <inherit name="editor_player" />

  <attr name="parent" type="object">room</attr>

</object>

<object name="hegemonkhan">

  <inherit name="editor_object" />
  <inherit name="editor_player" />

  <attr name="parent" type="object">room</attr>

</object>

@hegemonkhan
Thanks but I'm going to need more elaboration on what that code does, I'm not good at figuring out how it works by looking at it alone


To check which object the player is, you can simply compare game.pov to other objects.

For example:

if (game.pov = player) {
  msg ("You are the default player object.")
}
else if (game.pov = steve) {
  msg ("You are Steve.")
}
[not directly related to the OP; me going off at a tangent about ways to make WriteVerb more flexible]

Would there be an easy way to make WriteVerb decide sensibly whether to use "you", "he", or an actual alias sensibly?
I'm wondering if it might actually make more sense to have WriteVerb as a text processor command; or output a text processor command in place of the pronoun. Because the text processor can look at the whole line when it decides whether to use "he" or the object's actual alias.

Possible modes could include:

  • Always use pronouns
  • Always use aliases
  • Use pronouns if that character's alias has already been used in this line (trackable using the text processor's data hash)
  • Use pronouns if the object being referenced is currently in game.lastobjects and/or game.pov.currentcommandresolvedelements
  • Maybe override behaviour using a per-object flag

So you could do msg (WriteVerb(game.pov, "try")+" to dance. "+WriteVerb(game.pov, "look")+" silly.")
and it would give you "You try to dance. You look silly." or "Bob trys to dance. He looks silly."

And a tangent within a tangent... that should be "tries", not "trys". WriteVerb should really allow the user to supply a dictionary of verb forms, before falling back onto "add 's'" as the default. Maybe a dictionary game.verbforms, with the dictionary form as the key, and the elements being either the third person present, or a stringdictionary mapping pronouns onto verb forms.


Are you wanting to do this in the first person when the player is one character, and in the third person when the player is another character?

Could you post your game (or a sample game with the same issues) so we can see what is happening?


(filler for getting my edited post, updated/posted)


Thanks but I'm going to need more elaboration on what that code does, I'm not good at figuring out how it works by looking at it alone (Thickar)

sorry, about that!


to simply see (display) what/who is the current 'game.pov', you do just that, display it (the 'msg' Script / 'print a message' Script):

// using the 'game.pov.name' (or: game.pov.alias) will have this displayed as just a string/text
// using just 'game.pov' will have this displayed as an Object (as a blue clickable hyperlink)

msg (game.pov.name)
// output/display example: player

// or: using the text processor commands:

msg ("{game.pov.name}")
// output/display example: player

// or, example:

msg ("Current Game Pov: " + game.pov.name)
// output/display example: Current Game Pov: player

// or, example, using a text processor command:

msg ("Current Game Pov: {game.pov.name}")
// output/display example: Current Game Pov: player

so, I made a Command (so that you just have to type in: viewpov, which is my example pattern, during game play), to view/see/display/check what/who it is whenever you want to do so:

<command name="view_pov_command">

  <pattern>viewpov</pattern>

  <script>

    msg ("Current Game Pov: " + game.pov.name) // if you do/use 'game.pov' then you'll get an Object (hyperlink and etc) instead of just a string/text of its name

  </script>

</command>

so, I made a Command (so that you just have to type in: changepov, which is my example pattern, during game play), to change/switch/toggle amongst what/who you're controlling whenever you want to do so, an example of it:

<game name="NAME_OF_GAME">

  <attr name="start" type="script">

    game.player_objectlist_attribute = NewObjectList ()
    list add (game.player_objectlist_attribute, player)
    list add (game.player_objectlist_attribute, hegemonkhan)

  </attr>

</game>

<command name="change_pov_command">

  <pattern>changepov</pov>

  <script>

    show menu ("Which Player Object do you want to control?", game.player_objectlist_attribute, false) {
      game.pov = result
    }

  </script>

</command>

if you want actions to occur (or not) based on what/who it is, then I gave some quick example code of doing so:

<game name="NAME_OF_GAME">

  <attr name="pov" type="object">player</attr>

  <attr name="changedpov" type="script">

    // the 'or' (2nd condition) is just to show the two different ways of checking it: either as a STRING (game.pov.name="STRING") or as an Object (game.pov=Object):

    if (game.pov = player or game.pov.name = "player") {
      msg ("player")
    } else if (game.pov = hegemonkhan or game.pov.name = "hegemonkhan") {
      msg ("hegemonkhan")
    }

    // or (just an alternative):

    switch (game.pov) {
      case (player) {
        msg ("player")
      }
      case (hegemonkhan) {
        msg ("hegemonkhan")
      }
    }

    // or (just an alternative):

    switch (game.pov.name) {
      case ("player") {
        msg ("player")
      }
      case ("hegemonkhan") {
        msg ("hegemonkhan")
      }
    }

  </attr>

  <attr name="start" type="script">

    game.player_objectlist_attribute = NewObjectList ()
    list add (game.player_objectlist_attribute, player)
    list add (game.player_objectlist_attribute, hegemonkhan)

  </attr>

</game>

<object name="room">

  <inherit name="editor_room" />

</object>

<object name="player">

  <inherit name="editor_object" />
  <inherit name="editor_player" />

  <attr name="parent" type="object">room</attr>

</object>

<object name="hegemonkhan">

  <inherit name="editor_object" />
  <inherit name="editor_player" />

  <attr name="parent" type="object">room</attr>

</object>

<command name="change_pov_command">

  <pattern>changepov</pov>

  <script>

    show menu ("Which Player Object do you want to control?", game.player_objectlist_attribute, false) {
      game.pov = result
    }

  </script>

</command>

<command name="view_pov_command">

  <pattern>viewpov</pattern>

  <script>

    msg ("Current Game Pov: " + game.pov.name) // if you do/use 'game.pov' then you'll get an Object (hyperlink and etc) instead of just a string/text of its name

  </script>

</command>

Okay I think I almost have it, I got the template to change in a library using

But is it possible to do that from a script? in a verb?


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums