So im trying to make an armor system work where you’d equip something and it would be added to your character, but unfortunately when i do my macro to show the list of what you can equip, it only shows the most recent one that is pushed into your inventory!
here is the for macro function im doing to select your equipment
<<nobr>>
<<for _i, _item range $head>>
<<if _item.gear>>
<<print "'' _item.gear''" +"'':''">><br>
<<print _item.details.description>><br>
<<if _item.details.equipped is false>>
<<link "Equip" "testpassage">>
<<set _item.details.equipped to true>>
<<print _item.details.stats>>
<</link>>
<<else>>
<<link "Remove" "testpassage">>
<<set _item.details.equipped to false>>
<<print _item.details.undostats>>
<</link>>
<</if>>
<</if>>
<</for>>
<</nobr>>
here are the push and set functions that lead up to it,
<<set $head to ({
gear: "",
details: {
equipped: "",
description: "",
stats: "",
undostats: ""
}
})>>
<<set $head.push to ({
gear: "Leather Cap",
details: {
equipped: false,
description: "A gift from side character A",
stats: "<<set $armor +=1>>",
undostats: "<<set $armor -=1>>"
}
})>>
<<set $head.push to ({
gear: "Leather Cap the sequel",
details: {
equipped: false,
description: "A gift from side character B",
stats: "<<set $armor +=1>>",
undostats: "<<set $armor -=1>>"
}
})>>
when i test the program, it only shows “leather cap the sequel” “A gift from side character B” and the button to equip it, but it doesnt show the first leather cap or anything about it!