Chaosforge Forum

  • December 13, 2018, 20:05
  • Welcome, Guest
Please login or register.



Login with username, password and session length
Pages: 1 [2] 3  All

Author Topic: Mod Ports (from older versions)  (Read 13474 times)

Game Hunter

  • Programmer
  • Local Inquisitor
  • Lieutenant General
  • *
  • *
  • Offline Offline
  • Posts: 1044
  • Looks like game to me.
    • View Profile
    • Channel, the Roguelike
Re: Mod Ports (from older versions)
« Reply #15 on: October 26, 2011, 08:45 »

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.
« Last Edit: October 26, 2011, 11:37 by Game Hunter »
Logged
I'm just a dude playing a dude disguised as another dude.

Latest LPs: Angband, Delver

Shinji_Ikari_9th

  • Elder
  • Major
  • *
  • *
  • Offline Offline
  • Posts: 375
  • Lock and load!
    • View Profile
Re: Mod Ports (from older versions)
« Reply #16 on: October 26, 2011, 13:50 »

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
Logged
Over and Out!

Game Hunter

  • Programmer
  • Local Inquisitor
  • Lieutenant General
  • *
  • *
  • Offline Offline
  • Posts: 1044
  • Looks like game to me.
    • View Profile
    • Channel, the Roguelike
Re: Mod Ports (from older versions)
« Reply #17 on: October 26, 2011, 19:19 »

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!
Logged
I'm just a dude playing a dude disguised as another dude.

Latest LPs: Angband, Delver

Oski

  • Private
  • *
  • Offline Offline
  • Posts: 2
  • Lost Soul
    • View Profile
Re: Mod Ports (from older versions)
« Reply #18 on: January 05, 2012, 10:49 »

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?
Logged

Game Hunter

  • Programmer
  • Local Inquisitor
  • Lieutenant General
  • *
  • *
  • Offline Offline
  • Posts: 1044
  • Looks like game to me.
    • View Profile
    • Channel, the Roguelike
Re: Mod Ports (from older versions)
« Reply #19 on: January 05, 2012, 10:57 »

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.
Logged
I'm just a dude playing a dude disguised as another dude.

Latest LPs: Angband, Delver

Oski

  • Private
  • *
  • Offline Offline
  • Posts: 2
  • Lost Soul
    • View Profile
Re: Mod Ports (from older versions)
« Reply #20 on: January 05, 2012, 11:57 »

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.
Logged

yaflhdztioxo

  • Programmer
  • Local Inquisitor
  • Captain
  • *
  • *
  • Offline Offline
  • Posts: 298
  • Lost Sole
    • View Profile
Re: Mod Ports (from older versions)
« Reply #21 on: January 05, 2012, 19:30 »

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.
Logged

tinyrodent

  • Elder Chaos Guard
  • Second Lieutenant
  • *
  • *
  • Offline Offline
  • Posts: 188
    • View Profile
Re: Mod Ports (from older versions)
« Reply #22 on: January 15, 2012, 13:11 »

Can we get some detailed 9.9.5 modding info? Blank, Dead Simple, and my own experiments all crash.
Logged
Arch-Vile Major

Game Hunter

  • Programmer
  • Local Inquisitor
  • Lieutenant General
  • *
  • *
  • Offline Offline
  • Posts: 1044
  • Looks like game to me.
    • View Profile
    • Channel, the Roguelike
Re: Mod Ports (from older versions)
« Reply #23 on: January 15, 2012, 14:23 »

This is a complete API changelog from the beta threads. Feel free to sort through:

Code: [Select]
* 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.
Logged
I'm just a dude playing a dude disguised as another dude.

Latest LPs: Angband, Delver

tinyrodent

  • Elder Chaos Guard
  • Second Lieutenant
  • *
  • *
  • Offline Offline
  • Posts: 188
    • View Profile
Re: Mod Ports (from older versions)
« Reply #24 on: January 15, 2012, 17:20 »

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:
Quote
Note however, that the Level.place_tile stayed the same!
Logged
Arch-Vile Major

Game Hunter

  • Programmer
  • Local Inquisitor
  • Lieutenant General
  • *
  • *
  • Offline Offline
  • Posts: 1044
  • Looks like game to me.
    • View Profile
    • Channel, the Roguelike
Re: Mod Ports (from older versions)
« Reply #25 on: January 15, 2012, 17:41 »

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:
Code: [Select]
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:
Code: [Select]
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!
« Last Edit: January 15, 2012, 17:43 by Game Hunter »
Logged
I'm just a dude playing a dude disguised as another dude.

Latest LPs: Angband, Delver

tinyrodent

  • Elder Chaos Guard
  • Second Lieutenant
  • *
  • *
  • Offline Offline
  • Posts: 188
    • View Profile
Re: Mod Ports (from older versions)
« Reply #26 on: January 15, 2012, 17:50 »

Thanks again, yes pwall was the problem.
Logged
Arch-Vile Major

tinyrodent

  • Elder Chaos Guard
  • Second Lieutenant
  • *
  • *
  • Offline Offline
  • Posts: 188
    • View Profile
Re: Mod Ports (from older versions)
« Reply #27 on: January 16, 2012, 09:09 »

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?

Code: [Select]
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,
}

Logged
Arch-Vile Major

Game Hunter

  • Programmer
  • Local Inquisitor
  • Lieutenant General
  • *
  • *
  • Offline Offline
  • Posts: 1044
  • Looks like game to me.
    • View Profile
    • Channel, the Roguelike
Re: Mod Ports (from older versions)
« Reply #28 on: January 16, 2012, 09:44 »

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:
Code: [Select]
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 (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.
« Last Edit: January 20, 2012, 13:41 by Game Hunter »
Logged
I'm just a dude playing a dude disguised as another dude.

Latest LPs: Angband, Delver

tinyrodent

  • Elder Chaos Guard
  • Second Lieutenant
  • *
  • *
  • Offline Offline
  • Posts: 188
    • View Profile
Re: Mod Ports (from older versions)
« Reply #29 on: January 16, 2012, 10:18 »

Thanks I got it working sort of. :)
Logged
Arch-Vile Major
Pages: 1 [2] 3  All