use of com.simibubi.create.foundation.ponder.Selection in project Create by Creators-of-Create.
the class DebugScenes method controlsScene.
public static void controlsScene(SceneBuilder scene, SceneBuildingUtil util) {
scene.title("debug_controls", "Basic player interaction");
scene.showBasePlate();
scene.idle(10);
scene.world.showSection(util.select.layer(1), Direction.DOWN);
scene.idle(4);
scene.world.showSection(util.select.layer(2), Direction.DOWN);
scene.idle(4);
scene.world.showSection(util.select.layer(3), Direction.DOWN);
scene.idle(10);
BlockPos shaftPos = util.grid.at(3, 1, 1);
Selection shaftSelection = util.select.position(shaftPos);
scene.overlay.showControls(new InputWindowElement(util.vector.topOf(shaftPos), Pointing.DOWN).rightClick().whileSneaking().withWrench(), 40);
scene.idle(20);
scene.world.replaceBlocks(shaftSelection, AllBlocks.SHAFT.getDefaultState(), true);
scene.idle(20);
scene.world.hideSection(shaftSelection, Direction.UP);
scene.idle(20);
scene.overlay.showControls(new InputWindowElement(util.vector.of(1, 4.5, 3.5), Pointing.LEFT).rightClick().withItem(new ItemStack(Blocks.POLISHED_ANDESITE)), 20);
scene.world.showSection(util.select.layer(4), Direction.DOWN);
scene.idle(40);
BlockPos chassis = util.grid.at(1, 1, 3);
Vec3 chassisSurface = util.vector.blockSurface(chassis, Direction.NORTH);
Object chassisValueBoxHighlight = new Object();
Object chassisEffectHighlight = new Object();
AABB point = new AABB(chassisSurface, chassisSurface);
AABB expanded = point.inflate(1 / 4f, 1 / 4f, 1 / 16f);
Selection singleBlock = util.select.position(1, 2, 3);
Selection twoBlocks = util.select.fromTo(1, 2, 3, 1, 3, 3);
Selection threeBlocks = util.select.fromTo(1, 2, 3, 1, 4, 3);
Selection singleRow = util.select.fromTo(1, 2, 3, 3, 2, 3);
Selection twoRows = util.select.fromTo(1, 2, 3, 3, 3, 3);
Selection threeRows = twoRows.copy().add(threeBlocks);
scene.overlay.chaseBoundingBoxOutline(PonderPalette.GREEN, chassisValueBoxHighlight, point, 1);
scene.idle(1);
scene.overlay.chaseBoundingBoxOutline(PonderPalette.GREEN, chassisValueBoxHighlight, expanded, 120);
scene.overlay.showControls(new InputWindowElement(chassisSurface, Pointing.UP).scroll().withWrench(), 40);
PonderPalette white = PonderPalette.WHITE;
scene.overlay.showOutline(white, chassisEffectHighlight, singleBlock, 10);
scene.idle(10);
scene.overlay.showOutline(white, chassisEffectHighlight, twoBlocks, 10);
scene.idle(10);
scene.overlay.showOutline(white, chassisEffectHighlight, threeBlocks, 10);
scene.idle(10);
scene.overlay.showOutline(white, chassisEffectHighlight, twoBlocks, 10);
scene.idle(10);
scene.overlay.showOutline(white, chassisEffectHighlight, singleBlock, 10);
scene.idle(10);
scene.idle(30);
scene.overlay.showControls(new InputWindowElement(chassisSurface, Pointing.UP).whileCTRL().scroll().withWrench(), 40);
scene.overlay.showOutline(white, chassisEffectHighlight, singleRow, 10);
scene.idle(10);
scene.overlay.showOutline(white, chassisEffectHighlight, twoRows, 10);
scene.idle(10);
scene.overlay.showOutline(white, chassisEffectHighlight, threeRows, 10);
scene.idle(10);
scene.overlay.showOutline(white, chassisEffectHighlight, twoRows, 10);
scene.idle(10);
scene.overlay.showOutline(white, chassisEffectHighlight, singleRow, 10);
scene.idle(10);
scene.markAsFinished();
}
use of com.simibubi.create.foundation.ponder.Selection in project Create by Creators-of-Create.
the class DeployerScenes method contraption.
public static void contraption(SceneBuilder scene, SceneBuildingUtil util) {
scene.title("deployer_contraption", "Using Deployers on Contraptions");
scene.configureBasePlate(0, 0, 6);
scene.scaleSceneView(.9f);
Selection flowers = util.select.fromTo(4, 1, 1, 1, 1, 1);
scene.world.replaceBlocks(flowers, Blocks.AIR.defaultBlockState(), false);
Selection kinetics = util.select.fromTo(5, 1, 6, 5, 1, 3);
BlockPos deployerPos = util.grid.at(4, 1, 3);
Selection deployerSelection = util.select.position(deployerPos);
scene.world.showSection(util.select.layer(0).add(flowers), Direction.UP);
scene.idle(5);
ElementLink<WorldSectionElement> pistonHead = scene.world.showIndependentSection(util.select.fromTo(5, 1, 2, 8, 1, 2), Direction.DOWN);
scene.world.moveSection(pistonHead, util.vector.of(0, 0, 1), 0);
scene.world.showSection(kinetics, Direction.DOWN);
scene.idle(5);
ElementLink<WorldSectionElement> contraption = scene.world.showIndependentSection(deployerSelection, Direction.DOWN);
scene.idle(5);
scene.world.glueBlockOnto(util.grid.at(4, 2, 3), Direction.DOWN, contraption);
scene.overlay.showText(60).attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(deployerPos, Direction.WEST)).text("Whenever Deployers are moved as part of an animated Contraption...");
scene.idle(70);
scene.world.setKineticSpeed(util.select.position(4, 0, 6), -8);
scene.world.setKineticSpeed(kinetics, 16);
scene.world.moveSection(pistonHead, util.vector.of(-3, 0, 0), 100);
scene.world.moveSection(contraption, util.vector.of(-3, 0, 0), 100);
for (int x = 0; x < 4; x++) {
scene.world.moveDeployer(deployerPos, 1, 9);
scene.idle(10);
scene.world.moveDeployer(deployerPos, -1, 9);
scene.world.restoreBlocks(util.select.position(4 - x, 1, 1));
scene.idle(18);
}
scene.overlay.showSelectionWithText(flowers, 90).attachKeyFrame().colored(PonderPalette.GREEN).text("They activate at each visited location, using items from inventories anywhere on the contraption");
scene.idle(100);
scene.world.hideSection(flowers, Direction.UP);
scene.idle(15);
scene.world.replaceBlocks(flowers, Blocks.AIR.defaultBlockState(), false);
scene.world.showSection(flowers, Direction.UP);
Vec3 frontVec = util.vector.blockSurface(deployerPos.west(3), Direction.NORTH).add(0, 0, -.125);
Vec3 filterSlot = frontVec.add(0, 0.25, 0.375);
scene.overlay.showFilterSlotInput(filterSlot, 80);
scene.overlay.showText(60).attachKeyFrame().placeNearTarget().pointAt(filterSlot).text("The Filter slot can be used to specify which items to pull");
scene.idle(70);
ItemStack poppy = new ItemStack(Items.POPPY);
scene.overlay.showControls(new InputWindowElement(filterSlot, Pointing.DOWN).withItem(poppy), 30);
scene.idle(7);
scene.world.setFilterData(deployerSelection, DeployerTileEntity.class, poppy);
scene.idle(25);
scene.world.setKineticSpeed(util.select.position(4, 0, 6), 8);
scene.world.setKineticSpeed(kinetics, -16);
scene.world.moveSection(pistonHead, util.vector.of(3, 0, 0), 100);
scene.world.moveSection(contraption, util.vector.of(3, 0, 0), 100);
for (int x = 0; x < 4; x++) {
scene.world.moveDeployer(deployerPos, 1, 9);
scene.idle(10);
scene.world.moveDeployer(deployerPos, -1, 9);
scene.world.setBlock(util.grid.at(1 + x, 1, 1), Blocks.POPPY.defaultBlockState(), false);
scene.idle(18);
}
}
use of com.simibubi.create.foundation.ponder.Selection in project Create by Creators-of-Create.
the class DeployerScenes method redstone.
public static void redstone(SceneBuilder scene, SceneBuildingUtil util) {
scene.title("deployer_redstone", "Controlling Deployers with Redstone");
scene.configureBasePlate(0, 0, 5);
scene.world.showSection(util.select.layer(0), Direction.UP);
scene.idle(5);
scene.world.showSection(util.select.fromTo(3, 1, 5, 3, 1, 3), Direction.DOWN);
BlockPos deployerPos = util.grid.at(3, 1, 3);
Selection redstone = util.select.fromTo(3, 1, 1, 3, 1, 2);
BlockPos leverPos = util.grid.at(3, 1, 1);
scene.world.toggleRedstonePower(redstone);
scene.idle(26);
scene.world.moveDeployer(deployerPos, 1, 30);
scene.idle(31);
scene.world.moveDeployer(deployerPos, -1, 30);
scene.world.showSection(redstone, Direction.SOUTH);
scene.idle(31);
scene.world.toggleRedstonePower(redstone);
scene.effects.indicateRedstone(leverPos);
scene.idle(10);
scene.overlay.showText(60).colored(PonderPalette.RED).attachKeyFrame().pointAt(util.vector.topOf(deployerPos)).placeNearTarget().text("When powered by Redstone, Deployers will not activate");
scene.idle(70);
scene.world.toggleRedstonePower(redstone);
scene.idle(10);
scene.world.moveDeployer(deployerPos, 1f, 30);
scene.idle(10);
scene.world.toggleRedstonePower(redstone);
scene.effects.indicateRedstone(leverPos);
scene.idle(21);
scene.overlay.showText(60).pointAt(util.vector.topOf(deployerPos)).placeNearTarget().text("Before stopping, the Deployer will finish any started cycles");
scene.world.moveDeployer(deployerPos, -1f, 30);
scene.idle(70);
scene.world.toggleRedstonePower(redstone);
scene.idle(3);
scene.world.toggleRedstonePower(redstone);
scene.effects.indicateRedstone(leverPos);
scene.world.moveDeployer(deployerPos, 1, 30);
scene.overlay.showText(100).colored(PonderPalette.GREEN).attachKeyFrame().pointAt(util.vector.topOf(deployerPos)).placeNearTarget().text("Thus, a negative pulse can be used to trigger exactly one activation cycle");
scene.idle(31);
scene.world.moveDeployer(deployerPos, -1, 30);
}
use of com.simibubi.create.foundation.ponder.Selection in project Create by Creators-of-Create.
the class EjectorScenes method redstone.
public static void redstone(SceneBuilder scene, SceneBuildingUtil util) {
scene.title("weighted_ejector_redstone", "Controlling Weighted Ejectors with Redstone");
scene.configureBasePlate(0, 0, 5);
scene.world.showSection(util.select.layer(0), Direction.UP);
scene.idle(5);
scene.world.showSection(util.select.fromTo(4, 1, 3, 4, 1, 5), Direction.DOWN);
scene.idle(5);
scene.world.showSection(util.select.fromTo(0, 1, 2, 0, 2, 2), Direction.DOWN);
scene.idle(10);
scene.world.showSection(util.select.position(4, 1, 2), Direction.SOUTH);
scene.idle(5);
Selection redstone = util.select.fromTo(3, 1, 2, 2, 1, 2);
scene.world.showSection(redstone, Direction.EAST);
BlockPos ejectorPos = util.grid.at(4, 1, 2);
Vec3 topOf = util.vector.topOf(ejectorPos.above(2));
ItemStack copper = new ItemStack(Items.COPPER_INGOT);
for (int i = 0; i < 3; i++) {
scene.world.createItemEntity(topOf, util.vector.of(0, 0.1, 0), copper);
scene.idle(12);
scene.world.modifyEntities(ItemEntity.class, Entity::discard);
scene.world.createItemOnBeltLike(ejectorPos, Direction.UP, copper);
scene.idle(20);
if (i == 1) {
scene.world.toggleRedstonePower(redstone);
scene.effects.indicateRedstone(util.grid.at(2, 1, 2));
scene.world.modifyTileNBT(util.select.position(4, 1, 2), EjectorTileEntity.class, nbt -> nbt.putBoolean("Powered", true));
}
}
scene.idle(10);
scene.overlay.showText(60).colored(PonderPalette.RED).attachKeyFrame().pointAt(util.vector.topOf(ejectorPos)).placeNearTarget().text("When powered by Redstone, Ejectors will not activate");
scene.idle(70);
scene.world.toggleRedstonePower(redstone);
scene.idle(2);
scene.world.modifyTileNBT(util.select.position(4, 1, 2), EjectorTileEntity.class, nbt -> nbt.putBoolean("Powered", false));
scene.idle(5);
scene.world.hideSection(redstone, Direction.WEST);
scene.idle(10);
ElementLink<WorldSectionElement> observer = scene.world.showIndependentSection(util.select.position(4, 1, 1), Direction.SOUTH);
scene.world.moveSection(observer, util.vector.of(0.5, 1.5, -0.5), 0);
scene.world.rotateSection(observer, 0, 30 - 180, 0, 0);
scene.idle(20);
scene.world.moveSection(observer, util.vector.of(-0.5, -1.5, 0.5), 10);
scene.world.rotateSection(observer, 0, -30 + 180, 0, 10);
scene.world.showSection(util.select.position(4, 1, 0), Direction.SOUTH);
Selection observerRedstone = util.select.fromTo(4, 1, 1, 4, 1, 0);
for (int i = 0; i < 6; i++) {
scene.world.createItemEntity(topOf, util.vector.of(0, 0.1, 0), copper);
scene.idle(12);
scene.world.modifyEntities(ItemEntity.class, Entity::discard);
scene.world.createItemOnBeltLike(ejectorPos, Direction.UP, copper);
scene.idle(1);
scene.world.toggleRedstonePower(observerRedstone);
scene.effects.indicateRedstone(util.grid.at(4, 1, 1));
scene.idle(3);
scene.world.toggleRedstonePower(observerRedstone);
scene.idle(16);
if (i == 3)
scene.markAsFinished();
if (i == 1) {
scene.overlay.showText(60).attachKeyFrame().pointAt(util.vector.blockSurface(util.grid.at(4, 1, 1), Direction.NORTH)).placeNearTarget().text("Furthermore, Observers can detect when Ejectors activate");
}
}
}
use of com.simibubi.create.foundation.ponder.Selection in project Create by Creators-of-Create.
the class FanScenes method direction.
public static void direction(SceneBuilder scene, SceneBuildingUtil util) {
scene.title("fan_direction", "Air flow of Encased Fans");
scene.configureBasePlate(0, 1, 5);
scene.world.showSection(util.select.layer(0), Direction.UP);
scene.idle(5);
scene.world.showSection(util.select.fromTo(3, 1, 0, 3, 1, 5).add(util.select.position(3, 2, 4)), Direction.DOWN);
scene.world.showSection(util.select.fromTo(2, 1, 5, 1, 1, 5), Direction.DOWN);
scene.idle(10);
BlockPos fanPos = util.grid.at(1, 1, 4);
scene.world.showSection(util.select.position(fanPos), Direction.SOUTH);
scene.idle(40);
scene.effects.rotationDirectionIndicator(fanPos.south());
ElementLink<ParrotElement> flappyBirb = scene.special.createBirb(util.vector.topOf(1, 0, 3), FlappyPose::new);
scene.idle(2);
scene.special.rotateParrot(flappyBirb, 0, 235, 0, 30);
scene.special.moveParrot(flappyBirb, util.vector.of(0, 0, -2.5), 30);
scene.idle(20);
scene.overlay.showText(80).text("Encased Fans use Rotational Force to create an Air Current").attachKeyFrame().placeNearTarget().pointAt(util.vector.topOf(fanPos));
scene.idle(90);
BlockPos leverPos = util.grid.at(3, 2, 4);
Selection reverse = util.select.fromTo(3, 1, 5, 1, 1, 4);
scene.world.toggleRedstonePower(util.select.fromTo(leverPos, leverPos.below()));
scene.effects.indicateRedstone(leverPos);
scene.addKeyframe();
scene.world.modifyKineticSpeed(reverse, f -> -f);
scene.effects.rotationDirectionIndicator(fanPos.south());
scene.special.rotateParrot(flappyBirb, 0, 215 * 2, 0, 30);
scene.special.moveParrot(flappyBirb, util.vector.of(0, 0, 2.5), 30);
scene.idle(31);
scene.overlay.showText(60).text("Strength and Direction of Flow depends on the Rotational Input").placeNearTarget().pointAt(util.vector.topOf(fanPos));
scene.markAsFinished();
scene.idle(70);
scene.world.toggleRedstonePower(util.select.fromTo(leverPos, leverPos.below()));
scene.effects.indicateRedstone(leverPos);
scene.world.modifyKineticSpeed(reverse, f -> -f);
scene.world.modifyKineticSpeed(util.select.everywhere(), f -> 4 * f);
scene.effects.rotationSpeedIndicator(fanPos.south());
scene.special.rotateParrot(flappyBirb, 0, 245 * 4, 0, 30);
scene.special.moveParrot(flappyBirb, util.vector.of(0, 0, -20), 30);
}
Aggregations