Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 612 613 [614] 615 616 ... 796

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

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9195 on: March 04, 2016, 09:58:54 pm »

DF has things like [PLANT:MANGO:FRUIT]

I need to he able to set properties for either specifically mango fruits, or all fruits, or any part of a mango tree, or any plant, and have the more specifically set properties take priority.

For example, I have a generic green set for [*:*:LEAF], which will apply that color to all leaves that are in the game, while I also have more specific colors set for individual species. For example, a deeper, dark green for [PLANT:MANGO:LEAF].
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #9196 on: March 05, 2016, 01:22:35 am »

That sounds a lot like css, haha.

To test whether two intervals [a,b] and [c, d] overlap, you need only two comparisons: (a < d) AND (c < b).
I see. I have no idea why I didn't think of that :v
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

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9197 on: March 05, 2016, 01:53:57 am »

Depending on the context you should select between < and <=. It depends on whether the thing is continuous (e.g. times "5pm-6pm" and "6pm-7pm" do not overlap) vs discrete ("boxes 5-6" overlaps with "boxes 6-7").

itisnotlogical

  • Bay Watcher
  • might be dat boi
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9198 on: March 05, 2016, 09:17:10 am »

I'm creating an extremely low-budget turn-based tactical combat strategy sort of thing in Unity. I want to make it so that when one unit is firing at another you might get a cool cinematic camera, like with VATS in the Fallout games. Not quite as strict and pre-defined as XCOM, since my game isn't tile-based at all. What are some suggestions to accomplish this in a way that won't make me tear my hair out later?
Logged
This game is Curtain Fire Shooting Game.
Girls do their best now and are preparing. Please watch warmly until it is ready.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9199 on: March 05, 2016, 01:22:53 pm »

tear your hair out over it later

DragonDePlatino

  • Bay Watcher
  • [HABIT:COLLECT_WEALTH]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9200 on: March 05, 2016, 01:58:42 pm »

Well, you might want to screw with arrays if your code needs to be at all efficient with resources.

Thank you! After floundering around for a while I got my entity_defs.h to work with plain arrays and const char* arrays. No idea what was causing the original error but it's cleaned itself up now.

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: if self.isCoder(): post() #Programming Thread
« Reply #9201 on: March 05, 2016, 04:34:47 pm »

I'm creating an extremely low-budget turn-based tactical combat strategy sort of thing in Unity. I want to make it so that when one unit is firing at another you might get a cool cinematic camera, like with VATS in the Fallout games. Not quite as strict and pre-defined as XCOM, since my game isn't tile-based at all. What are some suggestions to accomplish this in a way that won't make me tear my hair out later?
I'd do it by adding a check to whatever script handles attacks to see if coolcamera is enabled, if a random number is higher than a certain threshold, and if the shot is actually going to hit/kill the target.
If all those are true, a call a function that makes the camera rotate around the target/projectile/general vicinity/whatever.
You'll probably need to tear your hair out later no matter what you do, though. Just take lots of supplements now so you'll have plenty of hair for tearing out put a bit of effort into doing all the normal stuff that you do to keep code maintainable.

...

Speaking of maintainable code, How To Write Unmaintainable Code. It actually has a lot of good advice presented in a slightly awkward fashion. Also very fun to read.
Logged
Please don't shitpost, it lowers the quality of discourse
Hard science is like a sword, and soft science is like fear. You can use both to equally powerful results, but even if your opponent disbelieve your stabs, they will still die.

EnigmaticHat

  • Bay Watcher
  • I vibrate, I die, I vibrate again
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9202 on: March 05, 2016, 08:53:16 pm »

I'm creating an extremely low-budget turn-based tactical combat strategy sort of thing in Unity. I want to make it so that when one unit is firing at another you might get a cool cinematic camera, like with VATS in the Fallout games. Not quite as strict and pre-defined as XCOM, since my game isn't tile-based at all. What are some suggestions to accomplish this in a way that won't make me tear my hair out later?
Implement a third person shooter style camera, swap to it whenever you want to go all cinematic.
Logged
"T-take this non-euclidean geometry, h-humanity-baka. I m-made it, but not because I l-li-l-like you or anything! I just felt s-sorry for you, b-baka."
You misspelled seance.  Are possessing Draignean?  Are you actually a ghost in the shell? You have to tell us if you are, that's the rule

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: if self.isCoder(): post() #Programming Thread
« Reply #9203 on: March 06, 2016, 10:28:35 pm »

Why do I suck so badly at Java? I don't have any criticisms I've just never struggled this much with a lang before and I'm not new to OOP either (never had problems writing in VB, C++, Python, PHP, HTML, MySQL). Something about Java just fries my brain whenever I look at it.
« Last Edit: March 06, 2016, 10:45:23 pm by GUNINANRUNIN »
Logged

DragonDePlatino

  • Bay Watcher
  • [HABIT:COLLECT_WEALTH]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9204 on: March 06, 2016, 11:09:30 pm »

In your defense, the first time I saw Java programming (and programming in general) I nope'd right outta there. I started with Bucky's tutorials and to get the basic Hello World, you had to type:
Code: [Select]
public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello, World");
    }
}

I understand what that all means now but for someone learning the language it's far more confusing than Python or C++'s Hello World. Java always felt unnecessarily verbose to me which is why I've never learned it. :/

EnigmaticHat

  • Bay Watcher
  • I vibrate, I die, I vibrate again
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9205 on: March 06, 2016, 11:12:58 pm »

Yeah the big string of "public static cheeseburger void" some languages have means that hello world tutorials are not as simple looking as they're meant to be.
Logged
"T-take this non-euclidean geometry, h-humanity-baka. I m-made it, but not because I l-li-l-like you or anything! I just felt s-sorry for you, b-baka."
You misspelled seance.  Are possessing Draignean?  Are you actually a ghost in the shell? You have to tell us if you are, that's the rule

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9206 on: March 07, 2016, 12:14:27 am »

Well once you start coding in somebody else's framework or library, e.g box2D or SFML in C++, you get used to a lot of this.that.theOther. Java just has that level of complexity built right into the foundation.

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: if self.isCoder(): post() #Programming Thread
« Reply #9207 on: March 07, 2016, 12:18:24 am »

it's far more confusing than Python or C++'s Hello World.
There's a language with syntax less confusing than python Hello World?
Logged
Please don't shitpost, it lowers the quality of discourse
Hard science is like a sword, and soft science is like fear. You can use both to equally powerful results, but even if your opponent disbelieve your stabs, they will still die.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9208 on: March 07, 2016, 12:20:34 am »

Lua:

Code: [Select]
print('Hello, world!')
Now, for Python, which of these is correct:

Code: [Select]
print('Hello, world!')

Code: [Select]
print 'Hello, world!'

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: if self.isCoder(): post() #Programming Thread
« Reply #9209 on: March 07, 2016, 12:35:55 am »

I feel like my entire world has been crushed.
Logged
Please don't shitpost, it lowers the quality of discourse
Hard science is like a sword, and soft science is like fear. You can use both to equally powerful results, but even if your opponent disbelieve your stabs, they will still die.
Pages: 1 ... 612 613 [614] 615 616 ... 796