Updating Money Status Attribute

afehlbaum
30 Aug 2020, 00:59

Hello! I am a sociology professor who is trying to take a game I'd normally play using paper and make it virtual since I've been moved online due to the pandemic. It is a poverty and intersectionality simulation called "The Game of Social Life" by Kosha D. Bramesfeld. Students must strategize in order to get their character through stages of life.

In class, each person would get a character with a race, class, sex, sexuality, and socioeconomic status. There are 64 character options, but I am trying to start small and just aim for three so that I can figure out what I'm doing! I should note that I'm utilizing the web version because I'm using a Mac.

This is what I've done so far:
The student starts out in the room and the objects - money, wellness points, experience points, etc. - are explained. They enter their name and, in the process, are given a player number (1, 2, or 3 for now) at random. Once the player number is assigned, the game POV switches to that character and the student is given a certain amount of money credits as well as informed about their character's race, sex, sexuality, ability to vote, etc. I want the students to be able to see the information specific to them, so I set up a status attributes pane.

This is my game's start script:

msg ("Welcome to the Game of Social Life! ")
msg ("What is your name?")
get input {
player.alias = result
msg ("Hi, {player.alias}.")
msg ("This is your player number:")
player.number = GetRandomInt(1,3)
msg (player.number)
if (player.number=1) {
ChangePOV (one)
msg ("You are playing as a heterosexual man. Your family was originally from China, but are now naturalized citizens. You have a strong social support system. You can vote. You are part of the M and Q social groups.")
set (one, "money", 10)
set (one, "Bonus", 2)
}
else if (player.number=2) {
ChangePOV (two)
msg ("You are playing the game as a gay man. You are White (of European descent) and your family members are citizens by birth. You have a weak social support system. You can vote. You are part of the P social group.")
set (two, "money", 80)
set (two, "Bonus", 6)
}
else if (player.number=3) {
ChangePOV (three)
msg ("You are playing as a heterosexual woman. You are a recent immigrant from Iran who is not yet a citizen. English is not spoken in your home. You have a strong social support system. You cannot vote. You are part of the N, Q and S social groups.")
set (three, "money", 40)
set (three, "Bonus", 0)
}
msg ("The first thing you need to do is find a place to live. Press the down (South) arrow on the compass to the right to start!")
set (one, "statusattributes", NewStringDictionary())
dictionary add (one.statusattributes, "vote", "Vote: Yes")
dictionary add (one.statusattributes, "social groups", "Social Groups: M Q")
set (two, "statusattributes", NewStringDictionary())
dictionary add (two.statusattributes, "vote", "Vote: Yes")
dictionary add (two.statusattributes, "social groups", "Social Groups: P")
set (three, "statusattributes", NewStringDictionary())
dictionary add (three.statusattributes, "vote", "Vote: No")
dictionary add (three.statusattributes, "social groups", "Social Groups: N Q S")
}


I am satisfied that I am getting 1 of 3 characters assigned and that the information about the character's money, bonuses, vote, and social groups are all evident in the status attribute pane.

In the next room they choose which neighborhood they'd like to live in. I've attempted to set this up like a shop (following the directions here https://docs.textadventures.co.uk/quest/shop.html, and if I "Buy neighborhood A," it does say that the requisite of money credit was used and will not allow me to buy the neighborhood if the character doesn't have enough credits. BUT the status attribute pane is not updated.

I'm not sure what I need to do to make sure that the status attribute pane is updated. I do have the box checked for money (though I put ! credits as the value) under the player tab.

Any help would be very much appreciated. I very much wish I was in the classroom!


n b
06 Oct 2020, 22:38

are you using something like:

money = getInt(game.pov, "money")
money = money - 1
set (game.pov, "money", money)

or

DecreaseMoney (1)

to handle the money?


mrangel
07 Oct 2020, 00:08

The shop script you use linked uses player to refer to the player object. This will only work if the player object is named player.

It changes the money of the player objeect, even if the player is currently controlling the characters one, two, or three.

To make it work on a game which has multiple playable characters, you need to change all places in the code where it says player.to say game.pov. instead. (The attribute game.pov is used internally to refer to the object that the player is currently controlling).


mrangel
07 Oct 2020, 00:12

(This is why when I'm providing code samples on the forum, I always use game.pov. Because if my code works for the person I'm helping, but someone else finds the post later and uses it on a game with selectable player characters, I want it to still work. Using player in code is a bad habit to get into, and using it in libraries like that shop library is one place where it should certainly be done properly)


anhy123
04 Dec 2020, 07:38

Những lưu ý khi mua vé số miền Bắc để có giải thưởng cao nhất

Muốn có giải thưởng cao khi chơi xổ số kiến thiết miền Bắc các bạn cần lưu ý những điều chúng tôi chia sẻ ngay dưới đây, tham khảo ngay để có được niềm vui sau khi mua vé số.

Mua vé số tại các đại lý đăng ký bán vé

Có khá nhiều người khi chơi  XSTD ◀◀◀ CLICK đã mua phải vé số giả mạo, vé số không có giá trị lĩnh thưởng. Chúng tôi khuyên bạn nên tới các đại lý bán vé số có địa chỉ rõ ràng để mua được vé số hợp lệ. Không nên mua vé số MB ở vệ đường hay những người bán vé mà bạn cảm thấy nghi ngờ.

Vé số MB cần đúng đài, chưa tới ngày quay thưởng

Khi mua vé số truyền thống miền Bắc hay bất cứ của miền nào các bạn cần phải mua vé số đúng đài, chưa tới ngày quay thưởng. Chẳng hạn như ngày mùng 6/8 tức thứ 6 do đài Hải Phòng quay thưởng thì các bạn phải mua vé số của đài Hải Phòng. Lịch mở thưởng của các đài miền Bắc từ thứ 2 tới chủ nhật diễn ra như sau:

Thứ 2 có đài: Hà Nội

Thứ 3 có đài: Quảng NInh

Thứ 4 có đài: Bắc Ninh

Thứ 5 có đài: Thủ Đô (Hà Nội)

Thứ 6 có đài: Hải Phòng

Thứ 7 có đài: Nam Định

Chủ nhật có đài: Thái Bình

68bb3e588ba56452a9d72c5b39efa09e.jpg (235×192)

Mua vé số MB cần lưu ý điều gì

Mua vé số miền Bắc mất bao nhiêu tiền, mỗi người được mua mấy vé

Xổ số kiến thiết miền Bắc có mệnh giá là 10 ngàn đồng, người chơi SXMB ◀◀◀ BẤM XEM mua một hoặc nhiều tấm vé số đều được. Trên mỗi tấm vé số đều có dãy số in sẵn, các bạn chọn cho mình một dãy số yêu thích nhất và chờ tới giờ quay thưởng để đọ số. Nếu may mắn các bạn nhận được rất nhiều giải thưởng từ nhỏ tới lớn từ vài chục ngàn tới cả vài trăm triệu đồng tiền thưởng.

Trúng số miền Bắc nhận thưởng ở đâu, cần mang theo loại giấy tờ gì

Nếu may mắn trúng số miền Bắc các bạn liên hệ ngay tới các đại lý để đổi thưởng. Đối với những giải thưởng lớn thì người chơi gọi điện thẳng tới công ty xổ số kiến thiết phát hành tấm vé đó có in địa chỉ, số điện thoại ở mặt sau. Khách hàng tới nhận giải cần mang theo các loại giấy tờ tùy thân để chứng minh nhân thân.

db98175e66909b872f7dae32ca7f60f3.jpg (235×192)

Trúng số miền Bắc có mất phí đổi thưởng hay không

Nhận thưởng có phải nộp thuế và vé số đổi thưởng cần những yêu cầu gì

Khi nhận thưởng với mức giải nhỏ hơn 10 triệu đồng thì các bạn không cần phải nộp bất cứ loại tiền gì, tức người chơi  Xo so mien bac ◀◀◀ TẠI ĐÂY sẽ nhận nguyên giá trị giải. Đối với những giải lớn hơn 10 triệu đồng thì các bạn nộp 10% thuế thu nhập cá nhân cho nhà nước. Vé số hợp lệ cần đúng ngày, chưa hết hạn và không rách góc, tẩy xóa…