Twine Version: Sugarcube 2.36.1
Hello,
i am currently working on a game in the style of an escape room. in the game you should be able to collect small tractors as collectibles. the navigation is done via an html map. Now I want to add the tractor to the inventory when you click on it. at the same time I want the image to change so that the tractor is not in the image. for this I have two different images. the inventory I have defined as a simple array. Here is my code:
<<if $inventory.includes('traktorSZ2-9-3')>>`Preformatted text`
<img usemap="#image-map" alt="" @src="setup.ImagePath+'szenario2/9-3-OT.jpg'" style = 'height: 100%; width: 100%; object-fit:contain'>
<map name="image-map">
<area
alt="Zurück" title="Zurück"
coords="19,2857,5981,3365" shape="rect">
<area alt="Dokument"
title="Dokument"
coords="3819,2025,3914,2040,4047,1436,3564,1415,3379,1362,3130,1124,3077,1092,3003,1166,2796,1420,2706,1585,2992,1733,3310,1675,3543,1659,3713,1654,3920,1744,3898,1871,3888,1940" shape="poly">
</map>
<<else>>\
<img usemap="#image-map" alt="" @src="setup.ImagePath+'szenario2/9-3-MT.jpg'" style = 'height: 100%; width: 100%; object-fit:contain'>
<map name="image-map">
<area
alt="Zurück"
title="Zurück"
coords="24,2910,5997,3371"
shape="rect">
<area
data-passage = "SZ2-9-3-T"
onclick="$.wiki( '<<run $inventory.push( 'traktorSZ2-9-3' )>>\ ')"
alt="Traktor"
title="Traktor"
coords="1529,2629,1794,2565,1821,2480,1757,2411,1709,2358,1587,2422,1434,2491"
shape="poly">
<area
alt="Dokument"
title="Dokument"
coords="2642,1632,3013,1165,3999,1494,3829,2098,3819,1807,3728,1785,3655,1680,3591,1717,3469,1696,3374,1738,3215,1722,3072,1775,2918,1744"
shape="poly">
</map>
<</if>>
in my eyes the onclick event is the error but i don’t know why
Now i get the following error message:
An error occurred. You may be able to continue, but some parts may not working properly.
Error: missing = after argument list.
Stack trace:
Syntax Error: missing ) after argument list
and sorry for formatting