If you're familiar with hash tables (or map data structures in general) already, Common Data areas are essentially hash tables taking strings as input, that are accessible throughout all running scripts.
SetCommonData(key, value) will map the string
key to arbitrary
value, and
GetCommonData(key) pulls from the table. Using those functions uses the default Common Data area, which has the id "" (empty string). You can create more Areas for more tables; essentially there is just one overarching structure that is ultimately a hash table (that takes the area id string as key) of hash tables (the common data areas).
Each "object" also has its own table, which is what you access using Obj_SetValue / GetValue. But unlike Common Data which is engine-global, object values require the object IDs to access. Object IDs are indeed just integers.
Do not use Common Data to store individual object data; this is very bad practice due to their global nature.
I definitely agree there should be an empty object, but there isn't, so yes one thing to do would be to create a dummy Shot or Enemy object. Stuff like this is totally valid and doesn't seem to cause unwanted issues:
let bla = ObjShot_Create(OBJ_SHOT);
Obj_SetValue(bla, "_name", "ghost");
Obj_SetValue(bla, "_hp", 8);
Obj_SetValue(bla, "_attack", 2);
Obj_SetValue(bla, "_pos", [0,0]);
Primitive objects are most drawable objects that use texture and vertex information to be drawn. Sprites are Primitive objects with four vertices placed in a rectangle, but any number of vertices can be placed wherever. Its called Primitive because that's
what they're called in graphics. If you want to make complex graphics with many vertices, you use the primitive object functions.
There are a lot of predefined variables. I could list most of them but I don't know why you'd need a list of them in the first place; the documentation will list them when necessary.
remainder(a, b) is an alias for
a % b .
modc(a, b) is the same but retains the C-like behaviour of preserving sign. So -3 % 5 = 2 but modc(-3, 5) = -3.