Saturday, July 30, 2011

r951 - Entity Spawning and Models from Scripts

  • Fixed pathToEntity (curses for no one telling me it didn't work).
  • Can spawn entities in scripts via world.spawnEntity(entityType, x, y, z).
    • Current types you can spawn : Arrow, Snowball, Item, Painting, Creeper, Skeleton, Spider, Giant, Zombie, Slime, Ghast, PigZombie, Pig, Sheep, Cow, Chicken, Squid, Wolf, PrimedTnt, FallingSand, Minecart, Boat, Egg, Fireball, FishingRod, SkeletonSword, SkeletonBoss, Bat, Rat, NPC, SkeletonRifle, SkeletonShotgun, ZombiePistol, Bomb, Boomerang, Bomb Arrow, Hookshot, and Script
  • UIContainer, UIRect, and UISprite changed to allow floating point numbers for position and height.
  • Can now create models in scripts via the Model Class 
    • addBox(String boxName, float offsetX, float offsetY, float offsetZ, int width, int height, int depth, int u, int v)
    • addBoxExpanded(String boxName, float offsetX, float offsetY, float offsetZ, int width, int height, int depth, int u, int v, float expand)
    • setPosition(double newX, double newY, double newZ) - Sets the previous position as well so it won't lerp between the old and new
    • moveTo(double newX, double newY, double newZ) - Sets just the current position so it will lerp over a tick
    • moveBy(double moveX, double moveY, double moveZ) - Moves the model taking into account the rotation.
    • setRotation(float newYaw, float newPitch, float newRoll)
    • rotateTo(float newYaw, float newPitch, float newRoll)
    • rotateBy(float rYaw, float rPitch, float rRoll)
    • removeFromRendering() - Stops the model from rendering
    • addToRendering() - Adds the model for rendering
  • Undo/Redo stack saves the cursor now.

9 comments:

  1. Aw. My map didn't make it. Oh well. Next update. XD

    ReplyDelete
  2. The map updates are actually completely separate from code updates. Basically for the maps the clients download this file http://adventurecraft.org/cgi-bin/mapData2.py which has all the info about the maps.

    ReplyDelete
  3. Ah. I withdraw my comment, then. XP

    ReplyDelete
  4. I think you need to add something to let the NPC's move, they are boring sitting in one spot. This would be cooler for Role Playing maps with towns and cities. Sorry for being off topic....

    ReplyDelete
  5. You already can move npcs it just requires scripting (really easy scripting as well).

    ReplyDelete
  6. I are new sorry, i will figure it out... DERP.

    ReplyDelete
  7. Yeah. I'm in the process of making unique NPC paths. If I can do it, I'm sure many others can. :P

    ReplyDelete
  8. Cryect! I am sure that this was done very long time ago and someone complained earlier but my map is based on cooking/smelting and furnace does not work correctly

    ReplyDelete
  9. Can you spawn a scripted entity via world.spawnEntity(entityType,x,y,z)
    from the entitys folder with the entity.txts if so how must it be written. Ive tried many many different ways! Thank you!

    ReplyDelete