0 votes
ago by (230 points)

I need to know how it is called when "you put many variables inside another one", for example like this:

<<set $Enemy ={ name:"Small Spawn",hp:10,mhp:10,mp:1,mmp:1,lu:0,mlu:1,

So now I would be able to simply call one of those by writing:

Health: $Enemy.hp/$Enemy.mhp

I need to do the same thing in python so I need to know the proper name in order to search for it, thanks.


1 Answer

+1 vote
ago by (144k points)
selected ago by
Best answer

The value that appears after the equals sign within your <<set>> is known as a Generic Object literal in JavaScript.

Python has a data-type known as a Dictionary, which behaves in a simular way.

ago by (35.5k points)

These links may also help:

W3Schools - "JavaScript Objects" (general info) & "JavaScript Objects" (specific info)

MDN - "JavaScript object basics"

Also, just to be clear, there are lots of different specific types of objects in JavaScript, such as arrays, but as greyelf said, what you're asking about is the general or generic object type.

Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.