ZDoom Haxe scripting test

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
mmm

ZDoom Haxe scripting test

Post by mmm »

Hey, folks.

I've been playing around with ZDoom source code over the weekend and managed to hook up the Haxe scripting language. I thought some of you might be interested in that so here's a link to the modified source code (no windows binaries, sorry, I'm a linux programmer): http://dl.dropbox.com/u/8725839/zdoomneko.7z

You can check out what Haxe language is here: http://haxe.org/doc. In short, it's very close to ActionScript/JavaScript. The variables are strictly-typed though. Haxe compiler translates .hx code files into Neko VM .n bytecode which is hooked up in ZDoom binary through calls to libneko. To compile the ZDoom code you will need libneko and libneko headers in addition to the usual dependencies. In the latest Ubuntu (10, and probably in 9 also, but I haven't checked) you can simply do "sudo apt-get install haxe neko neko-dev" to get all you need to play around with the code. The src/script* files contain everything related to the scripting on the engine level. If you want to take a look at what changes I made to the engine, find "mmm" string, it's mostly one-liners for script callback here and there.

The file script.n needs to be in the same folder as ZDoom executable. That's the bytecode generated from files in the script/ folder. To generate a new script.n file, you must run "haxe script.hxml" command in script/ folder. There is some basic stuff for the prototype. Files in script/lib/ folder are low-level interfaces to the ZDoom engine. Take a look at script/Main.hx, script/Actors.hx, script/Players.hx, that's where the user-level action is. It's a simple mini-game on top of Doom where all monsters drop blue bottles which give 1 experience on pickup. Each 10 experience raises player level and each level gives +20 max health in addition to the starting 50. Player dying does not reset his level/exp.

The modification is nowhere close to completion, there's just a few callbacks here and there to get a feel for it. And there are probably bugs there as well.
Gez
 
 
Posts: 17833
Joined: Fri Jul 06, 2007 3:22 pm

Re: ZDoom Haxe scripting test

Post by Gez »

Didn't notice this thread earlier. Odd that nobody seemed to have looked into it.

Not sure if this is really worth it though; Randy is (slowly...) working on a scripting system (see [wiki]DoomScript[/wiki]).
User avatar
Salad Viking
Posts: 752
Joined: Tue Apr 20, 2010 8:58 pm
Location: In high orbit

Re: ZDoom Haxe scripting test

Post by Salad Viking »

I would put my faith in Haxe over DoomScript. I don't think even Randy takes DoomScript seriously at this point.
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: ZDoom Haxe scripting test

Post by Nash »

Whoa, looks like somebody went ahead and did their own thing. :O This Haxe thing seems really powerful. Are you saying that low level engine stuff is exposed to the modder with this scripting system? That's bloody amazing.

Checking it out now...

EDIT: Argh no binaries. Maybe that's why this isn't getting any attention. Everyone is probably like "cool! ... so what does this do again?"
User avatar
Akira_98
Posts: 213
Joined: Sun Jun 27, 2010 2:45 pm
Location: AC District 7

Re: ZDoom Haxe scripting test

Post by Akira_98 »

Nash wrote:Argh no binaries. Maybe that's why this isn't getting any attention. Everyone is probably like "cool! ... so what does this do again?"
This. I would have been tempted to try to compile it myself, but the example only shows something that has been done in ACS/Decorate before. :?
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: ZDoom Haxe scripting test

Post by Enjay »

Yeah, I tried a quick build and, not surprisingly, it failed due to the missing neko files. Unfonrtunately I didn't have the time nor the inclination to install the additional stuff needed to get them.
Locked

Return to “Editing (Archive)”