Homicide13
Senior Member
Posts: 323
Threads: 41
Joined: Nov 2010
Reputation:
14
|
RE: [CHALLENGE THREAD]
Can you at least post the answer to the last challenge?
And I think the problem with participants is just because of the difficulty curve atm - to someone who doesn't know what classes are or how to use them, asking them to use classes in a complex way without even providing an example is rather intimidating, so of course it's going to scare people off. Just make things simpler and slowly increase the difficulty as people get more involved.
Plus you never submitted anything with the new challenge format, so you don't even know how well that will work.
Well those would just be my suggestions anyway.
|
|
04-14-2012, 05:22 PM |
|
Putmalk
Senior Member
Posts: 290
Threads: 13
Joined: Apr 2012
Reputation:
15
|
RE: [CHALLENGE THREAD]
Yeah, the challenges should be to craft a scenario that doesn't require advanced scripting knowledge. They should only involve situations that would be able to be solved the same way Frictional does in their original scripts (I don't remember them using classes in their .hps files?)
If so, a challenge like this would arise: There is a crank that affects a rope, separated by 3 pulley segments. The rope is attached to the door, and when the crank is turned, the rope pulls back and the door is swung open. However, there is an object stuck in the pulley system that is blocking the crank from working, and the door is blocked by a heavy object that needs to be pushed before the door can be opened.
That scenario, while still challenging for most forum users, would be solvable without classes, it just takes knowledge of the script functions.
(This post was last modified: 04-14-2012, 05:59 PM by Putmalk.)
|
|
04-14-2012, 05:59 PM |
|
nemesis567
Posting Freak
Posts: 874
Threads: 65
Joined: May 2011
Reputation:
10
|
RE: [CHALLENGE THREAD]
Ok... 12 more hours. No classes. If there are no participants, I quit.
Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
|
|
04-14-2012, 06:17 PM |
|
Homicide13
Senior Member
Posts: 323
Threads: 41
Joined: Nov 2010
Reputation:
14
|
RE: [CHALLENGE THREAD]
Well I still think using classes would be something important to learn. The problem is that for someone who doesn't know how to use them, they generally at least need an example of how to do it right or in what ways it can be applied, and a set of challenges that tries to teach a new idea should have a much gentler slope.
For example, when I tried to teach myself C++ back in middle school, I didn't start by making my own text editor or calculator or something. I learned how to write "hello world" to a command prompt, and went from there.
I myself am very interested in the use of classes, but I only have a vague understanding of what they are or how to use them. I certainly couldn't just start using them in this context - I would have to start with something much simpler.
As far as this challenge thread, I really like the idea, I just think you should give your challenges a learning curve - I would suggest thinking of a new challenge that introduces the idea of classes with an example, and then leading up to the current challenge with a set of intermediary challenges that slowly increase in difficulty.
That said, I will try to solve this challenge, but I'm not sure how far I'll get.
|
|
04-14-2012, 07:14 PM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: [CHALLENGE THREAD]
Classes are impractical in HPL2 anyway. But if you want to ever use HPL3, then you're going to need to know how to make use of interfaces and classes, how to instantiate a class, access class members, etc.
|
|
04-14-2012, 07:33 PM |
|
Homicide13
Senior Member
Posts: 323
Threads: 41
Joined: Nov 2010
Reputation:
14
|
RE: [CHALLENGE THREAD]
This is what I've been able to do with classes so far - it's just a simple script that fades the screen in and out every two seconds by using a class to call the FadeIn/Out functions instead of doing it normally.
http://www.mediafire.com/?fyv0kaloztgworc
However, what I don't understand so far is why I would use classes instead of just globally declaring everything.
Also I have no idea what class constructors are or what they're supposed to do.
|
|
04-14-2012, 08:10 PM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: [CHALLENGE THREAD]
(04-14-2012, 08:10 PM)Homicide13 Wrote: Also I have no idea what class constructors are or what they're supposed to do.
They're used to help construct the class (obviously). They are called at the time of instantiation; at this point you can assign values or instantiate other classes or call methods instead of doing all of this after instantiating the class. There are reasons why you would want to do this at the time of instantiation rather than after, but in your case these reasons aren't applicable (since you're using a class as nothing more than what a namespace is normally used for, technically speaking). If you don't define your own constructor, then the compiler will define one for you at compile time (which is just an empty constructor).
(This post was last modified: 04-14-2012, 08:39 PM by Your Computer.)
|
|
04-14-2012, 08:38 PM |
|
nemesis567
Posting Freak
Posts: 874
Threads: 65
Joined: May 2011
Reputation:
10
|
RE: [CHALLENGE THREAD]
(04-14-2012, 07:33 PM)Your Computer Wrote: Classes are impractical in HPL2 anyway. But if you want to ever use HPL3, then you're going to need to know how to make use of interfaces and classes, how to instantiate a class, access class members, etc. Yes they are. Mostly because not being able to declare global objects stops you from using them at full extention.
Tutorials are one of the worst learning methods for programming. That's it. You will not be prepared to program if you live on tutorials.
Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
(This post was last modified: 04-14-2012, 08:41 PM by nemesis567.)
|
|
04-14-2012, 08:39 PM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: [CHALLENGE THREAD]
(04-14-2012, 08:39 PM)nemesis567 Wrote: Mostly because not being able to declare global objects stops you from using them at full extention.
Homicide13's code declares a class in the global scope and also instantiates it in the global scope, so i'm not sure what you mean by "global" here.
|
|
04-14-2012, 08:47 PM |
|
nemesis567
Posting Freak
Posts: 874
Threads: 65
Joined: May 2011
Reputation:
10
|
RE: [CHALLENGE THREAD]
I don't know where is his code, but I was never able to declare a variable in the script's global scope(there is even a function for that!).
Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
|
|
04-14-2012, 08:51 PM |
|
|