![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | 9BitStrider |
Okay, I have all the global values for weapon energy stored within a dictionary. What I WANT to do is add energy to those values when the player grabs a weapon energy pickup.
if wpn_en > 0 and heal_delay == 1:
var wpn_name = {
1 : global.rp_coil[int($player.swap) + 1],
2 : global.rp_jet[int($player.swap) + 1],
3 : global.weapon1[int($player.swap) + 1],
4 : global.weapon2[int($player.swap) + 1],
5 : global.weapon3[int($player.swap) + 1],
6 : global.weapon4[int($player.swap) + 1],
7 : global.weapon5[int($player.swap) + 1],
8 : global.weapon6[int($player.swap) + 1],
9 : global.weapon7[int($player.swap) + 1],
10 : global.weapon8[int($player.swap) + 1],
11 : global.beat[int($player.swap) + 1],
12 : global.tango[int($player.swap) + 1],
13 : global.reggae[int($player.swap) + 1]
}
if global.player_weap[int($player.swap)] > 0 and global.player_weap[int($player.swap)] < 11:
id = global.player_weap[int($player.swap)]
else:
id = global.player_weap[int($player.swap)] + global.player
wpn_name[id] += 10
wpn_en -= 10
The way I have this above, the value isn’t added properly and the global value isn’t updated. How would I be able to accomplish this?