Ok, so I want to add six status attributes, but when I try only the last one shows up. This is how I coded it:
set (player, "Agility", 10)
set (player, "statusattributes", NewStringDictionary())
dictionary add (player.statusattributes, "Agility", "Agility: !")
set (player, "Strength", 10)
set (player, "statusattributes", NewStringDictionary())
dictionary add (player.statusattributes, "Strength", "Strength: !")
set (player, "Speed", 10)
set (player, "statusattributes", NewStringDictionary())
dictionary add (player.statusattributes, "Speed", "Speed: !")
set (player, "Intelligence", 10)
set (player, "statusattributes", NewStringDictionary())
dictionary add (player.statusattributes, "Intelligence", "Intelligence: !")
set (player, "Thirst", 100)
set (player, "statusattributes", NewStringDictionary())
dictionary add (player.statusattributes, "Thirst", "Thirst: !")
set (player, "Hunger", 100)
set (player, "statusattributes", NewStringDictionary())
dictionary add (player.statusattributes, "Hunger", "Hunger: !")
}
Going line-by-line through that code, here's what you're doing:
set (player, "Agility", 10)
- Create a stat called 'Agility' and set it to 10set (player, "statusattributes", NewStringDictionary())
- Make a blank dictionary to hold the status attributesdictionary add (player.statusattributes, "Agility", "Agility: !")
- Add Agility to that dictionaryset (player, "Strength", 10)
- Create a stat called 'Strength' and set it to 10set (player, "statusattributes", NewStringDictionary())
- Make a blank dictionary to hold the status attributesdictionary add (player.statusattributes, "Strength", "Strength: !")
- Add Strength to that dictionaryset (player, "Speed", 10)
- Create a stat called 'Speed' and set it to 10set (player, "statusattributes", NewStringDictionary())
- Make a blank dictionary to hold the status attributesdictionary add (player.statusattributes, "Speed", "Speed: !")
- Add Speed to that dictionaryset (player, "Intelligence", 10)
- Create a stat called 'Intelligence' and set it to 10set (player, "statusattributes", NewStringDictionary())
- Make a blank dictionary to hold the status attributesdictionary add (player.statusattributes, "Intelligence", "Intelligence: !")
- Add Intelligence to that dictionaryset (player, "Thirst", 100)
- Create a stat called 'Thirst' and set it to 100set (player, "statusattributes", NewStringDictionary())
- Make a blank dictionary to hold the status attributesdictionary add (player.statusattributes, "Thirst", "Thirst: !")
- Add Thirst to that dictionaryset (player, "Hunger", 100)
- Create a stat called 'Hunger' and set it to 100set (player, "statusattributes", NewStringDictionary())
- Make a blank dictionary to hold the status attributesdictionary add (player.statusattributes, "Hunger", "Hunger: !")
- Add Hunger to that dictionaryIf you're copying and pasting code that you've been given, it's a good idea to try to understand what each line does. In this case, you just need to make sure that the NewStringDictionary line only occurs once. But hopefully if you can understand how the code works, you won't run into similar probalems so often in future.