With this snippet you should be able to quickly update to the 2.0 API
if inventory_armor == nil then
return
end
if player.character == nil then
return
end
local inventory_content = inventory_armor.get_contents()[1]
if inventory_content ~= nil
then
local armor_name = inventory_content.name
if armor_name == "light-armor"
or armor_name == "tiny-armor-mk1"
or armor_name == "pamk3-lvest"
or armor_name == "early-construction-light-armor"
then
player.character_build_distance_bonus = 3
player.character_item_drop_distance_bonus = 3
player.character_reach_distance_bonus = 3
player.character_resource_reach_distance_bonus = 1.3
player.character_crafting_speed_modifier = 0.10
player.character_mining_speed_modifier = 0.10
player.character_health_bonus = 10
elseif armor_name == "heavy-armor"
or armor_name == "tiny-armor-mk2"
or armor_name == "heavy-armor-2"
or armor_name == "heavy-armor-3"
or armor_name == "pamk3-hvest"
or armor_name == "early-construction-heavy-armor"
or armor_name == "Schall-engineering-suit-basic"
then
player.character_build_distance_bonus = 6
player.character_item_drop_distance_bonus = 6
player.character_reach_distance_bonus = 6
player.character_resource_reach_distance_bonus = 2.7
player.character_crafting_speed_modifier = 0.20
player.character_mining_speed_modifier = 0.20
player.character_health_bonus = 25
elseif armor_name == "modular-armor"
or armor_name == "Schall-engineering-suit"
then
player.character_build_distance_bonus = 9
player.character_item_drop_distance_bonus = 9
player.character_reach_distance_bonus = 9
player.character_resource_reach_distance_bonus = 5.4
player.character_crafting_speed_modifier = 0.40
player.character_mining_speed_modifier = 0.40
player.character_health_bonus = 50
elseif armor_name == "power-armor"
or armor_name == "se-thruster-suit"
or armor_name == "Schall-engineering-suit-mk1"
then
player.character_build_distance_bonus = 12
player.character_item_drop_distance_bonus = 12
player.character_reach_distance_bonus = 12
player.character_resource_reach_distance_bonus = 8.1
player.character_crafting_speed_modifier = 0.80
player.character_mining_speed_modifier = 0.80
player.character_health_bonus = 100
elseif armor_name == "power-armor-mk2"
or armor_name == "se-thruster-suit-2"
or armor_name == "Schall-engineering-suit-mk2"
then
player.character_build_distance_bonus = 15
player.character_item_drop_distance_bonus = 15
player.character_reach_distance_bonus = 15
player.character_resource_reach_distance_bonus = 10.8
player.character_crafting_speed_modifier = 1.6
player.character_mining_speed_modifier = 1.6
player.character_health_bonus = 150
elseif armor_name == "power-armor-mk3"
or armor_name == "bob-power-armor-mk3"
or armor_name == "se-thruster-suit-3"
or armor_name == "pamk3-pamk3"
or armor_name == "simply-power-armor-mk3"
or armor_name == "Schall-engineering-suit-mk3"
then
player.character_build_distance_bonus = 18
player.character_item_drop_distance_bonus = 18
player.character_reach_distance_bonus = 18
player.character_resource_reach_distance_bonus = 15.6
player.character_crafting_speed_modifier = 3.2
player.character_mining_speed_modifier = 3.2
player.character_health_bonus = 200
elseif armor_name == "power-armor-mk4"
or armor_name == "bob-power-armor-mk4"
or armor_name == "se-thruster-suit-4"
or armor_name == "pamk3-pamk4"
then
player.character_build_distance_bonus = 21
player.character_item_drop_distance_bonus = 21
player.character_reach_distance_bonus = 21
player.character_resource_reach_distance_bonus = 20.2
player.character_crafting_speed_modifier = 6.4
player.character_mining_speed_modifier = 6.4
player.character_health_bonus = 250
elseif armor_name == "bob-power-armor-mk5"
then
player.character_build_distance_bonus = 25
player.character_item_drop_distance_bonus = 25
player.character_reach_distance_bonus = 25
player.character_resource_reach_distance_bonus = 25
player.character_crafting_speed_modifier = 12.8
player.character_mining_speed_modifier = 12.8
player.character_health_bonus = 300
end
else -- no known armor, default range
player.character_build_distance_bonus = 0
player.character_item_drop_distance_bonus = 0
player.character_reach_distance_bonus = 0
player.character_resource_reach_distance_bonus = 0
player.character_crafting_speed_modifier = 0
player.character_mining_speed_modifier = 0
player.character_health_bonus = 0
end
end