Can't change the pov_look attribute
misquito
23 Apr 2023, 04:55My script is:
msg ("The hot water streams over your face, as you scrub off last night's battle.")
set (player, pov_look, "You feel refreshed.")
The error I get is:
Error running script: Error compiling expression 'pov_look': Unknown object or variable 'pov_look'
But my player comes with the attribute pov_look. I don't understand why it can't find that attribute.
mrangel
23 Apr 2023, 13:58You're trying to set an attribute whose name is stored in a variable called pov_look
. If you just want to change the pov_look attribute, you would do:
player.pov_look = "You feel refreshed."
orset (player, "pov_look", "You feel refreshed.")
However, I'm not sure if this is what you actually want. From the code snippet you presented, it seems more like you want to change the look
attribute of the player. Unless player
is not the current player object, and you're going to change POV to it later.
Ip Man
10 May 2023, 03:13Is this a function you're making? Those look like parameters with the commas in quotes. So the "set" function would need to be expecting 3 parameters in order for your 3 to be understood in some fashion.
The first one mr. angel shared is a simple change of the attribute that looks familiar to me. I've used that often. But I'm only just starting to look into how to make a complicated function. Trying to do something that can modify integer attributes using a formula.
It "works" in that there are no errors, but so far it appears to do nothing, rather than doing what I'd like.