Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Supermikhail

Pages: 1 ... 16 17 [18] 19 20 ... 73
256
Did you chmod it with sudo? Don't, giving scripts root access is never good. Run `sudo chown <youruser> <file>`.

e, $0 is like argv[0].
Code: [Select]
ron@Tux ~ $ cat zero.sh
echo $0
ron@Tux ~ $ bash zero.sh
zero.sh
Oh, god. I've been running it like crazy, sudo and without, fortunately, most times it wouldn't run, and theoretically it shouldn't have tried to access too many files, as in the code there's only one. Mental note: after Googling tips on helpful Internet sites, always try to check man pages for the said tips.
Chmoding +x as root won't matter, just don't use the run as owner option :) (which I think is +s). All +x does is mark owner, group and all execute flags but they still run it at them not the chmodder.
So I cmodded +x it as root, then tried to run it while not being root, and it wouldn't run... Wait wait. I actually can chmod it without +x, because I'm morbidly interested to be able to run it on any Linux computer, not just mine?
Maybe +0777x ? Although that looks like a phone number, not an argument.

Edit: Arght, I was just too slow.

Edit: edit: I'm again figuring out if int is too expensive and have just looked at the reference for short... MAX_VALUE 215-1... Yeah, I'm never using int *sigh*

257
Oh god. Oh yes. I was just going to complain here that it didn't work, turns out I made a typo in the variable for the dirname. ::)
So I did it like this:
Code: [Select]
#!/bin/bash
ES_DIR=$(dirname "$0")
cd "${ES_DIR}"
java -jar ElementSetup.jar
It didn't seem to like it when I tried to cd just dirname. Anybody know what's "$0" for?

Edit: well, that's fancy. It runs correctly only with sudo.

258
Creative Projects / Re: Top down shooter project
« on: December 22, 2010, 06:54:01 am »
Actually... HI-FIVE FROM ANOTHER NOOB! ;D Basically, after some mucking about with C++, I've just started on Java, and I've just made it read data from a text file, so I'm pretty excited about it, but I can't speak for C# as I'm on Linux and as a rule programs in C# don't want to run on my computer. And I've never used python either, but good for that guy as everybody who uses python here doesn't seem to go beyond ascii, even with pygame.

Although, there was a guy who made pretty rad top-down shooters in C# with XNA, and I've even got his Youtube channel in my subscriptions, check him out, and I believe he goes by the same nickname here, whatever use it may be for you, as he hasn't uploaded any videos of his project in a while, and hasn't posted about his project either. Maybe you'll get inspired, XNA whatever it may be seems to be a very good thing for making games, if you're on Windows.

259
Oh. Then for a java file... er, I should probably... Hm, nevermind, I deleted that file and don't know how I was trying to do it. But I assume that if I'm trying to launch the program in terminal, I should write #!/bin/bash and then it's something weird, can I write just cd "$dirname"? And then maybe "java -jar filename"?

260
Creative Projects / Re: Top down shooter project
« on: December 22, 2010, 06:08:21 am »
I've recently and suddenly developed an opinion that enemy AI won't be realistic if the PC isn't. And doesn't act realistically. With which I imply, probably, that it should be possible to one-two shot kill the PC, as well as AI opponents. Or apply the DF system (which is much harder).

On the topic of languages. Well, nobody here would tell you to choose one specific language, because there are, generally, no bad or good languages, although if one wants to be in game industry, one should probably choose either C++ or C#, and a lot of people do simple 2D games in Adobe Flash.

But, and under some assumptions of mine from what you've written, what languages do you know or are familiar with?

261
Fuck yeah! The easy part is over, baby.

For anybody interested, the part I screwed over was not file reading. I had a problem with input yesterday in Java, too, and almost resolved that it's a family curse. Then I had to get up in the middle of the night to correct my code. Java, being helpful platform that it is, had hinted it for me earlier with "ExceptionNullPointer and had given me the number of the line. And the line has no Strings. The line has a member of an array of objects. A static array, which I had initialized with new array. I quite stupidly supposed that it would initialize all the members of the array, which it didn't, and in C++ it was the case, too, I guess.

A lesson for me for going the easy part and avoiding linked lists.

Now it would be nice to make it read the file in the application's directory. Anybody know what makes the shell file in the Linux version of DF tick? I've tried copying it for my application (applying then "chmod +x"), but it didn't work.

262
Oh, yeah. I think a while back Ron specifically said that he liked Emacs for the transparency of the GUI manipulation, or maybe it was someone else.

263
Eww, Beans. Try using Emacs, it's great fun, and way cooler than all those shiny IDEs. Can your editor do this?
Can't watch that right now... but, I guess, I've got a thing for shiny IDEs. Probably because I was introduced to programming through a shiny IDE Delphi. Plus I just love how NetBeans handles component placing, like multiple grids to snap to - margin at the edge of the frame, several margins between components, edge alignment - just relaxing to look at. Although, I guess it could be counted as a form of procrastination.

264
Anyway, on to importing. How do I import custom classes? I've got this so far, but it doesn't work.
Well, for what it's worth, I've just imported my first custom class in NetBeans. This involved, building the class, for it to have a jar, then adding the jar to the libraries of my project (although it might be only relevant to the NetBeans interface, and I've got no idea how you'd do it otherwise), and finally importing the class with the package name.
That's a bit of a roundabout way. If you've got the source code of the class, you can just make an additional class in the preferred package, copy the source code into said class and include said class (and package, via the using command, though if you're using netbeans it'll offer to solve that for you). Essentially the same method that you'd use when making your own classes, but this time you're stealing someone else's work :P
Doing it this way also makes it easier to extend or change the functionality of any custom classes, because you don't have to go back and build a new jar every time you change something.
Well, I don't know... I think it just feels cool that I can do this (roundabout way). And, well, you don't copy java.* classes into your code... err if you can.
Also, as I pretty much need to use the same class in the same implementation in two different applications... I don't think it would work your way.

265
Anyway, on to importing. How do I import custom classes? I've got this so far, but it doesn't work.
Well, for what it's worth, I've just imported my first custom class in NetBeans. This involved, building the class, for it to have a jar, then adding the jar to the libraries of my project (although it might be only relevant to the NetBeans interface, and I've got no idea how you'd do it otherwise), and finally importing the class with the package name.

266
Well, it's been solved, but...
It'll draw certain pixels one on top of the other, at least it did when I used it a year ago for some Cortex Command mod.
But, never mind. I'm using the Bresenham circle algorithm, which works just fine.
in the case when the radius is too large, and there are more than 360 pixels to draw, the circle will be dotted?

Also, apparently, Java does values and references for you, is that right? And is that crazy?

267
Hm. That seems wrong, but for different reasons. How do you know you're going to have place for 360 pixels? Or have 360 pixels to draw your circle in? I think theta step should depend on the radius.

268
Creative Projects / Re: Bay12 Writers Guild
« on: December 20, 2010, 08:26:27 am »
Silly, as it may sound, I'd still prefer the story be literature. And I hope that's possible based on a couple of facts: Harry Potter is considered literature despite its magic "gimmick", and Sherlock Holmes is considered literature despite its heavy reliance on random facts collected by a protagonist to further our interest.

-

So, despite myself, I've actually written some fanfiction recently. In screenplay form. You can check it out in this thread

269
Creative Projects / A couple of Christmas fanfiction screenplays.
« on: December 20, 2010, 08:20:28 am »
Yeah, I wrote some fanfiction in screenplay form for the December Challenge at this place. But I figured with your love for random, Bay12 might be interested in these pieces, too.

I'm kind of tempted to call some homages in these scripts "subtle", but it's for the reader to decide.

One more thing, critique totally accepted. Including "tl;dr" - that's important, too, as a screenplay should be, among other things, easily readable.

270
Well, trying to print a class containing a string (like a char string or String string) into a binary file, reading back gives segfault, if I remember correctly.

How where you telling it to print? I assume you weren't trying to print the class object directly unless you provided stream operators for it and were doing it that way?

The code just does what you tell it :) nothing more. Java will treat it the same way although there you override the toString() function rather than use stream operators.
Yes, I did, and I did like my C++ book told me (write(char *object, sizeof(object)), or something, I don't want to bother)! But I've encountered a couple of code samples from it that either didn't compile or didn't work as intended... So, why do you have to be so difficult, world?
Cat like? I'm not strapping my cat to my pc, if that's what you're getting at.
Cat like the cat command, ie something that spits the contents of the file out in a readable form. Strapping a cat to a your computer might do the trick, if it speaks Huffman, that is :P.
Hey, how do I tell if my cat speaks Huffman if I don't speak Huffman?

Pages: 1 ... 16 17 [18] 19 20 ... 73