Problem with Libraries

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
YGOFreak1997
Party member
Posts: 103
Joined: Sun Jan 22, 2012 4:29 pm
Location: Germany, Baden-Württemberg
Contact:

Problem with Libraries

Post by YGOFreak1997 » Fri Mar 16, 2012 8:26 pm

Hey Guys, you can call me a noob, but i just don't get my code to function. It's a problem with some Libraries i think. I just want to implement a few Libraries like parts of Hump and LUBE. AnAL is working, but with LUBE and the other things, iget an error, i'll upload a zipped version of my project so that you can test the code. Please help me, this is my very first game and i want that my multiplayer works ^^

P.S.: If you have any Ideas to make the code or the File management better, tell me, too, please ^^

YGOFreak1997 ^^
Attachments
TEST.rar
Here is the "Project File"
(28.09 KiB) Downloaded 75 times
Also look at my LÖVE-Tutorial-Youtube-Channel (German ^^)
GitHub Repo: Click Me!
Website: No, Me!
IndieDB: Or Maybe Me?

ÖBEY!

meoiswa
Prole
Posts: 48
Joined: Wed Mar 14, 2012 8:13 pm
Location: Venezuela

Re: Problem with Libraries

Post by meoiswa » Fri Mar 16, 2012 9:05 pm

Please make a .love file for upload, you can find several guides on how to make them in this very forum.
Write the ö of Löve with Alt+numPad(148) or Alt+numPad(153)

User avatar
trubblegum
Party member
Posts: 192
Joined: Wed Feb 22, 2012 10:40 pm

Re: Problem with Libraries

Post by trubblegum » Fri Mar 16, 2012 9:10 pm

What he said, and read the docs that come with the lib.
According to LUBE's docs, it has dependencies.

User avatar
YGOFreak1997
Party member
Posts: 103
Joined: Sun Jan 22, 2012 4:29 pm
Location: Germany, Baden-Württemberg
Contact:

Re: Problem with Libraries

Post by YGOFreak1997 » Fri Mar 16, 2012 9:47 pm

Yeah, but seriously, I don't understand them ^^

And by the way, what ist wrong with a .rar-File? Just change the extension in .love and it's fine!
Also look at my LÖVE-Tutorial-Youtube-Channel (German ^^)
GitHub Repo: Click Me!
Website: No, Me!
IndieDB: Or Maybe Me?

ÖBEY!

User avatar
tentus
Inner party member
Posts: 1059
Joined: Sun Oct 31, 2010 7:56 pm
Location: Appalachia
Contact:

Re: Problem with Libraries

Post by tentus » Fri Mar 16, 2012 9:54 pm

YGOFreak1997 wrote:And by the way, what ist wrong with a .rar-File? Just change the extension in .love and it's fine!
False.

Please check things before asserting them.
Kurosuke needs beta testers

User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Problem with Libraries

Post by Robin » Fri Mar 16, 2012 11:01 pm

Not everyone can open .rar-files.

For those who can't open it now, here's the proper .love:
TEST.love
(28.96 KiB) Downloaded 107 times
First of all, this:

Code: Select all

	hump.class = require ("Libraries/Class")

	hump.vector= require ("Libraries/vector.lua")

	hump.camera = require ("Libraries/Camera.lua")

	local gwee = require ("Libraries/gwee.lua")

	require ("Libraries/LUBE.lua")

	require ("Libraries/slither.lua")
should be:

Code: Select all

	hump = {}

	hump.class = require ("Libraries.class")

	hump.vector= require ("Libraries.vector")

	hump.camera = require ("Libraries.camera")

	local gwee = require ("Libraries.gwee")

	require ("Libraries.LUBE")

	require ("Libraries.slither")
This is very important. Otherwise, your game will not work.

Moving on, you write LUBE instead of lube, and you write lube.server and lube.client instead of lube.Server and lube.Client. You also need to write lube.Client.init. That's init, not Init.

At this point I stopped trying to fix your main.lua.
Help us help you: attach a .love.

User avatar
bartbes
Sex machine
Posts: 4944
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Problem with Libraries

Post by bartbes » Fri Mar 16, 2012 11:49 pm

The problem is, btw, that you should really require slither before lube. That shouldn't matter though, because if you're using a new enough version of hump.class you already have a Class Commons-compatible class lib.
Robin wrote: Moving on, you write LUBE instead of lube, and you write lube.server and lube.client instead of lube.Server and lube.Client. You also need to write lube.Client.init. That's init, not Init.
But not. The error is that he shouldn't be instantiating lube.Client or lube.Server (regardless of their spelling), but rather one of the subclasses. (So lube.udpClient or lube.tcpClient and lube.udpServer and lube.udpClient.)
Furthermore, you don't call init, that's what the class lib does for you when you create it.

It is, however, ambitious of you to try to use the library if you can't understand what the reference manual is saying. I agree, it is not newbie-friendly, but then, it isn't intended that way, it is a reference manual, and just that. I suggest you look up a tutorial (perhaps one linked in the thread) to get a grasp of what you're supposed to be doing, and then use the reference manual for its intended use, reference.

User avatar
YGOFreak1997
Party member
Posts: 103
Joined: Sun Jan 22, 2012 4:29 pm
Location: Germany, Baden-Württemberg
Contact:

Re: Problem with Libraries

Post by YGOFreak1997 » Sat Mar 17, 2012 9:56 am

Thank you very much ^^

Yeah i know it's difficult for a newbie like me to understand things like LUBE, but I just want to make a little Multiplayer Tank-Game, and i thought, LUBE is the right thing for that project.
It is, however, ambitious of you to try to use the library if you can't understand what the reference manual is saying. I agree, it is not newbie-friendly, but then, it isn't intended that way, it is a reference manual, and just that. I suggest you look up a tutorial (perhaps one linked in the thread) to get a grasp of what you're supposed to be doing, and then use the reference manual for its intended use, reference.
Yeah, i just didn't understand what you meant with the "Common classes" implementation...

But i now have another Problem: I'll reupload the file so that you can test it again. I get an error in the LUBE-File...
Attachments
TEST.love
The new version of my Testgame ^^
(29.22 KiB) Downloaded 71 times
Also look at my LÖVE-Tutorial-Youtube-Channel (German ^^)
GitHub Repo: Click Me!
Website: No, Me!
IndieDB: Or Maybe Me?

ÖBEY!

User avatar
bartbes
Sex machine
Posts: 4944
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Problem with Libraries

Post by bartbes » Sat Mar 17, 2012 10:00 am

This is an error you're likely to see a lot in your lua-life. If you see this, it means you called a function like this:

Code: Select all

class.method(args)
where it should've been:

Code: Select all

class:method(args)
(So a colon instead of a dot.)

User avatar
YGOFreak1997
Party member
Posts: 103
Joined: Sun Jan 22, 2012 4:29 pm
Location: Germany, Baden-Württemberg
Contact:

Re: Problem with Libraries

Post by YGOFreak1997 » Sat Mar 17, 2012 10:14 am

Thank you ^^

How you probably know by now, I am quite new to computer programming, but a class is kind of a program and a method is part of this "program" you can call within your code, right?

And if you say LUBE is too complicated for me, with what should I start instead? I just thought I set myself a goal which is not too difficult and I think i have found a good start...
Also look at my LÖVE-Tutorial-Youtube-Channel (German ^^)
GitHub Repo: Click Me!
Website: No, Me!
IndieDB: Or Maybe Me?

ÖBEY!

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 7 guests