Sunday, May 29, 2011

r719 - Scripting Additions

Today I've been playing a lot of Witcher 2 so haven't made much progress on the new map editing tools.  Instead this evening I decided to work on adding a bunch of scripting features.  The new map editing is disabled in this version since its not quite ready (should be hopefully by Monday evening).

  • Changing setBlockMetadata to setMetadata and setBlockIdAndMetadata to setBlockIDAndMetadata
  • Needed to store the damage for store blocks
  • Player name can be set from the world config screen
  • Disabled downloading of player skins and cloaks
  • Can set/remove cloak texture on the player via getCloak/setCloak/removeCloak
  • Adding to effect
    • getOverlay
    • getReplaceTexture which returns the replacement for a specified texture
  • Fixing returning of items with itemID of 0 to instead return undefined
  • When items are used AC will try to execute a script called item_%d.js (%d is the itemID) or for items with subtypes item_%d_%d.js (the second %d is the "damage")
    • lastItemUsed will contain the item that just got used (make note if its the offhand then the items have been swapped so you will want to always treat the item like its in the main hand during this scripts execution)
    • Scripts execute after the main code executes
  • Dye is now in the palette
  • Adds swingMainHand and swingOffHand to the player
  • Adds getClassType to ScriptEntity which returns a string of what type of class this entity is
Edit: Seems r719 has a bug with tile entities not being loaded correctly in the obfuscated version.


  1. I'm having the problem that my selections for triggers are being reset, wasn't getting this before so maybe its some of the code in this update?
    I haven't changed anything else.
    and I'm not sure how to revert version, otherwise I would have tried that.

  2. Yeah all tile entities are messed up. Rolling back the update code to point to r700.

  3. Cryect, my Amnesia map will have to be cancelled if the triggers cant go back to how they were...

    Doing it manually would take a VERY awfully long time, (days!)

    Is there any way to get them back to how they were :(...