I have never had any experience fixing build-related problems before, so when the Jmonkey Engine decided to produce a build that didn't function like it would run in the compiler, I didn't (and still don't) really know what to do. The Jmonkey Engine runs on top of netbeans, but in this particular game we make use of mostly the Nifty GUI, as there is only one 3D object (the globe).
There are no error messages - the build is "successful", the game runs without errors. The thing is that player cannot move on from the class menu to the Malware Hub, or the place where the game starts. I'll post my build log, the Class Menu, and the Malware Hub.
Even if you don't have any direct experience with Jmonkey, could you explain to me why this would happen and what I might need to do to fix it in general? NOTE: I do not have console knowledge, so any help in that order might need some explaining.
Thanks.
I wish I could provide smaller segments of code that recreate the problem but I don't actually know what the problem is and therefore all I can do is post the two classes. HOWEVER, I will post the part of the code here which you should probably be paying attention to. Check the links if you want a full class, though.
Build Log: http://pastebin.com/bgaVNvKi
Class Menu: http(colon)//pastebin(dot)com/9ZBJkGhi
--IMPORTANT PARTS OF CLASS MENU ONLY--
nifty.fromXml("Interface/NiftyGUI/MalwareHub.xml","start", MH);
//^^ How I reach the Malware Hub.
private MalwareHub MH;
MH = Main.getMalwareHub();
Main.getApplication().getStateManager().attach(MH);
//^^ Value of MH
Malware Hub Full Code: http://pastebin.com/AnuTWQP0
--IMPORTANT PARTS ONLY--
public class MalwareHub extends AbstractAppState implements ScreenController {
public MalwareHub() {
day = Time.getDayRate();
timekeeper = 0;
upgradeTimekeeper = 0;
//We add the functionality necessary to let the player rotate the globe.
inputManager = Main.getApplication().getInputManager();
initKeys();
gameStarted = false;
}
@Override
public void onStartScreen() {
System.out.println("Screen Started");
}
@Override
public void onEndScreen() {
System.out.println("Screen Ended");
}
@Override
public void bind(Nifty NIFTY, Screen SCREEN) {
//Actual Screens
nifty = NIFTY;
screen = SCREEN;
//Correct instantiations of other xml files
UA = Main.getUpgradeAbility();
UE = Main.getUpgradeEffect();
UIV = Main.getUpgradeInfectionVector();
PH = Main.getPopupHandler();
//I initialize a lot of Main variables.
app = Main.getApplication();
assetManager = app.getAssetManager();
n = new Node("Globe");
cam = app.getCamera();
onMalwareHub = true;
//<editor-fold desc="Show the beginning popup" defaultstate="collapsed">
if(!gameStarted){
System.out.println("Beginning window shown");
PH.showWindow("Welcome. You have recently posted a piece of malware online that does nothing but will soon be upgraded by you. "
+ "Use these upgrades to increase infectivity, complete new and more powerful effects, and conquer the world.", "");
}
//</editor-fold>
//We're here
gameStarted = true;
UpgradeButton=screen.findElementByName("MalwareButton");
//We are going to create the globe.
//<editor-fold defaultstate="collapsed" desc="It's 'Global'">
//In order to do this, first, we need to transform it to fit whatever device they're using.
//Here we create the actual sphere, with the radius being slightly smaller than the smallest side of whatever device is being used.
globe = assetManager.loadModel("Models/World/World_Globe.obj");
globeGeometry = new Geometry();
//Attach the texture
globeMaterial = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
globeMaterial.setTexture("ColorMap", assetManager.loadTexture("Models/World/Globe_Txtr.png"));
globe.setMaterial(globeMaterial);
//Set move the globe to the right location and center it.
globe.setLocalTranslation(0, 1, 0);
globe.center();
//Attach the globe, scale it down (cuz its big), then translate the node to the same spot as the globe so we don't start revolving around 0,0,0.
n.attachChild(globe); //Attach it to the node
n.scale(0.02f); //Scale the globe down
n.setLocalTranslation(0, 1, 0);
//Starring... the globe!
cam.lookAt(new Vector3f(0, 0, 0), Vector3f.UNIT_Y);
cam.update();
//Now we must give it some light!
//<editor-fold defaultstate="collapsed" desc="Light">
DirectionalLight sun2 = new DirectionalLight();
sun2.setDirection(new Vector3f(0, 1, 0).normalizeLocal());
sun2.setColor(ColorRGBA.White);
n.addLight(sun2);
DirectionalLight sun3 = new DirectionalLight();
sun3.setDirection(new Vector3f(0, 0, 1).normalizeLocal());
sun3.setColor(ColorRGBA.White);
n.addLight(sun3);
DirectionalLight sun4 = new DirectionalLight();
sun4.setDirection(new Vector3f(1, 0, 0).normalizeLocal());
sun4.setColor(ColorRGBA.White);
n.addLight(sun4);
DirectionalLight sun5 = new DirectionalLight();
sun5.setDirection(new Vector3f(-1, 0, 0).normalizeLocal());
sun5.setColor(ColorRGBA.White);
n.addLight(sun5);
DirectionalLight sun6 = new DirectionalLight();
sun6.setDirection(new Vector3f(0, -1, 0).normalizeLocal());
sun6.setColor(ColorRGBA.White);
n.addLight(sun6);
DirectionalLight sun7 = new DirectionalLight();
sun7.setDirection(new Vector3f(0, 0, -1).normalizeLocal());
sun7.setColor(ColorRGBA.White);
n.addLight(sun7);
//</editor-fold>
Main.getRN().attachChild(n); //Finally, attach the node to the root node.
//</editor-fold>
//Initialize text variables
//<editor-fold defaultstate="collapsed" desc="Initialize Text Renderers">
governmentInvestigationText = screen.findElementByName("GovernmentInvestigationText").getRenderer(TextRenderer.class);
computersInfectedText = screen.findElementByName("InfectedText").getRenderer(TextRenderer.class);
moneyMadeText = screen.findElementByName("MoneyText").getRenderer(TextRenderer.class);
destructionDoneText = screen.findElementByName("DestructionText").getRenderer(TextRenderer.class);
//</editor-fold>
}
http(colon)//puu(dot)sh/9su8k/3910c2365a(dot)png
After figuring out how to use a command prompt, I found an "Illegal Argument Exception". It's complaining that the given root path "C:\Users\Dean\Dist\Assets\Interface" is not a directory, however I don't get this in the compiler. What does that even mean? I get this moving from ClassMenu to MalwareHub.
P.S. I register Assets/Interface as a locator for my asset manager in main.
http://puu.sh/9wml6/50eed968f8.png
What ACTUALLY happened was that I had registered that locator I talked about earlier, which I shouldn'tve had to do. Subsequently, in my xml I had (accidentally) forgot to put the Interface/ in front of a filename. This worked in the compiler because from Jmonkey's perspective that Assets/Interface was an actual folder, but in the build, everything was supposed to be accessed from the assets.jar. That's why it was complaining that the Assets/Interface folder didnt exist.
Thanks for the help gaize!