Generally I recommend defining your objects in a single location as key/value pairs, and then using those object's keys to reference the original objects as needed.
(all of the following examples contain untested code)
1. Define your objects using key/value pairs, and use the object's key to reference it later.
<<set $potions to {
"hp-debut": {
"name": "potion de vie (grade inférieur)",
"description": "Une petite potion remontant de 100hp votre vie. ",
"hp": 100,
"mana": 0,
"atk": 0,
"atkm": 0,
"def": 0,
"defm": 0,
"agi": 0,
"vit": 0,
"prix": 50,
"nombre_joueur": 5,
"nombre_shop": 0,
},
"mp-debut": {
"name": "potion de mana (grade inférieur)",
"description": "Une petite potion remontant de 100mp votre mana. ",
"hp": 0,
"mana": 100,
"atk": 0,
"atkm": 0,
"def": 0,
"defm": 0,
"agi": 0,
"vit": 0,
"prix": 60,
"nombre_joueur": 5,
"nombre_shop": 0,
}
/* etc...*/
}>>
<<set $merchants to {
"itinerant-1": {
"name": "marchand itinérant Bob",
"or": 200,
/* assign potion keys */
"marchandises_musthave": ["hp-debut", "mp-debut"],
/* assign item keys */
"marchandises": ["bouclier-2", "epee-2", "wand-2", "arc-2"],
"nombre_must_have_min": 2,
"nombre_must_have_max": 10,
"nombre_item_min": 1,
"nombre_item_max": 2
}
}>>
2. Use the keys to lookup the orginal object definition as needed.
/* show a list of musthave potions for a specific merchant,
using temporary variables within a passage.
*/
<<set _merchant to $merchants["itinerant-1"]>>
<<set _musthave to _merchant["marchandises_musthave"]>>
<<for _key range _musthave>>
$potions[_key]["name"]
<</for>>
3. Use the key to update the original object definition.
<<set _key to _musthave[0]>>
<<set $potions[_key].nombre_shop += 1>>
notes:
1. you don't need to use as many temporary variables as my examples do, I am only using them to make it easier to see the referncing back to the original object definitions.
2. you may want define the 'potions' and other items within the same $items story variable.
3. If you have object definitions that don't change after they have first initialised then you make want to move then from story variables (which are stored in History & Saves) to the special setup object (which isn't)