- Pointer typechecks are now enabled by default.
- enabled all script warnings for non-FULL or DEMO builds by default
- Added generic obj_* functions that operate on any type of RenderObject.
These give quite low-level control about the renderer, and are quite
dangerous too.
Subsequently, many functions sharing the same code (*_setPosition, for example)
could be removed, and simply call the generic functions after a type check.
- Added interface function deathNotify(). The original logic of death
notifiers was never used, so i thought i'd make use of it.
This is useful in scripts to safely drop dangling pointers.
- removed sendEntityMessage, entity_setCollideWithAvatar, entity_setTouchDamage,
which were essentially no-ops.
- Replaced all unnecessary luaReturnNum(0) and luaReturnInt(0),
now it does only push a return value on the stack if the function
is actually supposed to have a retun value.
- Allow variadic calling of entity_msg(). Now any parameters can be passed
to the function, and the target entity will receive all of them.
Any values returned from the entity's msg() callback will be returned
by entity_msg() to the original caller. This allows nice RPC-like
entity communication.
- fixed possible crash in debugLog, bone_update, entity_debugText
- added an override function for loadfile() that is case-insensitive like dofile()
- entity_createEntity returns the created entity now
- spawnParticleEffect returns the associated RenderObject
- Added some text rendering functions
- Added beam_setFirer()
- removed the underflow check in avatar_decrLeaches() I added earlier
- added a panic function for Lua.
- added the Lua debug library
- fixed a stupid typo in ScriptObject::isType() that made the type checks a lot less accurate
- misc stuff I forgot
- Finetuned default distance by aspect ratio
- Added a hack to allow entity_sound() to use freq values around 1000 instead of changing all related scripts
- Changed anglerfish bite pitch, 40% only sounds awkward
- restored leach.lua 1.1.1 compatibility (entity_*TargetLeaches still works)
- fixed possible script warning when picking up a collectible
- made energy bariers ignore damage
== Script interface changes: ==
Removed entity_setClampOnSwitchDir(), which was a no-op.
Added entity_getFlag() function, for fairness, as nodes already have one.
Added node_getLabel() function, which does not return the _full_ node string, but only the first part before parameters.
dofile() supports relative paths now, and it is no longer necessary to use appendUserDataPath() + full path from a mod.
entity_color() does now support all interpolation functions that similar vector-manipulation functions support (loop, ping-pong, ease).
added entity_getVel() function (an entity_setVel() can be emulated with entity_clearVel(), followed by entity_addVel()).
*_getNearestNode() and *_getNearestEntity() allow an optional ignore parameter.
node_getNearestNode() allowed to specify a node to exclude from the search,
the others not -- now the interface is more consistent.
Deprecated entity_[incr/decr]TargetLeaches(entity) - the attached leach amount was never handled
by any entity other than Naija. Replaced them with avatar_[incr/decr]Leaches(), but kept the old
ames for now, too. Should be removed in a while.
== Script interface & related fixes: ==
Added bool loudScriptErrors to control displaying script syntax error and global variable usage warnings.
So far, syntax errors always went do debugLog(), but it is less time consuming when writing scripts
to have them displayed right away.
*_getNearestNode now scan by label, and not full name.
This allows searching for nodes but ignoring its parameters. The original game scripts never search
for nodes that have parameters, so this does not break anything,
but allows modding without an exploding amount of specialized node scripts.
entity_setBoneLock() failed for certain entites with throwLuaErrors=true,
allowing to burst through them (gears, grouper, big mithalas jelly, probably more).
Removed unnecessary int-casts in entity_setHealth(), entity_changeHealth(), and a few others,
which truncated float fractional parts.
Fixed possible crashes in many functions due to missing NULL-pointer checks,
if wrong data were passed to Lua.
Optimized entity_getNearestEntity() a little - do nocasecmp() after checking all other params
UPPERCASE global variables as used in mod include files are now tolerated, even with all warnings on.
This makes sense because it was impossible to include a custom flags definition file
(which _must_ have globals, otherwise the including scripts won't see them) in a mod without beeing buried in spam.
They won't change, or clobber any states, and UPPERCASE sort of implies a constant/#define, imho.
Added better control over warnings about not-existing files. map_*.lua and premap_*.lua files are optional,
and no warning should be given if they do not exist. Missing Entity scripts and mod-init.lua must be
warned about, however.
Fixed a crash in global variable access warning (NULL pushed into std::ostringstream)
Fixed 2 random warnings i found in scrips
== Misc stuff: ==
Related to the changes above, cleaned out unused variables from the Entity class,
and removed the code that had to do with them somehow. Some parts of the removed code
were still in use, although totally unnecessary.
Saves a few bytes of memory per entity, and less code that can cause headache.