[QUOTE=sim642;25652426]Can't this work when using simply std::cout and std:cerr?[/QUOTE]
Technically, only on POSIX systems, or any system that supports ANSI escape sequences. However on Windows, it would not work, as calls to the Win32 API are required. This is just a small simple way to ensure that a call on windows, works on OS X (and therefore FreeBSD), and Linux. Which is why I called it dumb, because it's quite small, and not a large feat of programming, nor did I spend a large amount of time on it.
I also forgot to mention that hue::console class is really just a container for the real "magic", which is the hue::writer class. You can initialize it like so.
[cpp]
#include <iostream>
#include <hue/writer.hpp>
#include <hue/color.hpp>
int main(void)
{
hue::writer output(std::cout);
hue::writer error(std::cerr);
hue::writer log(std::clog);
output << 1;/* blah */
/* you get the idea */
}
[/cpp]
BTW, I just push a fixed, so if you've downloaded and are using Hue, I highly suggest you grab the latest sources. I've fixed all foreseeable problems. Please let me know if you run into an issue :D
Working on my Excel Database:
[img]http://ahb.me/LDK[/img]
Here's the Tables worksheet:
[img]http://ahb.me/LDM[/img]
The Schema worksheet:
[img]http://ahb.me/LDN[/img]
The Data worksheet:
[img]http://ahb.me/LDO[/img]
And the amazing forumlae that make this happen:
[img]http://ahb.me/LDP[/img]
That's the first half of the setup. It's a bit hackish because what I'm doing is creating a bunch of cells with both the key and the values specified in the query:
[img]http://ahb.me/LDR[/img]
Once that selection table has been setup, it's a quick VLOOKUP to complete the query:
[img]http://ahb.me/LDS[/img]
:byodood:
I'm having trouble with the console color thing.
File: [url]http://dl.dropbox.com/u/5579836/Code/CPP/PROJ/main.cpp[/url]
Log: [url]http://dl.dropbox.com/u/5579836/Code/CPP/PROJ/PROJ.build.log[/url]
Am I doing something wrong?
[QUOTE=bromvlieg;25653495][media]http://www.youtube.com/watch?v=mFjSyr-tJYI[/media]
pppppproggres![/QUOTE]
Why does it sound like you're recording that in a cold dark prison cell? :O
[QUOTE=Ayra;25653761]I'm having trouble with the console color thing.
File: [url]http://dl.dropbox.com/u/5579836/Code/CPP/PROJ/main.cpp[/url]
Log: [url]http://dl.dropbox.com/u/5579836/Code/CPP/PROJ/PROJ.build.log[/url]
Am I doing something wrong?[/QUOTE]
several things.
1) You do not appear to be linking the actual library with your application. (You need to compile it first if you have not already).
2) Do not use std::cout. Instead, you declare the hue::console [i]first[/i], then access std::cout by calling "console.output". You also need to feed console.output which color you would like to use, if any at all.
Here's a fixed version of your code
[cpp]
#include <iostream>
#include <string>
#include <boost/algorithm/string.hpp>
#include <boost/foreach.hpp>
#include <hue/console.hpp>
#include <hue/color.hpp>
int main(void)
{
hue::console console;
console.output << hue::color::white << "Please enter your name: ";
std::string Sname;
std::getline(std::cin, Sname);
console.output << std::endl << hue:color::none << "Hello, " << hue::color::magenta
<< Sname << hue::color::none << "." << std::endl;
BOOST_FOREACH(char ch, Sname)
{
console.output << hue::color::yellow << ch;
}
console.output << std::endl;
return 0;
}
[/cpp]
[QUOTE=Z_guy;25653775]Why does it sound like you're recording that in a cold dark prison cell? :O[/QUOTE]
cus i left my window open too long :(
and its like, 3 a clock in the night when recorded it, so everyone's sleeping here..
[QUOTE=bromvlieg;25653495][media]http://www.youtube.com/watch?v=mFjSyr-tJYI[/media]
pppppproggres![/QUOTE]
Well I thought it was cool. Not sure why people thought it was dumb.
[QUOTE=bladerunner627;25649349]Wut?[/QUOTE]
Facepunch bug. It doesn't show in the edit box, it's not in the code, and wasn't on the pastebin I used.
[QUOTE=gparent;25655988]Facepunch bug. It doesn't show in the edit box, it's not in the code, and wasn't on the pastebin I used.[/QUOTE]
No-break spaces seem to be turned into asterisks on FP.
[QUOTE=esalaka;25656072]No-break spaces seem to be turned into asterisks on FP.[/QUOTE]
I rewrote that by erasing the whole tinyurl part and the stars were still there when I posted. I really have no idea why it would've appeared there.
[QUOTE=Ortzinator;25651484]That might as well be a Ribbon.[/QUOTE]
I thought about it, but it wouldn't really work now that it's a separate form. Besides, we can't have dev tools looking [i]nice[/i]! :v:
[QUOTE=Z_guy;25653775]Why does it sound like you're recording that in a cold dark prison cell? :O[/QUOTE]
Basement, duhhh :P
[QUOTE=bromvlieg;25653495][media]http://www.youtube.com/watch?v=mFjSyr-tJYI[/media]
pppppproggres![/QUOTE]
You sound like a serial killer.
[QUOTE=LiquidLight;25656780]You sound like a serial killer.[/QUOTE]
Not simply a serial killer, but a serial killer who can hack keypad lock, because he knows how to make one.
[QUOTE=bromvlieg;25653495][media]http://www.youtube.com/watch?v=mFjSyr-tJYI[/media]
pppppproggres![/QUOTE]
Are you using Microsoft Narrator or just your voice sound like it?
[QUOTE=bromvlieg;25653495][media]http://www.youtube.com/watch?v=mFjSyr-tJYI[/media]
pppppproggres![/QUOTE]
I can't decide. Is that your mouse clicking or water dripping?
[QUOTE=bobiniki;25657310]Are you using Microsoft Narrator or just your voice sound like it?[/QUOTE]
Its my mic being an emo, buyed a new one today >.>, and damn youtube doenst let me remove audio
[QUOTE=bromvlieg;25658093]Its my mic being an emo, buyed a new one today >.>, and damn youtube doenst let me remove audio[/QUOTE]
Yes it does.
Audioswap -> None.
Abusing reflection so I don't have to manually rename fields in this obfuscated assembly ftw.
[code]FieldInfo fi = typeof(fd).GetField("C");
fi.SetValue(obj, value);[/code]
Ugh, just asked this on StackOverflow and I am getting a lot of people taking it literally bullshit.
[QUOTE=Jallen;25658394]Yes it does.
Audioswap -> None.[/QUOTE]
it doenst give me such option >.>
Since I managed to get myself through a huge milestone with Lewt, I let myself experiment with the SFML Audio library.
[csharp]namespace CodeChoons.Choons
{
class TestChoon : Choon
{
public TestChoon()
{
myStandardBPM = 174;
}
protected override void Compose()
{
SoundChannel drums = DrumLoop();
Channels[ 0 ].Write( drums, 0.0, 100, GetTime( 8.0 ));
}
private SoundChannel DrumLoop()
{
SoundChannel drumChannel = new SoundChannel( this );
Sample bassDrum = Sample.Load( "BassDrums.bassdrum3", this );
bassDrum.Volume = 0.25;
Sample snareDrum = Sample.Load( "SnareDrums.snaredrum6", this );
snareDrum.Volume = 0.33;
drumChannel.Write( bassDrum, GetTime( 0.0 ));
drumChannel.Write( snareDrum, GetTime( 2.0 ));
drumChannel.Write( bassDrum, GetTime( 5.0 ));
drumChannel.Write( snareDrum, GetTime( 6.0 ));
drumChannel.Build();
return drumChannel;
}
}
}[/csharp]
That makes a standard Boom, Tish, Boom-Tish loop that repeats 100 times. I'm planning to add Synth classes etc later on.
Oh god, the code in this thread looks like heaven compared to the MIPS I've been staring at for the past 12 hours :sigh:
So I'm making a BSP loader, everything seems fine apart from lumps 8 and 15 have a length of 0. This sounds pretty strange because it's a L4D2 map and I'm pretty sure it has lighting. Is this normal or is it something wrong on my end?
[url]http://pastebin.com/cXyXZtnN[/url]
What about fortblox?
[QUOTE=layla;25660777]So I'm making a BSP loader, everything seems fine apart from lumps 8 and 15 have a length of 0. This sounds pretty strange because it's a L4D2 map and I'm pretty sure it has lighting. Is this normal or is it something wrong on my end?[/QUOTE]
liar
I'm still working on it, this is just something I wanted to do today.
Guys could someone please look at my problem in the What do you need help with? thread?
I've uploaded the exe so you can see what I mean: [url]http://filesmelt.com/dl/Clipping.rar[/url]
(Requires .NET 4)
In case someone wanted to know, I added a remote github repo to Alchemist. And some of the [url=http://github.com/esalaka/alchemist/commits/master]commit logs[/url] might or might not amuse someone.
Shit yeah, I finally implemented a cool feature I've always wanted to. I always wondered how you would create user friendly, easy to write and logical looking chat scripts. By that I mean, chat scripts that have a function like getUserResponse() and its blocking, but it doesn't block any other part of the games scripts. And I have finally done it:
(probably not worth screenshots for this but..)
[img]http://dl.dropbox.com/u/3589897/screenshots/DialogBox1.png[/img]
Becomes:
[img]http://dl.dropbox.com/u/3589897/screenshots/DialogBox2.png[/img]
From the simple Lua chat script:
[lua]
class 'TestChat' (ChatScript)
function TestChat:__init()
ChatScript.__init(self)
end
function TestChat:run()
dialogWindow:setText( 'Hi, what\'s your username?' )
setOptions( 'Zeeky', 'NullSquared', 'Efex' )
local option = getPlayerResponse()
if option == 1 then
setOptions( 'Okay...' )
dialogWindow:setText( 'Respected member selected!' )
getPlayerResponse()
elseif option == 2 then
setOptions( 'Quit job and ban self' )
dialogWindow:setText( 'WHO THE HELL ARE YOU TO GIVE ADVICE TO ME' )
getPlayerResponse()
elseif option == 3 then
dialogWindow:setText( 'Efex is a gentleman' )
setOptions( 'No meme here' )
getPlayerResponse()
end
end
[/lua]
You can see that you can add game logic after an option has been selected, and you can keep building the dialogue tree with more dialogues and statements, and leads to quite a natural to program and read script. But would probably be quite messy for large conversations. But basic game design tells you that you shouldn't have long ass text/dialogue screens.
Sorry, you need to Log In to post a reply to this thread.