Attribute setting on quest web with initialization script not working.

xXLarryTFVWXx
18 Sept 2018, 20:03

Hey, I'm new here.

I'm trying to make a character creation on the web version, I read somewhere on here (forgot where [tee hee]) that I'm supposed to use an initialization script to set the custom attributes before letting the player change them.

Everytime I try playing it this is what I get:
"Error running script: Cannot change name of element when not in Edit mode"

Here is the script :

set (You, "weight", 0)
set (You, "age", 000)
set (You, "name", "")




Will someone please tell me what I'm doing wrong?


thanks!


mrangel
18 Sept 2018, 20:07

Which attribute are you trying to set?

Is it name?

The name attribute special. It cannot be changed. This is the name that you use to refer to the object in scripts.
The name that the player sees is stored in the alias attribute, and you can change this one.


xXLarryTFVWXx
18 Sept 2018, 20:11

Okay, thank you!


hegemonkhan
19 Sept 2018, 04:35

to add more:

the 'name' String Attribute is the ID for quest's Objects, so these must be unique and can't be changed once created (during game play) --- you can rename stuff outside of the game play (in the GUI/Editor and/or directly in-code), just remember if you rename stuff, then any other code that has those name instances, needs to be updated/changed to the new name you're using for what ever the Objects


so this is causing the issue:

set (You, "name", "")

as mrangel said, use the 'alias' String Attribute as this is what its for:

set (You, "alias", "")

also change this:

set (You, "age", 000)

to this:

set (You, "age", 0)

as it's just going to do this anyways, or throw an error