Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | potatobanana |
how to transfer data from dictionary to another?
for now ,i do like this, if player get 1 traits. it geting long and long. how should i make it bit short?
PlayerGlobalStat.player_data["strength"].Stats_traits = ImportData.traits_data[str(1)].strength
PlayerGlobalStat.player_data["constitution"].Stats_traits = ImportData.traits_data[str(1)].constitution
PlayerGlobalStat.player_data["intelligence"].Stats_traits = ImportData.traits_data[str(1)].intelligence
PlayerGlobalStat.player_data["wisdom"].Stats_traits = ImportData.traits_data[str(1)].wisdom
PlayerGlobalStat.player_data["dexterity"].Stats_traits = ImportData.traits_data[str(1)].dexterity
PlayerGlobalStat.player_data["agility"].Stats_traits = ImportData.traits_data[str(1].agility
here player stats Dictionary:
{
"level": {
"Stats_base": 1,
"Stats_item": 0,
"Stats_traits": 0
},
"current_exp": {
"Stats_base": 0,
"Stats_item": 0,
"Stats_traits": 0
},
"next_lvl_exp": {
"Stats_base": 100,
"Stats_item": 0,
"Stats_traits": 0
},
"strength": {
"Stats_base": 0,
"Stats_item": 0,
"Stats_traits": 0
},
"constitution": {
"Stats_base": 0,
"Stats_item": 0,
"Stats_traits": 0
},
"intelligence": {
"Stats_base": 0,
"Stats_item": 0,
"Stats_traits": 0
},
"wisdom": {
"Stats_base": 0,
"Stats_item": 0,
"Stats_traits": 0
},
"dexterity": {
"Stats_base": 0,
"Stats_item": 0,
"Stats_traits": 0
},
"agility": {
"Stats_base": 0,
"Stats_item": 0,
"Stats_traits": 0
}
}
player traits Dictionary:
{
"1": {
"traits_name": "smart",
"traits_discription": "int+5,wis+1",
"strength": 0,
"constitution": 0,
"intelligence": 5,
"wisdom": 1,
"dexterity": 0,
"agility": 0
},
"2": {
"traits_name": "lazzy",
"traits_discription": "max_stamina - 30, cratf_speed +50%,item quality - 50",
"strength": 0,
"constitution": 0,
"intelligence": 0,
"wisdom": 0,
"dexterity": 0,
"agility": 0
},
"3": {
"traits_name": "stupid",
"traits_discription": "wis-5, int-5, def +10,dmg +10",
"strength": 0,
"constitution": 0,
"intelligence": -5,
"wisdom": -5,
"dexterity": 0,
"agility": 0
},
"4": {
"traits_name": "slowpoke",
"traits_discription": "move_speed - 30, accuracy + 70,skill_cd + 20%",
"strength": 0,
"constitution": 0,
"intelligence": 0,
"wisdom": 0,
"dexterity": 0,
"agility": 0
},
"5": {
"traits_name": "crazy",
"traits_discription": "def-10, luck+15, wisdom - 5",
"strength": 0,
"constitution": 0,
"intelligence": 0,
"wisdom": -5,
"dexterity": 0,
"agility": 0
}
}