Chaosforge Forum
DoomRL => Modding => Topic started by: Game Hunter on September 10, 2011, 21:54
-
There are a fair number of mods for DoomRL: unfortunately, almost all of them are made for versions prior to 0.9.9.4. Since I have a rudimentary knowledge of how modules work, I've taken it upon myself to update some mods to this version so that they can be played and used with "Custom Game". Below is a list of wads that I've finished so far (I've gotten permission from most of the creators; those people can ask me for the source code if they want to get at it):
Marine Base (http://dl.dropbox.com/u/33336094/marine_base.wad) (by Battleguy)
Angel of Patience (by Simon-v) (in use by author (http://forum.chaosforge.org/index.php/topic,3054.0.html))
Restless (http://dl.dropbox.com/u/33336094/restless.wad) (by Gargulec)
Invasion (http://dl.dropbox.com/u/33336094/invasion.wad) (by you)
Metal Gear (http://dl.dropbox.com/u/33336094/metal_gear.module.zip) (source, by Simon-v)
Just dump these into your modules folder and enjoy! And also please report any bugs because they're probably related to the porting process. I just made sure that they played for a couple of minutes, not for the entire playthrough.
-
I played Marine Base a few times and so far it has worked well.
-
\o/
-
The only wrong thing I experienced was that when I died and was shown the post-mortem, I press Enter and blood pours down. When the blood reveals the title screen for 98%, the red shit gets stuck for a little longer at the bottom of the screen then it's supposed to.
Oh, and the 'Restless' mod just crashes and quits the game when attempting to launch it. Right after the first trait choice.
-
The delay is normal -- DoomRL reloads all data files after a mod game.
-
I really think these should be released in raw format, like the original sandbox scripts were
-
I've looked through the code of the port and tweaked it a bit. It seems to work fine. I'm going to release an updated version eventually (a work-in-progress can be found here: http://dl.dropbox.com/u/23785083/DoomRL-Sandbox/0994/patience.module.zip (http://dl.dropbox.com/u/23785083/DoomRL-Sandbox/0994/patience.module.zip). In any case, thanks for reminding me how cool (and utterly infuriating to play) this little project of mine was.
-
Oh, and the 'Restless' mod just crashes and quits the game when attempting to launch it. Right after the first trait choice.
Same. Error log follows:
----------------------------------------------------------------------
Timestamp : 9/12/2011 18:44:55
Error level : FATAL EXCEPTION
Message : Fatal exception encountered
An unhandled exception occurred at $0042F285 :
ELuaException : require : Module "restless.module" not found!
$0042F285 LUA_VALKYRIE_REQUIRE, line 162 of d:/Projects/fpcvalkyrie/src/vlua.pas
$002554E1
$002558A2
$00255AC1
$0042F6D9
$00443AF8
$0041F8C6
$0041E3DA
$004022CA
----------------------------------------------------------------------
-
Sorry, I seem to have missed that report from yesterday. Apparently the require() function doesn't work very well with WAD files, even if it's fine with the raw module. A quick fix has been made, and I tested the WAD myself so it should be okay now.
Thanks for the reports.
-
I have modified the source of Angel of Patience and posted an updated version in the relevant thread. With that, i am back to actively maintaining it again.
-
Restless:
----------------------------------------------------------------------
Timestamp : 9/23/2011 7:21:27
Error level : ERROR
Message : Lua hook OnDie failed!
Hook name : beings[resigned].OnDie
Error message : Lua error : modules\restless.module\main.lua:408: attempt to read undeclared variable min
----------------------------------------------------------------------
Still runs more or less fine, until wave 20, when things come unglued.
----------------------------------------------------------------------
Timestamp : 9/23/2011 7:48:41
Error level : ERROR
Message : Lua hook OnAction failed!
Hook name : beings[darkness].OnAction
Error message : Lua error : lua\ai.lua:432: Object expected as parameter 3!
----------------------------------------------------------------------
----------------------------------------------------------------------
Timestamp : 9/23/2011 7:54:37
Error level : ERROR
Message : Lua hook OnTick failed!
Hook name : affects[1].OnTick
Error message : Access violation
----------------------------------------------------------------------
----------------------------------------------------------------------
Timestamp : 9/23/2011 7:55:29
Error level : ERROR
Message : Lua hook OnAction failed!
Hook name : beings[skeletons].OnAction
Error message : Access violation
----------------------------------------------------------------------
----------------------------------------------------------------------
Timestamp : 9/23/2011 7:55:35
Error level : ERROR
Message : Lua hook OnAction failed!
Hook name : beings[shade].OnAction
Error message : Access violation
----------------------------------------------------------------------
----------------------------------------------------------------------
Timestamp : 9/23/2011 7:55:36
Error level : ERROR
Message : Lua hook OnDie failed!
Hook name : beings[mookskeleton].OnDie
Error message : Access violation
----------------------------------------------------------------------
(tried picking up rockets and walking down stairs)
----------------------------------------------------------------------
Timestamp : 9/23/2011 7:59:02
Error level : CRITICAL
Message : Player action exception!
Error message : Access violation
----------------------------------------------------------------------
----------------------------------------------------------------------
Timestamp : 9/23/2011 7:59:05
Error level : ERROR
Message : Lua hook OnEnter failed!
Hook name : cells[17].OnEnter
Error message : Access violation
----------------------------------------------------------------------
----------------------------------------------------------------------
Timestamp : 9/23/2011 7:59:07
Error level : ERROR
Message : Lua hook OnExit failed!
Hook name : cells[17].OnExit
Error message : OnExit not found!
----------------------------------------------------------------------
----------------------------------------------------------------------
Timestamp : 9/23/2011 7:59:11
Error level : FATAL EXCEPTION
Message : Fatal exception encountered
An unhandled exception occurred at $004810AD :
Exception : cannot resume non-suspended coroutine
$004810AD TLUACONFIG__RESUME, line 107 of d:/Projects/fpcvalkyrie/src/vluaconfig.pas
$00488609 TPLAYER__AICONTROL, line 1083 of src/dfplayer.pas
$0049DE07 TBEING__ACTION, line 649 of src/dfbeing.pas
$0049DF6C TBEING__CALL, line 675 of src/dfbeing.pas
$0041E70A TDOOM__RUN, line 444 of src/doombase.pas
$004022CA main, line 91 of src/doomrl.pas
----------------------------------------------------------------------
----------------------------------------------------------------------
Timestamp : 9/23/2011 7:59:11
Error level : FATAL EXCEPTION
Message : Fatal exception encountered
An unhandled exception occurred at $6C9A8C65 :
EAccessViolation : Access violation
$6C9A8C65
$6C9A3567
$6C9A5054
$6C9A60B3
$6C9AFCC3
$6C988BED
$5C574196
$5C57A37D
$5C57E06B
$5C57E20E
$10005397
$1001FF67
$00482852
$0042A193
$0040B2E9
$004022CA
----------------------------------------------------------------------
Whee! A fun module, but it doesn't seem to have aged well.
-
I've actually had Invasion done for some time now, but I was waiting for 'you' on permission. Since this is just the WAD file anyway, I'm going to post it.
I still haven't figured out the bug in Restless: any information regarding it (and other ports) should be sent to this thread post-haste.
-
I'd have posted more information if I hadn't a) had zero free time the past few weeks and b) lost the computer with the error data to an as-yet-unascertained malfunction a while back.
I'll see if I can replicate it when I get a chance.
-
Okay, the Metal Gear port is good enough to put here (see OP). For SOME reason the enemy sounds don't feel like working, and I want to resolve that at some point, but everything else is functional and you guys have been waiting long enough. (Also note that the source folder is given here because it's too ridiculous to lump all of it into a single file.) As always, report bugs as you find them. Incidentally, if you figure out how to make the sounds work (the information is in main.lua) then let me know that, too.
Quake 2 Demo and TerminatorRL should be done soon enough, and that will have taken care of all the publicly-released old mods.
-
Okay, the Metal Gear port is good enough to put here (see OP). For SOME reason the enemy sounds don't feel like working, and I want to resolve that at some point, but everything else is functional and you guys have been waiting long enough. (Also note that the source folder is given here because it's too ridiculous to lump all of it into a single file.) As always, report bugs as you find them. Incidentally, if you figure out how to make the sounds work (the information is in main.lua) then let me know that, too.
Quake 2 Demo and TerminatorRL should be done soon enough, and that will have taken care of all the publicly-released old mods.
just downloaded metal gear, and when i tried it, i was getting this error,
----------------------------------------------------------------------
Timestamp : 10/26/2011 0:36:31
Error level : ERROR
Message : Lua hook OnAction failed!
Hook name : beings[scientist].OnAction
Error message : Lua error : modules\metal_gear.module\ai.lua:52: attempt to read undeclared variable interval
----------------------------------------------------------------------
just letting you know.
ps, thanks for this.
-
just downloaded metal gear, and when i tried it, i was getting this error...
Oy, I know exactly where that problem is but I'm not really in a position to re-upload the module at the moment. I've made a quick fix to the file-in-error: replace it with the existing version in the folder and things should work.
Assuming they don't, I'll just run some extra tests when I get home and fix them then. Sorry about the mess-up.
-
Oy, I know exactly where that problem is but I'm not really in a position to re-upload the module at the moment. I've made a quick fix to the file-in-error: replace it with the existing version in the folder and things should work.
Assuming they don't, I'll just run some extra tests when I get home and fix them then. Sorry about the mess-up.
looks like it worked
thanks
-
Just to let everyone know, the module package has been updated with the quick fix (and a couple tiny things that HAVE been tested). Go wild!
-
So, I've tried that ai fix for metal gear you posted and now the error messages have changed to:
----------------------------------------------------------------------
Timestamp : 1/5/2012 17:46:24
Error level : ERROR
Message : Lua hook OnAction failed!
Hook name : beings[scientist].OnAction
Error message : Lua error : lua\core.lua:1000: attempt to call field '?' (a nil value)
----------------------------------------------------------------------
hope this helps somehow. Thanks for doing these and thanks to the original authors too! Any plans to change these for 995 or is that way too much work?
-
The AI fix shouldn't be necessary with the Metal Gear files in the OP (they were updated as mentioned in the post just before yours). If there are other errors then I suppose it's unrelated.
Thanks for doing these and thanks to the original authors too! Any plans to change these for 995 or is that way too much work?
I don't think switching to 0995 will be too hard, but it will probably require some rewrites nonetheless (if only because there are, say, easier ways to code certain things). I MIGHT have some time to do this, but I also need to try to continue progress on HereticRL, as well as developing the game itself. If others want to take a stab at updating them, be my guest: at the moment my priority is to update the Wiki's modding documentation for 0995, so it should be doable soon enough.
-
Oh. Well in that case I'm getting the original error with the files in the OP. Don't worry about it, you've got a lot on your plate. Just wanted to let it be known in case it was helpful.
-
0994 -> 0995 isn't TOO bad, except that all thing prototypes must be complete--no extra fields, no omitted required fields. Also, some field names changed. So that's annoying. But only a handful of API changes break code.
-
Can we get some detailed 9.9.5 modding info? Blank, Dead Simple, and my own experiments all crash.
-
This is a complete API changelog from the beta threads. Feel free to sort through:
* Episodic mods supported!
* Multiple lua files in a mod supported
* BF_BOSS sub-uses split into separate flags -- BF_SELFIMMUNE, BF_KNOCKIMMUNE, BF_HUNTER
* Removed Generator.place_tile and Generator.set_translation -- instead, Valkyrie dungen's own
functions are used -- you create a tile using Generator.tile_new( map, trans ) (note the reverse
order!) and place it using Generator.tile_place( coord, tile ) (also reversed!). Note however, that
the Level.place_tile stayed the same!
* Removed Level.place_chunk -- as thanks to the new Generator tile API it is just 3 lines -- see the
Archi style generator for an example.
* Removed ui.plot_write -- use ui.plot_screen (can and should be fed with a multiline string!)
* OnDieCheck hook added for beings and player -- return false to prevent death
* entities now need to be properly defined (have all required fields, none extra)
* new AI's available -- built-in AI removed
* removed old API flags - BF_USESITEMS, BF_HUNTER, BF_DISTANCE and BF_RETALITATE
( BF_HUNTER and BF_OPENDOORS will be removed later!)
* all flagSet sets for prototypes are now flag_set
* all soundID sets for prototypes are now sound_id
* all ammoID props now named ammo_id
* XP -> xp, HP -> hp, minLev -> min_lev, maxLev -> max_lev, toDam ->todam, toHit -> tohit, toHitMelee -> tohitmelee
for being prototypes
* MAXAFFECTS raised to 12 - feel free to add your own!
* path_next and direct_seek return a coord as a second result -- either it's the coord that has successfuly been
moved to, or it is the coord that blocked
* entity.id now returns a string id
* entity.sid is invalid
* entity id's are no longer limited to 20 chars
* table.toset is now table.to_set
* new table functions are now available table.toset, table.copy, table.icopy, table.merge, table.imerge,
table.reversed -- all table copying/merging is shallow!
* SHOTGUN_ and MISSILE_ constants are no more, id's changed to be unique. Use string id's for prototype
definitions and shotguns[ "" ].nid/missiles[ "" ].nid for changing ingame.
* Hooks - Challenge hook OnPowerUpCheck removed - OnPickupCheck working
Challenge hook OnBeingCreate is now OnCreate - works on items too, so remember to check!
* added thing:is_item() and thing:is_being() to thing API
* Hooks - Challenge hook OnLevelEnter/OnLevelExit is now OnEnter/OnExit
* Hooks - IsCompleted -> OnCompletedCheck
* player:remove_affect added
* being:quick_swap added
* being:drop added
* being:reload changed (will work with ammo packs and combat shotties)
* OnAltReload *must* return a boolean (success)
* being:alt_reload added (will work with all non-script alt-reloads, script ones will run, but will misbehave)
* IF_NOAMMO and IF_DESTROY should now work with shotguns
* technically a shotgun can now have ALT_CHAIN and work with Ammochain
* beings can now dualgun and have gunkata-reload if equiped with the proper flags
* beings use the full extent of the options that the player has when firing
* being:fire now returns a boolean (if false, no time is used up!)
* being:alt_fire added (be sure to use only with compatible objects!)
* item hook OnFire and OnAltFire revesed return (true continues, false breaks)
* challenge hook OnFire takes (item,being)
* Level hook OnFire(item,being) added
* Level hook OnFired(item,being) added
* removed LF_MELEEONLY flag, use Level.OnFire instead
* introducing HookChains -- first such chain is Item-Level-Challenge hooks OnFire and OnFired
* HookChains for OnPickup and OnPickupCheck and OnFirstPickup (Item-Level-Challenge)
* OnPickup and OnPickupCheck are also executed for beings!
* beings use the same code to pickup as the player, so could be made to pickup e.g. powerups
* lever OnUse must return a boolean value (true)
* being:use is a full featured use - if passed nil, will attempt to use levers
* HookChains for OnUseCheck and OnUse (Item-Level-Challenge)
* OnUseCheck and OnUse are also executed for beings!
* Module Hooks added - inserted into the current HookChain - use ModuleID.HookName for any module
* OnKill, OnKillAll and OnEnter are now chained into Level, Module, Challenge
* OnCreate, OnDie, OnDieCheck are now chained into (Being/Item), Level, Module, Challenge
* Module API - use OnCreateEpisode hook instead of create_episode, OnGenerate instead of generate
* OnMortem is not used for printing (but for things to check before score finalization) use OnMortemPrint instead
* indexing the inventory will no longer work
* you can destroy inventory items that you iterate through - they will be removed from inventory
* thing methods now correctly can be ran through self:
* inventory rehaul
* LFPERMANENT *light*flag added, now controls permanency of walls per cell
* removed all permanent versions of cells (all starting with p)
* OnDieCheck can be properly hijacked (add)
* Level.play_sound for playing sound at coord added (add)
Hook info:
OnCreate // Being and Item -> Level, Module, Challenge, Core (Chained)
OnAction // Being
OnAttacked // Being
OnDie // Being, Level, Module, Challenge, Core (Chained)
OnDieCheck // Being, Level, Module, Challenge, Core (Chained)
OnPickup // Item, Level, Module, Challenge, Core (Chained)
OnPickupCheck // Item, Level, Module, Challenge, Core (Chained)
OnFirstPickup // Item, Level, Module, Challenge, Core (Chained)
OnUse // Item, Level, Module, Challenge, Core (Chained)
OnUseCheck // Item, Level, Module, Challenge, Core (Chained)
OnAltFire // Item
OnAltReload // Item
OnEquip // Item
OnRemove // Item
OnKill // Item (separate), Level, Module, Challenge, Core (Chained)
OnKillAll // Level, Module, Challenge, Core (Chained)
OnHitBeing // Item
OnReload // Item
OnEquipTick // Item
OnEquipCheck // Item
OnEnter // Item (separate), Level, Module, Challenge, Core (chained)
OnFire // Item, Level, Module, Challenge, Core (Chained)
OnFired // Item, Level, Module, Challenge, Core (Chained)
OnExit // Level, Module, Challenge, Core (Chained)
OnTick // Level, Module, Challenge, Core (Chained)
OnCompletedCheck// Level, Module, Challenge, Core (Chained)
OnLoad // Module, Challenge, Core (Chained)
OnLoaded // Module, Challenge, Core (Chained)
OnUnLoad // Module, Challenge, Core (Chained)
OnCreatePlayer // Module, Challenge, Core (Chained)
OnLevelUp // Module, Challenge, Core (Chained)
OnPreLevelUp // Module, Challenge, Core (Chained)
OnWinGame // Module, Challenge, Core (Chained)
OnMortem // Module, Challenge, Core (Chained)
OnMortemPrint // Module, Challenge, Core (Chained)
OnCreateEpisode // Module, Challenge, Core (Chained)
OnLoadBase // Module, Challenge, Core (Chained)
OnIntro // Module, Challenge, Core (Chained)
OnLogo // Module, Challenge, Core (Chained)
OnGenerate // Module, Challenge, Core (Chained)
Module hooks are dependant on module type:
Total conversion -- all hooks
Episode -- all hooks except OnLoadBase and OnLogo
Single -- all hooks except OnCreateEpisode, OnLoadBase and OnLogo
Off the top of my head, the most important changes for mod conversion involve a few definition changes for existing functions and some changed prototype field names. Basically this stuff (all of which is in the above changelog, so you aren't confused):
- BF_BOSS sub-uses split into separate flags -- BF_SELFIMMUNE, BF_KNOCKIMMUNE, BF_HUNTER
- Removed Generator.place_tile and Generator.set_translation -- instead, Valkyrie dungen's own functions are used -- you create a tile using Generator.tile_new( map, trans ) (note the reverse order!) and place it using Generator.tile_place( coord, tile ) (also reversed!). Note however, that the Level.place_tile stayed the same!
- Removed Level.place_chunk -- as thanks to the new Generator tile API it is just 3 lines.
- Removed ui.plot_write -- use ui.plot_screen (can and should be fed with a multiline string!)
- removed old API flags - BF_USESITEMS, BF_HUNTER, BF_DISTANCE and BF_RETALITATE ( BF_HUNTER and BF_OPENDOORS will be removed later!)
- all flagSet sets for prototypes are now flag_set
- all soundID sets for prototypes are now sound_id
- all ammoID props now named ammo_id
- XP -> xp, HP -> hp, minLev -> min_lev, maxLev -> max_lev, toDam ->todam, toHit -> tohit, toHitMelee -> tohitmelee for being prototypes
- entity.id now returns a string id
- entity.sid is invalid
- table.toset is now table.to_set
- SHOTGUN_ and MISSILE_ constants are no more, id's changed to be unique. Use string id's for prototype definitions and shotguns[ "" ].nid/missiles[ "" ].nid for changing ingame.
-
Thanks that's all useful information, but didn't really help to solve the problem. With further experimentation I found that Level.fill and Level.place_tile both cause crash. If I comment those out, I can get a bare bones "single" mod to run without crashing. The fill function is not mentioned in the change log, and for the other it says:
Note however, that the Level.place_tile stayed the same!
-
With further experimentation I found that Level.fill and Level.place_tile both cause crash.
I think I know the problem: permanent cell tiles have been removed. There are some ways to set permanence to cells separately which allows for fewer cells to be loaded. You probably have some "pwall"s or "prwall"s in your code, which no longer exist. Replacing these with "wall" or "rwall" (respectively) should take care of the problem. (The only exception to this are fluids: "pwater", "pacid", and "plava" still exist because they're normally passable, so they act differently from cells with CF_BLOCKMOVE.)
If you want to set a cell to be permanent, there are two ways to do this. (Just as a reminder, a permanent cell is one that cannot be destroyed except by nukes.) The first involves setting them to be permanent at creation:
Create = function()
....
local translation = {
["#"] = {"wall", flags = {LFPERMANENT} },
....
}
....
}
This will make any #s you place on the map a permanent wall cell. The second method is done after the map is created:
Generator.set_permanence( area )
This will make any cells within the area permanent. Usually it's used if you're planning on making the map static (i.e., no wall-busting) and can be placed alongside the Level.player() function. Of course, you can set a cell to be permanent when you create it, but this is typically done by setting the armor and hp of the cell to zero.
Hope this helps!
-
Thanks again, yes pwall was the problem.
-
But there are surely many more compatibility problems. I tried to make a simple example lever (source below) but this crashes when Level.place_tile is called: Lua error : lua\level.lua:348: attempt to index field '?' (a nil value)
Is there any particular reason that the lua sources of DoomRL (such as level.lua) need to be closed?
Items {
id = "lever_win",
name = "lever",
color = MAGENTA,
color_id = "lever",
sprite = 169,
weight = 0,
type = ITEMTYPE_LEVER,
good = "asdf",
desc = "asdf",
flags = { IF_NODESTROY },
OnUse = function(self,being)
player:win()
end,
}
-
I tried to make a simple example lever (source below) but this crashes when Level.place_tile is called: Lua error : lua\level.lua:348: attempt to index field '?' (a nil value)
This sort of error (that is, a level.lua crash due to bad indexing) is almost always because a tile has been used on the "map" without being added to the "translation". Since you've probably at least attempted to do this correctly, my guess is that your notation is off. Here are some examples for tile translations using items and beings:
local translation = {
["#"] = "wall", -- tile with cell by itself
["}"] = { "floor", item = "pistol" } -- tile with cell and item
["h"] = { "floor", being = "former" } -- tile with cell and being
["U"] = { "floor", being = "former", item = "pistol" } -- tile with cell, being, and item
}
You can find this sort information in the tutorial Constructing a Map (http://doom.chaosforge.org/wiki/Modding:Tutorial/Constructing_a_Map) (it's not in the step-by-step but it exists on the review source). I still need to update it for stuff like definition and field changes, but the overall process for setting up maps is virtually unchanged. (I will spend some time this week to update the tutorials for 0995, possibly write a few more now that modders can setup entire episodes.)
Is there any particular reason that the lua sources of DoomRL (such as level.lua) need to be closed?
You'll have to wait for Kornel to reply on this one.
-
Thanks I got it working sort of. :)
-
They're semi-closed -- once total conversions are possible, I'll open most of it.
And in some time (more than a year though) I'll open the full source code -- GPL'd.
-
I played the infinite arena. It is awesome, only problem I have is when the game ends it always crashes.
-
Did I forget to sticky this? Damn.
-
Will Inferno be ported?
Oh, and how has modding changed? We need a new modding wiki!
-
Inferno will be ported. I did got it mostly running during the beta, but that was before the level generation (which inferno uses in very fragile ways) was revamped, so there is more work to do. My current guess is that I can get it out in mid-April maybe.
-
I'll help with porting if you'd like.
-
We also need a new modding tutorial on the wiki.
-
I'd also gladly help write it IF I had source access...
-
Source access? For what?
-
Because that will save me from having to ask a lot of questions. Like I do now.