Pages: 1
Author Topic: Lol  (63,562 Views)
Offline (Unknown gender) skarik

Member
Joined: Jul 2008
Posts: 46
View profile WWW
Posted on: May 16, 2009, 03:55:51 AM
Well, I was going to ask why draw_text doesn't work...and then I looked at the list of functions.

Anyhow, why aren't there any games with Enigma? For me, all I really need is draw_sprite, and I've got meself a game. I mean, should I make a really random game?

I noticed my little game's size is 632 kilobytes. Wicked!

Anyhow, how is C++ used in Game Maker Enigma? At the current state (r3) could I make my own objects and classes? Also, is it possible to get the window handle in C++?
I mean, how exactly is the C++ called? I can obviously see that cout isn't going to be working anytime soon. :P (That was a joke, by the way. I know where to use cout.)

I'm off to play Fallout 3. Bye bye!
Offline (Unknown gender) Rusky

Resident Troll
Joined: Feb 2008
Posts: 954
View profile WWW
Reply #1 Posted on: May 16, 2009, 09:52:29 PM
cpp { /* c++ here */ }
that would be how to use it. you can stick raw c++ in there and it just adds it in wherever the c++ block was. and technically, cout would actually work there, if you just #included it.
Offline (Unknown gender) skarik

Member
Joined: Jul 2008
Posts: 46
View profile WWW
Reply #2 Posted on: May 17, 2009, 02:08:03 AM
Quotetechnically, cout would actually work there, if you just #included it.
Yah, but nothing would show. I mean, unless I, like, output to a different stream or something...but I don't understand how any of that stuff works, just how to use it.

But hey! Cool! Time to try out some classes and shiz!
Offline (Unknown gender) skarik

Member
Joined: Jul 2008
Posts: 46
View profile WWW
Reply #3 Posted on: May 17, 2009, 07:29:39 PM
Okay, how the hell do the string functions work?

I swear, every time I try to do something, it gives me this crap on how it can't covert from a char to a string...that's with string_char_at()...but I mean, how else am I going to do it? So I try     cpp {
    i_char = main_string.at(i);
    }
and then it throws that it's a var struct? What the hell?

So I remove the C++ and change the i_char to a "var" and that line gives me no problems. Then I come to: i_index = ord(i_char)-32;
And it says that i_char is a std string again? Whut?!? So I do: cpp {
    i_index = i_char.at(0);
    }
And it says that it's a var struct? Wa!? So then I just do i_index = i_char; and it works! WHAT THE HELL? I THOUGHT I DECLARED i_index AS A double !! Epic Automatic casting or sompin'?

And so it works, but what the hell?

Really, the whole script makes no sense to me. var main_font;
main_font = argument3;

var main_string;
main_string = argument2;

var main_string_i_max;
main_string_i_max = string_length(main_string);

var i;
var i_char;
double i_index;

for (i = 0; i < main_string_i_max; i += 1)
{
    i_char = string_char_at(main_string,i);

    i_index = i_char;

    i_index = i_index - 32;
   
    draw_sprite(sprMainFont,i_index,argument0+(i*13),argument1);
}


Oh, and I can only get the first index (image_index zero) of a sprite to draw. Is that known?

But anyhow, this is pretty sexy. XD
Offline (Unknown gender) skarik

Member
Joined: Jul 2008
Posts: 46
View profile WWW
Reply #4 Posted on: May 17, 2009, 07:52:14 PM
Now I'm getting a bunch of weird stuff. It works one second and then dies the next.

http://www.box.net/shared/rf354umc01

It shows the code in the compiler box and then says something about an unexpected error or handle or event or something and it asks me if I would like to debug it with MSVC++ 2005.
Offline (Unknown gender) skarik

Member
Joined: Jul 2008
Posts: 46
View profile WWW
Reply #5 Posted on: May 24, 2009, 04:13:48 AM
So I'm guessing no one knows.

Okay, I abandoned Enigma for pure C++ anyways. XD
Offline (Unknown gender) score_under

Member
Joined: Aug 2008
Posts: 308
View profile
Reply #6 Posted on: May 24, 2009, 10:47:30 AM
Please don't.

Because I love C, and my C fanboyness tells me that C++ corrupts the mind! At least learn C before C++... please?

Then we can have fun doing things like:
int i;
char x[20];
for(i=0;i<20;i++)
{
  ((char*)i)[x]=0;
}


Hooray for messed up minds, yes, that sort of thing would actually work.
Offline (Unknown gender) sprintf()

Past Contributor
Joined: Apr 2008
Posts: 72
View profile
Reply #7 Posted on: May 24, 2009, 11:11:07 AM
You should learn C++ before C, or you risk picking up bad habits from C which are used to work around the features it doesn't have, which C++ does. C is a functional subset of C++. Anything you can do in C you can do in C++, so you wouldn't be missing anything. Or skip both, unless you have the masochistic desire to write a game in C++ ^_^
Offline (Unknown gender) skarik

Member
Joined: Jul 2008
Posts: 46
View profile WWW
Reply #8 Posted on: May 24, 2009, 06:24:12 PM
No, I'm not writing any games in C++, just wrapping DLL's in a DLL and shiz.

@score_under

Give me a minute to figure with that piece of code. That is freaking awesome.
Offline (Unknown gender) Rusky

Resident Troll
Joined: Feb 2008
Posts: 954
View profile WWW
Reply #9 Posted on: May 25, 2009, 09:47:26 PM
XD what a pointless, awesome piece of code.
C is for writing drivers and confusing, awesome code, not anything normal :P
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #10 Posted on: June 09, 2009, 07:46:45 PM
It's also for writing entire operating systems. And Dave's right; C will leave you with some nasty habits in C++.
Offline (Unknown gender) RetroX

Master of all things Linux
Contributor
Joined: Apr 2008
Posts: 1,055
View profile
Reply #11 Posted on: June 09, 2009, 10:32:57 PM
I thought Ubuntu and Fedora were made in C++. >_>

I've been foiled again!
Offline (Unknown gender) skarik

Member
Joined: Jul 2008
Posts: 46
View profile WWW
Reply #12 Posted on: June 13, 2009, 05:55:00 AM


Nope, I'm pretty sure that's C++ there.
Pages: 1