[QUOTE=bromvlieg;25658093]Its my mic being an emo, buyed a new one today >.>, and damn youtube doenst let me remove audio[/QUOTE]
It helps if you speak normally instead of whispering.
[QUOTE=r4nk_;25661236][lua]
class 'TestChat' (ChatScript)[/lua][/QUOTE]
Ooh, functions returning closures. :3:
Would you mind telling what kind of a closure 'class' returns?
[QUOTE=r4nk_;25661236]<Snip>
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!' )
elseif option == 2 then
setOptions( 'Quit job and ban self' )
dialogWindow:setText( 'WHO THE HELL ARE YOU TO GIVE ADVICE TO ME' )
elseif option == 3 then
dialogWindow:setText( 'Efex is a gentleman' )
setOptions( 'No meme here' )
end
end
[/lua]
<Snip>[/QUOTE]
It looks like a logical way of doing things, however I'm not sure why your example works - Shouldn't there also be a "getPlayerResponse()" call after the second set of options so that it doesn't just close the screen after the first input ? What I mean is, with your current example why does it wait for you to click "Okay" / "Quit" / "No meme" ?
[QUOTE=esalaka;25661414]Ooh, functions returning closures. :3:
Would you mind telling what kind of a closure 'class' returns?[/QUOTE]
To be honest I have no idea what you are talking about. I haven't used Lua on its own, outside of my own programming projects. And I always use luabind for my projects. What that is (to me), is inheriting from a base 'class' (luabind specific stuff..) called ChatScript. Here is the chat script file:
[lua]
class 'ChatScript'
function ChatScript:__init()
end
function ChatScript:run()
end
[/lua]
Nothing in there for now... Just there for if/when I need to add common things for every chat script. Sorry if this doesn't really answer your question, [url="http://www.rasterbar.com/products/luabind/docs.html#defining-classes-in-lua"]here is the luabind reference[/url] if you are interested in more luabind stuff.
[editline]27th October 2010[/editline]
[QUOTE=yngndrw;25661531]It looks like a logical way of doing things, however I'm not sure why your example works - Shouldn't there also be a "getPlayerResponse()" call after the second set of options so that it doesn't just close the screen after the first input ? What I mean is, with your current example why does it wait for you to click "Okay" / "Quit" / "No meme" ?[/QUOTE]
Very observant haha. It doesn't... I literally just got this in, so currently it doesn't close the dialog box once the chat script ends, which I am about to add right now. But yes you are very correct there should be another getPlayerResponse :smile:
It's pretty cool that just by looking at that script, you can clearly see that there should be something like that there. Must mean it's easy to follow. I'll change the code in my other post so as not to confuse anyone...
[QUOTE=r4nk_;25661697]To be honest I have no idea what you are talking about. I haven't used Lua on its own, outside of my own programming projects. And I always use luabind for my projects. What that is (to me), is inheriting from a base 'class' (luabind specific stuff..) called ChatScript.[/QUOTE]
Oh, ok. It just looked like class is a function of the form [lua]function class( classname )
return function( parent ) --[[do something]]-- end
end[/lua]
That's why I asked.
[QUOTE=Mattz333;25660525]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:[/QUOTE]
MIPS is nice for an assembly language! The book I'm reading (Computer Organisation and Design), on the other hand, describes x86 as "difficult to explain and impossible to love".
[QUOTE=esalaka;25661949]Oh, ok. It just looked like class is a function of the form [lua]function class( classname )
return function( parent ) --[[do something]]-- end
end[/lua]
That's why I asked.[/QUOTE]
By the looks of it, that is what it does.
Well since everyone is now apparently doing text adventures (textcraft, rtaadventures, etc.) I'm going to jump on the bandwagon.
Except basically I'm going to be designing a fake 'operating system' and using that as an RPG.
At the moment it's going to be console based, and I'm going to implement either Lua or Python for it so I can make 'programs'.
Time to go download hue.
Maybe I'll make it multiplayer later.
That'll be fun, a multiplayer hack fest.
What a minute, thats a great idea.
[QUOTE=r4nk_;25661236]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.[/QUOTE]
You could make it a lot nicer by loading from files, then you could just use the same code to process all dialogs. Depends how much you're going to make though - also it probably wouldn't be as readable with the trees and stuff.
[QUOTE=neos300;25662545]Maybe I'll make it multiplayer later.
That'll be fun, a multiplayer hack fest.
What a minute, thats a great idea.[/QUOTE]
Yeah, WHAT a minute! ;)
I had a similar idea a few years ago, never got very far with it, though.
Good luck with yours!
[QUOTE=Z_guy;25663949]Yeah, WHAT a minute! ;)
I had a similar idea a few years ago, never got very far with it, though.
Good luck with yours![/QUOTE]
Yeah, I started but now I remebered that I have a 2 papers due this week for school so I'll work on it over the weekend.
[QUOTE=esalaka;25661050]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.[/QUOTE]
Welcome to the build system war. :black101:
On a build system related note, I'm currently trying to get "subscripts" to work with bit. The way the backend works (as I may have explained before), is there is a Workspace, where every project is placed, and registered for use, and the way the current bitfile is used, is via exec(), which basically allows for a continuous system of execution, where the local and global stated are shared across all instances (in addition, the exec() function does *not* create a subprocess, or fork, or thread, so this isn't something to be extremely worried about). What this means is that you can have sub bitfiles, much like CMake, or Scons, or waf, or eve plain old Make support. As for the syntax, I'm currently using "bit.add_file(path)". In addition, this means that you can register dependencies with one of the older functions from 0.2, which is "require", which takes a project instance. Luckily, even if an instance appears to no longer be available (due to the with keyword), you can still call it via the global Workspace instance (which is a monostate instance, in that all instances are the same no matter where or how many times you instance it), by accessing the name of the project, so something like
[code]
with Project('supah-fresh') as supah:
supah.require(bit.projects['ice-t'])
supah.require(bit.projects['gbdc'])
[/code]
And what happens on the backend is the ice-t, and gbdc projects are removed from the main "run list" (i.e. they won't be run twice), but the instance in the bit.projects still remains (also, remember everything is passed by reference in Python, unless it is immutable), so more than one project can require bit.projects['ice-t']. This is effectively going to change a bit of the backend (as I'm going to need to implement a faux reference to make sure a project doesn't try to rebuild any project while it is actively being built. Or I could just place everything in a tree, and walk through it that way :v:)
[QUOTE=neos300;25662545]Well since everyone is now apparently doing text adventures (textcraft, rtaadventures, etc.) I'm going to jump on the bandwagon.
Except basically I'm going to be designing a fake 'operating system' and using that as an RPG.
At the moment it's going to be console based, and I'm going to implement either Lua or Python for it so I can make 'programs'.
Time to go download hue.
Maybe I'll make it multiplayer later.
That'll be fun, a multiplayer hack fest.
What a minute, thats a great idea.[/QUOTE]
I started a bandwagon? :iia:
Atleast i can't remember any text adventure projects before textcraft, and some time before that. :v:
Why does everyone and their dog write their own build system?
[QUOTE=NovembrDobby;25663946]You could make it a lot nicer by loading from files, then you could just use the same code to process all dialogs. Depends how much you're going to make though - also it probably wouldn't be as readable with the trees and stuff.[/QUOTE]
It's really a lot nicer as a Lua file. It lets me add game events directly into the chat script, for example:
[lua]function Shop:run()
dialogWindow:setText( 'What item would you like to buy?' )
setOptions( shopKeeper:getItemList() )
local option = getPlayerResponse()
player.addItem( shopKeeper:getItemList()[option].item )
player.removeMoney( shopKeerp:getItemList()[option].price )
dialogWindow:setText( 'You bought: ' .. shopKeeper:getItemList()[option].name )
setOptions( 'Thanks.' )
getPlayerResponse()
end[/lua]
I just pulled that code out of my arse so ignore any syntax errors
[QUOTE=Jawalt;25664224]Why does everyone and their dog write their own build system?[/QUOTE]
I started writing mine because I found CMake to be frustrating for actively working on a project (change one file, and you have to regenerate everything), and it did not (at the time) easily allow for custom scripts and such at different phases of the build system.
In addition waf did not work on windows (and from what I understand support is still a little unstable, and shifts from change to change).
Scons is terrible. Always will be as long as they try to stay compatible with Python 1.5. And continue to use XML to generate everything.
Autoconf does not work well with non unix systems.
fabric requires SSH and OpenSSL installed.
Writing a Makefile is a painful experience.
I have no desire to learn the ins and outs of Ruby at this point in time so I can use a Rakefile
And I'm not about to use Maven, Groovy, CI Joe, MSBuild, XBuild, XCode, Ice, or any of the other "Sort of works on one system, but doesn't work everywhere".
Also almost all of the above use XML for their configuration files. So no thanks, broseph.
Then I began writing my own, because I couldn't build a project for the NDS and PSP at the same time, I needed to have two separate projects. And as I require more needs that are not met by the other build systems out there, I have continue to add on to my own.
Coincidentally, the NDS and PSP projects don't even exist anymore in any way shape or form.
Will that suffice for an answer? :)
[QUOTE=Chandler;25664572]rant list[/QUOTE]
What about Premake? ([URL]http://industriousone.com/premake[/URL])
Making a "parody" of Unifrog / Mr. Fap, but it won't be as good because it's a parody.
In a nutshell: You rate Zing!'s post Zing! and get money for it, which you can use to buy more upgrades to rate him zing faster and in cooler ways. (Any suggestions?)
[img]http://filesmelt.com/dl/Zingera.png[/img]
[img]http://filesmelt.com/dl/Zinger.png[/img]
It's got a twist as you can see! :v:
[B]Edit:[/B] Oh yeah, that name on the top changes with whatever name you choose. :haw:
[QUOTE=Dj-J3;25664194]I started a bandwagon? :iia:
Atleast i can't remember any text adventure projects before textcraft, and some time before that. :v:[/QUOTE]
Hey, hey. I want some credit. :v:
[img]http://gyazo.com/5b89bb4e32d182675cc66dfbc62f41c5.png[/img]
Pic related, it's a lazy attempt at an intro screen.
[QUOTE=VeryNiceGuy;25666183]Making a "parody" of Unifrog / Mr. Fap, but it won't be as good because it's a parody.
In a nutshell: You rate Zing!'s post Zing! and get money for it, which you can use to buy more upgrades to rate him zing faster and in cooler ways. (Any suggestions?)
[img_thumb]http://filesmelt.com/dl/Zingera.png[/img_thumb]
[img_thumb]http://filesmelt.com/dl/Zinger.png[/img_thumb]
It's got a twist as you can see! :v:
[B]Edit:[/B] Oh yeah, that name on the top changes with whatever name you choose. :haw:[/QUOTE]
This is possibly the most witty thing I've ever seen come out of you, Chad.
Much better than the "NOOOO!" button.
working on getting torrentflux working on my server again, one of the lines is spitting out a syntax error
[code]
def run(autoDie,shareKill,statusFile,userName,params):
if __debug__: traceMsg('run - begin')
try:
f=open(statusFile+".pid",'w')
f.write(str(getpid()).strip() + "\n")
f.flush()
f.close()
except:
if __debug__: traceMsg('run - Failed to Create PID file')
pass
try:
h = HeadlessDisplayer()
h.statFile = statusFile
h.autoShutdown = autoDie
h.shareKill = shareKill
h.user = userName
while 1:
try:
config = parse_params(params)
except ValueError, e:
print 'error: ' + str(e) + '\nrun with no args for parameter explanations'
break
if not config:
print get_usage()
break
myid = createPeerID()
seed(myid)
doneflag = Event()
def disp_exception(text):
print text
rawserver = RawServer(doneflag, config['timeout_check_interval'],
config['timeout'], ipv6_enable = config['ipv6_enabled'],
failfunc = h.failed, errorfunc = disp_exception)
upnp_type = UPnP_test(config['upnp_nat_access'])
while True:
try:
listen_port = rawserver.find_and_bind(config['minport'], config['maxport'],
config['bind'], ipv6_socket_style = config['ipv6_binds_v4'],
upnp = upnp_type, randomizer = config['random_port'])
break
except socketerror, e:
if upnp_type and e == UPnP_ERROR:
print 'WARNING: COULD NOT FORWARD VIA UPnP'
upnp_type = 0
continue
print "error: Couldn't listen - " + str(e)
h.failed()
return
response = get_response(config['responsefile'], config['url'], h.error)
if not response:
break
infohash = sha(bencode(response['info'])).digest()
dow = BT1Download(h.display, h.finished, h.error, disp_exception, doneflag,
config, response, infohash, myid, rawserver, listen_port)
if not dow.saveAs(h.chooseFile, h.newpath):
break
if not dow.initFiles(old_style = True):
break
if not dow.startEngine():
dow.shutdown()
break
dow.startRerequester()
dow.autoStats()
if not dow.am_I_finished():
h.display(activity = 'connecting to peers')
rawserver.listen_forever(dow.getPortHandler())
h.display(activity = 'shutting down')
dow.shutdown()
break
try:
rawserver.shutdown()
except:
pass
if not h.done:
h.failed()
finally:
if __debug__: traceMsg('run - removing PID file :'+statusFile+".pid")
remove(statusFile+".pid")
if __debug__: traceMsg('run - end')
[/code]
line in question,
[code]except ValueError, e:[/code]
i don't know any python, so any help would be appreciated
Is it confirmed that VNG is Chadmobile?
[QUOTE=Yumyumbubblegum;25668240]working on getting torrentflux working on my server again, one of the lines is spitting out a syntax error
[code]except ValueError, e:[/code]
i don't know any python, so any help would be appreciated[/QUOTE]
Try
[code]except ValueError as e:[/code]
thanks, that worked
[QUOTE=Robert64;25664383]public class TwinkleTwinkle : Choon
{
public TwinkleTwinkle()
{
myStandardBPM = 120;
}
protected override void Compose()
{
NoteTrack track = new NoteTrack( this );
double curTime = 0.0;
for( int i = 0; i < 2; ++ i )
{
track.AddNote( Note.C, 3, GetTime( curTime ++ ), GetTime( 0.5 ));
track.AddNote( Note.C, 3, GetTime( curTime ++ ), GetTime( 0.5 ));
track.AddNote( Note.G, 3, GetTime( curTime ++ ), GetTime( 0.5 ));
track.AddNote( Note.G, 3, GetTime( curTime ++ ), GetTime( 0.5 ));
track.AddNote( Note.A, 3, GetTime( curTime ++ ), GetTime( 0.5 ));
track.AddNote( Note.A, 3, GetTime( curTime ++ ), GetTime( 0.5 ));
track.AddNote( Note.G, 3, GetTime( curTime ++ ), GetTime( 1.0 ));
curTime ++;
track.AddNote( Note.F, 3, GetTime( curTime ++ ), GetTime( 0.5 ));
track.AddNote( Note.F, 3, GetTime( curTime ++ ), GetTime( 0.5 ));
track.AddNote( Note.E, 3, GetTime( curTime ++ ), GetTime( 0.5 ));
track.AddNote( Note.E, 3, GetTime( curTime ++ ), GetTime( 0.5 ));
track.AddNote( Note.D, 3, GetTime( curTime ++ ), GetTime( 0.5 ));
track.AddNote( Note.D, 3, GetTime( curTime ++ ), GetTime( 0.5 ));
track.AddNote( Note.C, 3, GetTime( curTime ++ ), GetTime( 1.0 ));
curTime = 32;
}
curTime = 16;
for( int i = 0; i < 2; ++ i )
{
track.AddNote( Note.G, 3, GetTime( curTime ++ ), GetTime( 0.5 ));
track.AddNote( Note.G, 3, GetTime( curTime ++ ), GetTime( 0.5 ));
track.AddNote( Note.F, 3, GetTime( curTime ++ ), GetTime( 0.5 ));
track.AddNote( Note.F, 3, GetTime( curTime ++ ), GetTime( 0.5 ));
track.AddNote( Note.E, 3, GetTime( curTime ++ ), GetTime( 0.5 ));
track.AddNote( Note.E, 3, GetTime( curTime ++ ), GetTime( 0.5 ));
track.AddNote( Note.D, 3, GetTime( curTime ++ ), GetTime( 1.0 ));
curTime ++;
}
SimpleOscillator synth = new SimpleOscillator( this, Waveform.Sinusoidal, track );
synth.Volume = 0.25;
Channels[ 0 ].Write( synth, 0.0 );
}
}:3:
A synth was actually pretty simple to write. I love messing around with audio buffers, it's much easier than I thought it would be.[/QUOTE]
Are you sure you want to do GetTime( curTime ++ ) ?
As it's the same as GetTime( curTime ); ++curTime;
I need your help
How would I use a hosts file to redirect website.com/page.aspx to a simple text file, I guess I need to setup a server first though :S
Ime getting really board trying to unlock weapons in bf2 :(
...
getout.jpg
[QUOTE=simie;25666138]What about Premake? ([URL]http://industriousone.com/premake[/URL])[/QUOTE]
Ahh I forgot this one.
At the time, I found it, the author of premake did not yet have XCode support (this has since been added), however I am not a fan of generative build systems during development (for distribution, I find them to be just fine)
Sorry, you need to Log In to post a reply to this thread.