• What do you need help with? V. 3.0
    4,884 replies, posted
[QUOTE=esalaka;33333822]...Make the sprite a private member, then?[/QUOTE] But then I'd have to make a private member for the sprite, for the leaning left image, for the leaning right image, for the thrusting forward image, the "backing" image and so on. Isn't there any other way that I can access things from player() in tick()?
[QUOTE=Swebonny;33356751]Put your lua file in a folder and then drag it to LÖVE.[/QUOTE] Tried that, but I got errors. I even named it 'main.lua' I'll have to look it over. Thanks Swebonny.
[QUOTE=Samuka97;33356854]But then I'd have to make a private member for the sprite, for the leaning left image, for the leaning right image, for the thrusting forward image, the "backing" image and so on. Isn't there any other way that I can access things from player() in tick()?[/QUOTE] I don't understand your problem; it should be the exact same code, except that you move the "type definitions" from the constructor to the class members.
[QUOTE=DerpHurr;33356960]Tried that, but I got errors. I even named it 'main.lua' I'll have to look it over. Thanks Swebonny.[/QUOTE] What error exactly?
[QUOTE=ZeekyHBomb;33356967]I don't understand your problem; it should be the exact same code, except that you move the "type definitions" from the constructor to the class members.[/QUOTE] If I did it the way (that I think) you're telling me to do, I would have to do something like this: [cpp]Player::Player(double x, double y, bool alive, int frame, sf::Image img_pship_left_01, sf::Image img_pship_left_02, sf::Image img_pship_right_01, sf::Image img_pship_right_02, sf::Image img_pship_forward_01, sf::Image img_pship_forward_02)[/cpp] ...and so on with all the images I'd need, right? Or am I missing something here?
[QUOTE=Samuka97;33357033]If I did it the way (that I think) you're telling me to do, I would have to do something like this: [cpp]Player::Player(double x, double y, bool alive, int frame, sf::Image img_pship_left_01, sf::Image img_pship_left_02, sf::Image img_pship_right_01, sf::Image img_pship_right_02, sf::Image img_pship_forward_01, sf::Image img_pship_forward_02)[/cpp] ...and so on with all the images I'd need, right? Or am I missing something here?[/QUOTE] Well, that's one way of doing it, obviously. Show us how exactly you're doing it now so we can react better? (If it's already here, someone link me please)
There are not member variables, these are parameters. Those would as well be destructed when the function returns. You want member in the class [cpp]class A { int thisIsAMemberVariable; };[/cpp] What or whom did you learn C++ from?
I'm writing an IRC bot in C#. Using the SmartIRC4Net library. I'm trying to add a OnJoin event handler. My code: [CODE] irc.OnQueryMessage += new IrcEventHandler(OnQueryMessage); irc.OnError += new ErrorEventHandler(OnError); irc.OnRawMessage += new IrcEventHandler(OnRawMessage); irc.OnChannelMessage += new IrcEventHandler(OnChannelMessage); irc.OnJoin += new IrcEventHandler(OnJoin); [/CODE] All of the code is fine, except for OnJoin, which results in the error "No overload for 'OnJoin' matches delegate 'Meebey.SmartIrc4net.IrcEventHandler'" No clue what the problem/solution is.
[QUOTE=DerpHurr;33356960]Tried that, but I got errors. I even named it 'main.lua' I'll have to look it over. Thanks Swebonny.[/QUOTE] Didn't you have to drag the FOLDER that [I]contains [/I]main.lua to Love? [editline]20th November 2011[/editline] If you're not interested in Love2d but just in running Lua, I too started reading exactly that today. I found [url]http://code.google.com/p/luaforwindows/[/url] to be working quite well. I think you'll be able to double-click .lua files if you install that. Otherwise you can run "lua main.lua" in a command prompt.
[QUOTE=ZeekyHBomb;33357188]There are not member variables, these are parameters. Those would as well be destructed when the function returns. You want member in the class [cpp]class A { int thisIsAMemberVariable; };[/cpp] What or whom did you learn C++ from?[/QUOTE] ...Oh. From what I read online I had to include every variable in the class's declaration (and I didn't want to do that because it would result in a huge mess), but what you're telling me is that I don't? Also whenever I have / get suggested / want to learn something new about C++ I just jump into Google and search for it, don't have a specific website I go to. I also have a book called "C++ Primer Plus (5th Edition)", but I only read it when I'm bored/at class/etc because googling usually gets me there faster without having to turn my closet upsidedown to get it out of there :v:
What would be fastest? [cpp] Class::Class() : m_data1(0), m_data2("data") { } [/cpp] or [cpp] Class::Class() { m_data1 = 0; m_data2 = "data"; } [/cpp] ?
[QUOTE=Samuka97;33357265]...Oh. From what I read online I had to include every variable in the class's declaration (and I didn't want to do that because it would result in a huge mess), but what you're telling me is that I don't?[/QUOTE] I am :) Also, that's not the class's declaration, but its constructor. At least I'm assuming you meant that. [QUOTE=Samuka97;33357265]Also whenever I have / get suggested / want to learn something new about C++ I just jump into Google and search for it, don't have a specific website I go to. I also have a book called "C++ Primer Plus (5th Edition)", but I only read it when I'm bored/at class/etc because googling usually gets me there faster without having to turn my closet upsidedown to get it out of there :v:[/QUOTE] Then dig it up once and leave it lying beside your computer.
[QUOTE=Naarkie;33357203]I'm writing an IRC bot in C#. Using the SmartIRC4Net library. I'm trying to add a OnJoin event handler. My code: [CODE] irc.OnQueryMessage += new IrcEventHandler(OnQueryMessage); irc.OnError += new ErrorEventHandler(OnError); irc.OnRawMessage += new IrcEventHandler(OnRawMessage); irc.OnChannelMessage += new IrcEventHandler(OnChannelMessage); irc.OnJoin += new IrcEventHandler(OnJoin); [/CODE] All of the code is fine, except for OnJoin, which results in the error "No overload for 'OnJoin' matches delegate 'Meebey.SmartIrc4net.IrcEventHandler'" No clue what the problem/solution is.[/QUOTE] The OnJoin event expects a JoinEventHandler delegate. So you need to do [csharp]irc.OnJoin += new JoinEventHandler(OnJoin); void OnJoin(object sender, JoinEventArgs e) { }[/csharp]
[QUOTE=Darkwater124;33356990]What error exactly?[/QUOTE] Well here is the code it told me to input: function fact (n) if n == 0 then return 1 else return n * fact(n-1) end end print("enter a number:") a = io.read("*number") -- read a number print(fact(a)) Im totally a beginner at this, so im not sure if it's supposed to run or not.
[QUOTE=likesoursugar;33357364]What would be fastest? [cpp] Class::Class() : m_data1(0), m_data2("data") { } [/cpp] or [cpp] Class::Class() { m_data1 = 0; m_data2 = "data"; } [/cpp] ?[/QUOTE] The first one becomes a call to the constructor for each member, the second one becomes a call to the default constructor and then the copy constructor. The first one is potentially faster.
[QUOTE=likesoursugar;33357364]What would be fastest? [cpp] Class::Class() : m_data1(0), m_data2("data") { } [/cpp] or [cpp] Class::Class() { m_data1 = 0; m_data2 = "data"; } [/cpp] ?[/QUOTE] The former directly constructs the objects. The latter uses the default constructor, followed by the assignment operator. It might get optimized away for build-in types, but it'd be a tad faster with 'complex' types. [editline]20th November 2011[/editline] [QUOTE=Z_guy;33357418]The first one becomes a call to the constructor for each member, the second one becomes a call to the default constructor and then the assignment operator. The first one is potentially faster.[/QUOTE] FTFY
I switched my C++ SFML project's runtime library from 'Multi-threaded DLL (/MD)' to 'Multi-threaded (/MT)' because I wanted my program to run without installing the runtime library on the computer. It now spits errors at my face. [code]1>msvcrt.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj) 1>msvcrt.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj) 1>LIBCMT.lib(crt0init.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library 1>E:\Documents\Visual Studio 2010\Projects\sfml_test\Release\sfml_test.exe : fatal error LNK1169: one or more multiply defined symbols found[/code] [editline]20th November 2011[/editline] [QUOTE=DerpHurr;33357398]Well here is the code it told me to input: function fact (n) if n == 0 then return 1 else return n * fact(n-1) end end print("enter a number:") a = io.read("*number") -- read a number print(fact(a)) Im totally a beginner at this, so im not sure if it's supposed to run or not.[/QUOTE] Are you trying to run this in Love2d? Because your supposed to run this in a lua interpreter. Love2d is for when you actually start doing graphical stuff.
[QUOTE=high;33357390]The OnJoin event expects a JoinEventHandler delegate. So you need to do [csharp]irc.OnJoin += new JoinEventHandler(OnJoin); void OnJoin(object sender, JoinEventArgs e) { }[/csharp][/QUOTE] Sanku :D
[QUOTE=DeadKiller987;33357493]I switched my C++ SFML project's runtime library from 'Multi-threaded DLL (/MD)' to 'Multi-threaded (/MT)' because I wanted my program to run without installing the runtime library on the computer. It now spits errors at my face. [code]1>msvcrt.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj) 1>msvcrt.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj) 1>LIBCMT.lib(crt0init.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library 1>E:\Documents\Visual Studio 2010\Projects\sfml_test\Release\sfml_test.exe : fatal error LNK1169: one or more multiply defined symbols found[/code][/QUOTE] I think you also need to build SFML against the static library then. Or you can just supply the runtime dlls along your program; not sure on the license there though.
[QUOTE=DeadKiller987;33357493]I switched my C++ SFML project's runtime library from 'Multi-threaded DLL (/MD)' to 'Multi-threaded (/MT)' because I wanted my program to run without installing the runtime library on the computer. It now spits errors at my face. [code]1>msvcrt.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj) 1>msvcrt.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj) 1>LIBCMT.lib(crt0init.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library 1>E:\Documents\Visual Studio 2010\Projects\sfml_test\Release\sfml_test.exe : fatal error LNK1169: one or more multiply defined symbols found[/code] [editline]20th November 2011[/editline] Are you trying to run this in Love2d? Because your supposed to run this in a lua interpreter. Love2d is for when you actually start doing graphical stuff.[/QUOTE] What's a good Lua Interpreter then?
[QUOTE=ROBO_DONUT;33356333]Do you need a documentation to double-click a '.msi' file in Windows? No, because it's simple, consistent and common. In Linux, you build software with './configure && make -j5 && sudo make-install'. It then installs to /usr/local/, unless you've overridden the install path for configure and make using the 'PREFIX' environment variable and '--prefix' argument. The issue isn't lack of documentation, the issue is that you don't know how to function in a unix-like environment.[/QUOTE] I suppose that's right. A double click is so much simpler. The trade off is the ability to customize, and I guess that's what Linux does best. Anyway, I've run 'make install' and it makes cygcaca.dll, not libcaca.dll (it does however make libcaca.dll.a but I don't think that's related). Do I have to cross compile? What would the "host" be set to?
[QUOTE=DerpHurr;33357680]What's a good Lua Interpreter then?[/QUOTE] [url=http://code.google.com/p/luaforwindows/]Lua For Windows[/url]
[QUOTE=Hypershadsy;33358002]I suppose that's right. A double click is so much simpler. The trade off is the ability to customize, and I guess that's what Linux does best. Anyway, I've run 'make install' and it makes cygcaca.dll, not libcaca.dll (it does however make libcaca.dll.a but I don't think that's related). Do I have to cross compile? What would the "host" be set to?[/QUOTE] While MinGW and Cygwin both provide unix-like build environments, MinGW runs natively, while Cygwin provides full posix emulation through libcygwin. So if you want to build native binaries (if it's possible for that particular library), you'll need to build with MinGW instead of Cygwin.
[QUOTE=ZeekyHBomb;33357371]I am :) Also, that's not the class's declaration, but its constructor. At least I'm assuming you meant that. Then dig it up once and leave it lying beside your computer.[/QUOTE] Yeah - that's what I meant, I'm a little rusty. Been a while since I've programmed anything. Well, thanks for the help :rolleyes:
./configure --enable-win32 --enable-csharp [img_thumb]http://dl.dropbox.com/u/21571661/Pictures/meen_goow.png[/img_thumb] Man, it's always something. I don't even WANT OpenGL support, so why's ftgl in there?
I'm trying to create a basic tile map, I'm currently using a single dimension array, whats the best way to create layers in the tiles instead of having them in one massive line?
The check is broken, or your version of autotools is broken. That's why it's complaining. [editline]20th November 2011[/editline] @Hypershadsy
[QUOTE=esalaka;33360651]The check is broken, or your version of autotools is broken. That's why it's complaining. [editline]20th November 2011[/editline] @Hypershadsy[/QUOTE] I don't see why the script should break, it worked fine in Cygwin. And this version of autotools is straight from mingw-get install autotools.
My socket seems to not be sending anything, I make one client and on the second connect to the server the server doesn't send the entities but does send the map name and etc. I even tried with 2 separate clients. I don't know why it does this since each client is handled separately. I don't know what I should be showing for this so please tell me what I should show first.
[QUOTE=Hypershadsy;33365064]I don't see why the script should break, it worked fine in Cygwin. And this version of autotools is straight from mingw-get install autotools.[/QUOTE] Some googling suggests that you need to install pkg-config.
Sorry, you need to Log In to post a reply to this thread.