Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 300 301 [302] 303 304 ... 796

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 906549 times)

Zanzetkuken The Great

  • Bay Watcher
  • The Wizard Dragon
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4515 on: June 15, 2013, 07:29:45 pm »

No, use it instead of the Property class. The tutorial is outdated.

Where is the 'Property' class that I need to replace with 'Properties'?  I'm not seeing where it is.
Logged
Quote from: Eric Blank
It's Zanzetkuken The Great. He's a goddamn wizard-dragon. He will make it so, and it will forever be.
Quote from: 2016 Election IRC
<DozebomLolumzalis> you filthy god-damn ninja wizard dragon

Mego

  • Bay Watcher
  • [PREFSTRING:MADNESS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4516 on: June 15, 2013, 07:33:02 pm »

Wait... That's weird... That error message doesn't make any sense.

Zanzetkuken The Great

  • Bay Watcher
  • The Wizard Dragon
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4517 on: June 15, 2013, 08:01:18 pm »

Wait... That's weird... That error message doesn't make any sense.

...
...
...
This is the second time in three months that I have heard this.  (First is with the dracolich reaction that suddenly went haywire, and now crashes the game whenever it is attempted to be used.)
Logged
Quote from: Eric Blank
It's Zanzetkuken The Great. He's a goddamn wizard-dragon. He will make it so, and it will forever be.
Quote from: 2016 Election IRC
<DozebomLolumzalis> you filthy god-damn ninja wizard dragon

Twiggie

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4518 on: June 16, 2013, 05:19:11 am »

Assuming the documentation is correct, the properties class has pretty much nothing to do with the WSCI class, and you should be passing a boolean instead
Logged

Zanzetkuken The Great

  • Bay Watcher
  • The Wizard Dragon
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4519 on: June 16, 2013, 08:46:14 am »

Assuming the documentation is correct, the properties class has pretty much nothing to do with the WSCI class, and you should be passing a boolean instead

When I change the code to this:

Code: [Select]
import net.slashie.libjcsi.wswing.WSwingConsoleInterface;
import net.slashie.libjcsi.ConsoleSystemInterface;
import net.slashie.libjcsi.CSIColor;
import java.util.Properties;
 
public class HelloDungeon{
 
   public static void main(String[] args){
      Boolean text = new Properties();
      text.setProperty("fontSize","20");
      text.setProperty("font", "Courier");
      ConsoleSystemInterface csi = null;
      try{
         csi = new WSwingConsoleInterface("Insert Game Name", text);
      }
      catch (ExceptionInInitializerError eiie) {
         System.out.println("*** Error: Swing Console Box cannot be initialized. Exiting...");
         eiie.printStackTrace();
         System.exit(-1);
      }
      csi.print(0,0, "Welcome to the Dungeons of Doom!", CSIColor.WHITE);
   }
}

It solves that error, apparently, but these crop up:

Spoiler (click to show/hide)

I can remove the first by changing the code to this:

Code: [Select]
import net.slashie.libjcsi.wswing.WSwingConsoleInterface;
import net.slashie.libjcsi.ConsoleSystemInterface;
import net.slashie.libjcsi.CSIColor;
import java.util.Properties;
 
public class HelloDungeon{
 
   public static void main(String[] args){
      Boolean text = new Properties() !=null;
      text.setProperty("fontSize","20");
      text.setProperty("font", "Courier");
      ConsoleSystemInterface csi = null;
      try{
         csi = new WSwingConsoleInterface("Insert Game Name", text);
      }
      catch (ExceptionInInitializerError eiie) {
         System.out.println("*** Error: Swing Console Box cannot be initialized. Exiting...");
         eiie.printStackTrace();
         System.exit(-1);
      }
      csi.print(0,0, "Welcome to the Dungeons of Doom!", CSIColor.WHITE);
   }
}

but the other two persist, and I don't know how to fix those.
« Last Edit: June 16, 2013, 08:49:11 am by Zanzetkuken The Great »
Logged
Quote from: Eric Blank
It's Zanzetkuken The Great. He's a goddamn wizard-dragon. He will make it so, and it will forever be.
Quote from: 2016 Election IRC
<DozebomLolumzalis> you filthy god-damn ninja wizard dragon

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4520 on: June 16, 2013, 10:05:44 am »

Erm, you can't use a Boolean like a Properties, try commenting out the text.setProperty() lines.
Logged

cerapa

  • Bay Watcher
  • It wont bite....unless you are the sun.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4521 on: June 16, 2013, 11:34:19 am »

What are you even...

Boolean text = new Properties();
Boolean text = new Properties() !=null;

Are two very, very, very different things. First one creates a Properties and tries to squeeze it into a boolean. And as you might know, Properties is a class, and booleans can only contain 0 and 1. Hence the error "Type mismatch: cannot convert from Properties to boolean", because you would literally need to be a wizard to convert between the two.

Second one creates a new Properties, and if it exists after creation sets the boolean as 1 or 0 otherwise. If Java didn't have garbage collection, the Properties would now be sitting in limbo, eating up memory.

The 2nd and 3rd errors, as Magma pointed out, are caused by the fact that your "text" is a boolean, not a Properties.
Logged

Tick, tick, tick the time goes by,
tick, tick, tick the clock blows up.

Zanzetkuken The Great

  • Bay Watcher
  • The Wizard Dragon
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4522 on: June 16, 2013, 12:21:22 pm »

Erm, you can't use a Boolean like a Properties, try commenting out the text.setProperty() lines.

Well, deleted those lines, so now the program works.

What are you even...

Trying to see if I could preserve the ability for property files to be made.  Now I've stopped caring.
Logged
Quote from: Eric Blank
It's Zanzetkuken The Great. He's a goddamn wizard-dragon. He will make it so, and it will forever be.
Quote from: 2016 Election IRC
<DozebomLolumzalis> you filthy god-damn ninja wizard dragon

olemars

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4523 on: June 16, 2013, 12:55:14 pm »

Assuming the documentation is correct, the properties class has pretty much nothing to do with the WSCI class, and you should be passing a boolean instead

According to the source, there is a constructor accepting a String and Properties object, so the documentation is either weird or outdated.

Zanzetkuken: Sure you have the most recent version of libjcsi?
Logged

Zanzetkuken The Great

  • Bay Watcher
  • The Wizard Dragon
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4524 on: June 16, 2013, 04:56:52 pm »

Assuming the documentation is correct, the properties class has pretty much nothing to do with the WSCI class, and you should be passing a boolean instead

According to the source, there is a constructor accepting a String and Properties object, so the documentation is either weird or outdated.

Zanzetkuken: Sure you have the most recent version of libjcsi?

All possibilities are here, and I grabbed 0.0.2, the most recent.
Logged
Quote from: Eric Blank
It's Zanzetkuken The Great. He's a goddamn wizard-dragon. He will make it so, and it will forever be.
Quote from: 2016 Election IRC
<DozebomLolumzalis> you filthy god-damn ninja wizard dragon

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #4525 on: June 17, 2013, 02:48:24 am »

JSON files are awesome for the use I'm putting them for: item raws. Loving them. I whipped up a workable item slurper in a mere thirty minutes :D
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4526 on: June 17, 2013, 05:46:07 am »

PROTOBUF files are awesome for the use I'm putting them for: item raws. Loving them. I whipped up a workable item slurper in a mere thirty minutes :D

FTFY
Logged

GlyphGryph

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4527 on: June 17, 2013, 08:42:03 am »

I just looked at protobuff and... this does NOT seem like an improvement. >_>

YAML is just the best way to do item raws, obviously.
Logged

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4528 on: June 17, 2013, 08:55:13 am »

Well, each has its use, I guess. I like XML for it's text-editor-editableness, ini for it's simplicity, and json for it's compact API-transfer-protocolness.
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: if self.isCoder(): post() #Programming Thread
« Reply #4529 on: June 17, 2013, 09:12:27 am »

Well, to be honest...

What I really want is a job.  Because I'm making $12/hour right now, when I'm employed, which is infrequent.

We may still be hiring here in panama city.

BUT: the work is boring, arbitrary and annoying. Plus we are more likely to be looking for a long term programmer considering the massive scale of the projects we work on. And I don't think you want to get this far away from your family, or deal with all the extreme conservatives...

Why the hell do I work here again?
Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.
Pages: 1 ... 300 301 [302] 303 304 ... 796