Following Tutorial, but it isn't working

BigPun
Okay, so I've followed the tutorial to a 't' since I began. I am currently dealing with the turn counter and it just isn't working, but I have done it exactly as was instructed.

So, it tells me to set up the "turns" attribute.

I do these things:

Find the "player" inside the room that was initially created. I go to the Attributes tab, at the bottom, and add an attribute called "turns." I then make it an integer (its default was string).

So then I go to the "status attribute" at the top of the attribute tab and I added another, and called it "turns" as per the instructions.

So then it created a "statusattribute turns= " and then underneath that I can see "turns 0"

This is the exact same as the tutorial. Both are "source" - "player".

It then tells me to launch the game, and I'm supposed to see "turns" on the right-hand side. . . I do not. So I perform some actions. . . many actions, but nothing is there. I see Inventory, objects, compass in that order from top-bottom.

So I delete everything and start over again. Same outcome.

I went ahead and created the turn script, as it instructed in the tutorial, even though I saw nothing on the right pane. I made it a global turn script, and it simply says "player.turns" -- "player.turns + 1". I did that thinking it would force the pane to appear, but it didn't.

So I then went to "game" and then to the "player" tab. I added the attributes there.

And it worked! Initially, it had two sets of "Turns=0" and then right under that it said "turns" . . . So I went through the attributes and deleted them until I deleted the one that created the "turns" without an integer value to the right of it, so then I was left with "Turns=0". . . . but, even with the global turn script. . . that number WILL not change.

So I deleted it all and tried it again using the "player" that was created initially. I even tried tweaking the player by having it able to be taken over by player, etc. . . but none of that works.

What am I doing wrong???

jaynabonne
Things have changed a bit since the tutorial was created. You can find the status attributes setup if you select the "game" object and then the "Player" tab. Add the attribute there. (Internally, there is a dictionary on the game object named "povstatusattributes". This is change from earlier code as well.)

BigPun
jaynabonne wrote:Things have changed a bit since the tutorial was created. You can find the status attributes setup if you select the "game" object and then the "Player" tab. Add the attribute there. (Internally, there is a dictionary on the game object named "povstatusattributes". This is change from earlier code as well.)


Okay, awesome. Well, I think I deleted the pov thing. . maybe not. I might have when I was deleting those statusattributes from the game - player - attribute page when I was testing. . .I will say, it makes a lot more sense having something like an 'always-there' thing in a global position versus one just following someone around.

But, there's another issue -- the turn script.

When I had set the attribute up in the 'game - player - attribute', it doesn't change when I do anything -- the number on the right of the quest screen doesn't change from 0.

I have a global turn script created that sets variable player.turns -- expression -- player.turns + 1.

Do you have any idea about that and why it isn't working?

BigPun
Okay, so now I'm doubly confused here. I went back, added the 'statusattribute' turns as a string dictionary and it auto-added povstatusattribute turns=

So then, as per instructions, I added the turns attribute at the bottom and set it as an integer.

So I test it and yet it again it showed two - Turns: 0, Turns: 0

So I deleted the integer value, then it had turns, Turns: 0

So I deleted the statusattribute that I added, and now it's there and the script even works.

??? Why?

jaynabonne
It looks like you can specify status attributes in either the game's Player tab (new way?) or in a statusattributes dictionary (old way?). I must confess I don't have much experience with status attributes, so I don't know what the difference is. But it does seem that you get all the attributes specified in either place. So if you put "turns" in both place, it will show up twice. As to why it's working now? I don't know. :) I was going to say be sure your turn script is enabled by default, but if it's working now, then it must be.

The Pixie
When I have done status attributes I have done them on the player object. Through the GUI, on the Attribute tab, click add. Type the name of the attribute, "turn", then type the text to see. Looks like you want "Turns=!" (without quotes). The exclamation mark will be replaced with the actual number.

In your turn script, you should have this:
game.turn = game.turn + 1

Check that your turn script is "Enabled when the game begins"

Also, make sure you have an attribute called "turn" on the game object, and that it is an integer.

You can also set up status attributes for the player object, but in this case the "turn" attribute is on the "game" object, so you have to do it there.

HegemonKhan
I think the problem for him~her, might be the difference in tabs~locations between having the Player Object as active~controlled vs inactive~uncontrolled (ChangePov), much like the two locations for the 'descriptions', one for when the Player Object is active and one for when the Player Object is inactive (as a 'non-player' Object in effect).

He~she may also have to set the Player Object as the 'pov' too under the Game Object, for the 'statusattributes' to work, not sure if it'll work with leaving it non~pov'ed (defaulted 'player' Player Object).

or, he has to turn on the tabs, if they're not there, too.

lastly, he~she may not be matching up the 'turns' Integer Attribute: between Object attached to and referenced in the 'statusattribute', ie:

<game name="xxx">
-> <attr name="turns" type="int">0</attr>
</game>

<object name="player">
-> <statusattributes type="simplestringdictionary">player.turns = Turns: !</statusattributes>
</object>

or vice verse:

<game name="xxx">
</game>

<object name="player">
-> <statusattributes type="simplestringdictionary">game.turns = Turns: !</statusattributes>
-> <attr name="turns" type="int">0</attr>
</object>

or...

maybe he~she didn't set the 'turns' Attribute as an Integer Attribute, it might be set as a String Attribute, which is a 'why' for it not increasing, or he~she is just missing the script for making it increase too.

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

Support

Forums