Skip to content

Commit

Permalink
Added missing file in texture override commit
Browse files Browse the repository at this point in the history
  • Loading branch information
emd4600 committed Apr 11, 2020
1 parent 9b5b1d7 commit eb6b351
Show file tree
Hide file tree
Showing 8 changed files with 283 additions and 63 deletions.
Binary file modified Effect Editor/main.effdir
Binary file not shown.
80 changes: 39 additions & 41 deletions Effect Editor/main.pfx
Original file line number Diff line number Diff line change
@@ -1,46 +1,44 @@
# If you have the 'ModCreatorKit.sporemod' mod istalled:
# 1. Open the game
# 2. Open the console and use the cheat 'effectEditor'
# 3. Every time you save this file, the effect will reload and show in the game
#
# You can also use this special effect in other parts of the game (such as skinpaints, terraform brushes, etc)
# but to see the changes you need to reload manually the effect
# (for example, use the terraform tool again, apply the skinpaint again, etc)
particles particles-PinkFire
color (2, 2, 0.8) (0.8, 2, 0.8) (2, 1, 0.8) -vary (0.1, 0.1, 0.1)
alpha 0 2 0.5 2 0.5 1 0.5 0 0 0 0 0 1 0.5 1 0.5 2 0.5 0 0 0 2 0.5 1 0.5 0
size 0.2 0.4 0.2 -vary 0.2
rotate 100 109 -vary 0.1
source -box ( 0.2, 6, 6)
emit -speed 0 -dir (0, 0, 0) (1, 1, 1)
force -attractor (0, 0, 0) 20 -5 2 -4 5 -2 3 -2
#warp -spiral 0.1
#randomWalk -delay 1.5 -strength 0.3 -turn 0.25
life 10 8 -preroll 3
maintain 30
texture 0x001723BC -draw additive -light -noFog
color (0.1620957, 0.764, 0.1574657)
physics unk1
end

# Defines a 'particles' component called 'testEPEffect'
# The name is only important within the file, and has to be unique
particles testEPEffect
# How many seconds a particle lives before disappearing
life 5
# Where the particles are emitted from; in this case, from a single point
source -point
# How many particles are spawned. This is animatable:
# the value changes from 200 particles to 0. This loops every 2 seconds
rate 200 0 -loop 2
# In which direction the particles are emitted:
# Also the speed: 4 units per second
emit -dir (0, 0, 1) 0.3 -speed 4
# Pulls the particles down as if there was gravity
force -gravity 2
stretch 10
# Animates the rotation of the particle: 0 to 1 is a complete rotation
rotate 0 1
# The color, also animated: from red to green
color (0, 1, 0)
# The opacity, also animated: from completely opaque to transparent when the particle is dying
alpha 1 1 1 1 0
# The scale of the particle, animated
size 0.1 0.2 0.1

# The name of the texture used. It must be a .rw4.dds and be in the 'animations~' folder
texture effects-star
particles particles-PinkGlow
color (2, 2, 0.8) (0.8, 2, 0.8) (2, 1, 0.8) -vary (0.1, 0.1, 0.1)
alpha 0 2 0.5 2 0.5 1 0.5 0 0 0 0 0 1 0.5 1 0.5 2 0.5 0 0 0 2 0.5 1 0.5 0
size 0.2 0.4 0.2 -vary 0.2
rotate 100 109 -vary 0.1
source -box ( 0.2, 5, 5)
emit -speed 0.5 -dir (0, 0, 0) (1, 1, 1)
force -attractor (0, 0, 0) 20 -5 2 -4 5 -2 3 -2
warp -spiral 0.1
randomWalk -delay 1.5 -strength 0.3 -turn 0.25
life 3 1 -preroll 3
maintain 30
texture 0x001723BC -draw additive -light -noFog
color (1, 0.9, 0.9742857)
physics unk1
end

# Defines an effect called 'effect_editor'
# Use this special name so you can see the changes while the game is opened
effect _effect_editor
particles testEPEffect

effect _effect_editor -flags 0x10
lodDistances 100 200 400 700 1200 2400
particles particles-PinkFire -lodRange 1 4 -emitScale 1 1 1 1 -sizeScale 1 1 0.9 0.7 -alphaScale 1 1 1 0.1
particles particles-PinkFire -lodRange 1 4 -emitScale 1 1 1 1 -sizeScale 1 1 0.9 0.7 -alphaScale 1 1 1 0.1

sound -name ufo_sculpt_hit_med -soundFlags 0xa -field_18 0xCDCDCDCD -field_1C 0.05 -ignoreLength
#sound -name be_details_windmill_04 -field_1C 4.65 -soundFlags 0xa #-field_20 20.0
end

# Exports the effect so it can be used in the game
export _effect_editor
Binary file modified SporeModderFX.exe
Binary file not shown.
7 changes: 4 additions & 3 deletions config.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#Sat Apr 06 22:45:17 CEST 2019
#Sun Feb 23 13:30:12 CET 2020
fxcFile=AUTO
dontAskAgain_saveAsMod=false
gameToExecute=GALACTIC_ADVENTURES
dontAskAgain_removeItem=false
hasSelectedStyle=true
pathSpore=AUTO
pathGA=C\:\\Program Files (x86)\\Games\\Spore
selectedStyle=Default
pathGA=AUTO
selectedStyle=Dark
isFirstTime=false
pathCustom=
gameCommandLine=
184 changes: 167 additions & 17 deletions src/sporemodder/JavaFXTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,23 @@
****************************************************************************/
package sporemodder;

import java.io.File;
import java.net.MalformedURLException;

import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.Timeline;
import javafx.application.Application;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.geometry.Point3D;
import javafx.scene.DepthTest;
import javafx.scene.Camera;
import javafx.scene.Group;
import javafx.scene.Parent;
import javafx.scene.PerspectiveCamera;
import javafx.scene.Scene;
import javafx.scene.SceneAntialiasing;
import javafx.scene.SubScene;
import javafx.scene.input.MouseEvent;
import javafx.scene.paint.Color;
import javafx.scene.paint.PhongMaterial;
Expand All @@ -33,6 +44,8 @@
import javafx.scene.transform.Transform;
import javafx.scene.transform.Translate;
import javafx.stage.Stage;
import javafx.util.Duration;
import sporemodder.file.dbpf.DBPFUnpackingTask;

public class JavaFXTest extends Application {

Expand All @@ -49,22 +62,79 @@ public class JavaFXTest extends Application {
// DOn't forget to remove this file, like wtf is this doing here? xD
private int remove;

@Override
public void start(Stage primaryStage) {
root.getChildren().add(world);
root.setDepthTest(DepthTest.ENABLE);
buildCamera();
buildBodySystem();
Scene scene = new Scene(root, 800, 600, true);
scene.setFill(Color.GREY);
handleMouse(scene);
primaryStage.setTitle("TrafoTest");
primaryStage.setScene(scene);
primaryStage.show();
scene.setCamera(camera);
mouseFactorX = 180.0 / scene.getWidth();
mouseFactorY = 180.0 / scene.getHeight();
}
// @Override
// public void start(Stage primaryStage) {
// root.getChildren().add(world);
// root.setDepthTest(DepthTest.ENABLE);
// buildCamera();
// buildBodySystem();
// Scene scene = new Scene(root, 800, 600, true);
// scene.setFill(Color.GREY);
// handleMouse(scene);
// primaryStage.setTitle("TrafoTest");
// primaryStage.setScene(scene);
// primaryStage.show();
// scene.setCamera(camera);
// mouseFactorX = 180.0 / scene.getWidth();
// mouseFactorY = 180.0 / scene.getHeight();
// }

private final ObjectProperty<Color> sceneColorProperty = new SimpleObjectProperty<>(Color.RED);

// @Override
// public void start(Stage primaryStage) throws MalformedURLException {
//
//// Rectangle rect = new Rectangle(400,400);
//// rect.fillProperty().bind(sceneColorProperty);
////
//// Scene scene = new Scene(new StackPane(rect), 400, 400);
//// scene.getStylesheets().add(new File("E:\\Eric\\Eclipse Projects\\SporeModder FX\\Styles\\Default\\color-swatch.css").toURI().toURL().toExternalForm());
//// scene.setOnMouseClicked(e->{
//// if(e.getButton().equals(MouseButton.SECONDARY)){
//// ColorSwatchUI myCustomColorPicker = new ColorSwatchUI();
//// myCustomColorPicker.setCurrentColor(sceneColorProperty.get());
////
//// CustomMenuItem itemColor = new CustomMenuItem(myCustomColorPicker);
//// itemColor.setHideOnClick(false);
//// sceneColorProperty.bind(myCustomColorPicker.customColorProperty());
//// ContextMenu contextMenu = new ContextMenu(itemColor);
//// contextMenu.setOnHiding(t->sceneColorProperty.unbind());
//// contextMenu.show(scene.getWindow(),e.getScreenX(),e.getScreenY());
//// }
//// });
//
// primaryStage.setTitle("Custom Color Selector");
// //primaryStage.setScene(scene);
// primaryStage.show();
//
// MainApp.testInit();
//
// String path = "C:\\Users\\Eric\\Downloads\\!!!!!!!!!!!!!!!!_DroneParts_2017_PublicRelease_1_2.package";
// String projectPath = "E:\\Eric\\Eclipse Projects\\SporeModder FX\\Projects\\!!!!!!!!!!!!!!!!_DroneParts_2017_PublicRelease_1_2";
//
// File projectFolder = new File(projectPath);
//
// FileManager.get().deleteDirectory(projectFolder);
// projectFolder.mkdir();
// DBPFUnpackingTask oldTask = new DBPFUnpackingTask(new File(path), projectFolder, null, FormatManager.get().getConverters());
//
// long time = System.currentTimeMillis();
// oldTask.run();
// while (oldTask.isRunning());
// time = System.currentTimeMillis() - time;
//
// System.out.println("old time: " + time);
//
// FileManager.get().deleteDirectory(projectFolder);
// projectFolder.mkdir();
// DBPFUnpackingTask newTask = new DBPFUnpackingTask(new File(path), projectFolder, null, FormatManager.get().getConverters());
//
// time = System.currentTimeMillis();
// newTask.run();
// time = System.currentTimeMillis() - time;
//
// System.out.println("new time: " + time);
// }

private void buildCamera() {
root.getChildren().add(cameraXform);
Expand Down Expand Up @@ -115,6 +185,86 @@ private void handleMouse(Scene scene) {
});
}

// public static void main(String[] args) {
// launch(args);
// }

private Parent createContent() throws Exception {
Sphere sphere = new Sphere(2.5);
sphere.setMaterial(new PhongMaterial(Color.FORESTGREEN));

sphere.setTranslateZ(7);
sphere.setTranslateX(2);

Box box = new Box(5, 5, 5);
box.setMaterial(new PhongMaterial(Color.RED));

Translate pivot = new Translate();
Rotate yRotate = new Rotate(0, Rotate.Y_AXIS);

// Create and position camera
PerspectiveCamera camera = new PerspectiveCamera(true);
camera.getTransforms().addAll (
pivot,
yRotate,
new Rotate(-20, Rotate.X_AXIS),
new Translate(0, 0, -50)
);

// animate the camera position.
Timeline timeline = new Timeline(
new KeyFrame(
Duration.seconds(0),
new KeyValue(yRotate.angleProperty(), 0)
),
new KeyFrame(
Duration.seconds(15),
new KeyValue(yRotate.angleProperty(), 360)
)
);
timeline.setCycleCount(Timeline.INDEFINITE);
timeline.play();

// Build the Scene Graph
Group root = new Group();
root.getChildren().add(camera);
root.getChildren().add(box);
root.getChildren().add(sphere);

// set the pivot for the camera position animation base upon mouse clicks on objects
root.getChildren().stream()
.filter(node -> !(node instanceof Camera))
.forEach(node ->
node.setOnMouseClicked(event -> {
pivot.setX(node.getTranslateX());
pivot.setY(node.getTranslateY());
pivot.setZ(node.getTranslateZ());
})
);

// Use a SubScene
SubScene subScene = new SubScene(
root,
300,300,
true,
SceneAntialiasing.BALANCED
);
subScene.setFill(Color.ALICEBLUE);
subScene.setCamera(camera);
Group group = new Group();
group.getChildren().add(subScene);

return group;
}

@Override
public void start(Stage stage) throws Exception {
stage.setResizable(false);
Scene scene = new Scene(createContent());
stage.setScene(scene);
stage.show();
}

public static void main(String[] args) {
launch(args);
}
Expand Down
4 changes: 2 additions & 2 deletions src/sporemodder/file/effects/EffectDirectory.java
Original file line number Diff line number Diff line change
Expand Up @@ -796,8 +796,8 @@ public static void main(String[] args) throws IOException {
// String path = "E:\\Eric\\Eclipse Projects\\SporeModder FX\\Projects\\Effect Editor\\gameEffects_3~\\editors.effdir";
// String outputPath = "E:\\Eric\\Eclipse Projects\\SporeModder FX\\Projects\\Effect Editor\\gameEffects_3~\\editors.effdir.unpacked";

String path = "E:\\Eric\\Eclipse Projects\\SporeModder FX\\Projects\\Effects\\gameEffects_3~\\games.effdir";
String outputPath = "E:\\Eric\\Eclipse Projects\\SporeModder FX\\Projects\\Effects\\gameEffects_3~\\games.effdir.unpacked";
String path = "E:\\Eric\\Eclipse Projects\\SporeModder FX\\Projects\\Effects\\ep1_effects_3~\\games.effdir";
String outputPath = "E:\\Eric\\Eclipse Projects\\SporeModder FX\\Projects\\Effects\\ep1_effects_3~\\games.effdir.unpacked";

long time = System.currentTimeMillis();

Expand Down
39 changes: 39 additions & 0 deletions src/sporemodder/file/rw4/RWTextureOverride.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package sporemodder.file.rw4;

import java.io.IOException;

import emord.filestructures.StreamReader;
import emord.filestructures.StreamWriter;
import emord.filestructures.Stream.StringEncoding;

public class RWTextureOverride extends RWObject {

// This is actually the Light type, but Spore does not use it
public static final int TYPE_CODE = 0x20008;
public static final int ALIGNMENT = 4;

public String name;

public RWTextureOverride(RenderWare renderWare) {
super(renderWare);
}

@Override public void read(StreamReader stream) throws IOException {
if (stream.readLEInt() == 0xFB724FAA) {
name = stream.readCString(StringEncoding.ASCII);
}
}

@Override
public void write(StreamWriter stream) throws IOException {
if (name != null) {
stream.writeLEInt(0xFB724FAA);
stream.writeCString(name, StringEncoding.ASCII);
}
}

@Override
public int getTypeCode() {
return TYPE_CODE;
}
}
Loading

0 comments on commit eb6b351

Please sign in to comment.