Monday, August 1, 2011

r958 - New Main Menu Screen and ScriptArrow

  • Redid the main screen splitting up creating new saves, loading saves, and editing maps.
  • Loading into a file should always result in map editing and debug mode being disabled now.
  • Adds an arrow class for scripting.
    • int getInBlockID()
    • ScriptVec3 getInBlockCoords()
    • boolean getIsPlayersArrow()
    • void setIsPlayersArrow(boolean b)
    • ScriptEntity getOwner()
  • Can now get the entityID of entities in scripting (via .entityID) as well get entities by their ID with world.getEntityByID.


Demo script below for a world update that converts grass to stone when an arrow hits stone then sets it so the player can't pick them up.

for each (var entity in player.getEntitiesWithinRange(40))
{
if(entity.classType == "Arrow")
{
if(entity.isPlayersArrow && entity.inBlockID == 2)
{
blockCoord = entity.inBlockCoords
world.setBlockID(blockCoord.x, blockCoord.y, blockCoord.z, 1)
entity.isPlayersArrow = false
}
}
}


4 comments:

  1. While I know how to use redstone to do this already, I think it would be beneficial and space-saving to make a Trigger Once block (a Trigger block that only triggers once per F6). It would save time and space and piss me off less.

    ReplyDelete
  2. Use a Trigger Memory block. Once triggered it will keep it's target triggered until it has been reset either via F6 or death (if set to work that way) or another trigger resetting it.

    ReplyDelete
  3. I'm missing the "Back" button at the menus.
    But nice work.

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete