Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Gustavo6046

Making and Using Custom OBLIGE Prefabs?

Recommended Posts

Fundeful Story of How I Got This Question:

Spoiler

Hm... let me check Doomworld once more...


Wait what? Oh yeah!

Let me check the prefab folder.... funderful! Let's mock with...

--
-- X-shape Joiner with teleporters one way and stairs another
--

PREFABS.Joiner_arch_stairs =
{
  file		= "joiner/astairs.wad"
  map		= "MAP01"

  prob		= 100

  where		= "seeds"
  
  theme		= "tech"

  seed_w	= 2
  seed_h	= 2
}

PREFABS.Joiner_arch_stairs_T =
{
  file		= "joiner/astairs.wad"
  map		= "MAP02"

  prob		= 100

  where		= "seeds"
  shape		= "T"
  style		= "steepness"

  seed_w	= 2
  seed_h	= 2
  
  deep		= 8
  over		= 0	
  
  delta_h	= 120
  nearby_h	= 240
  can_flip	= true
}
Fun!


*generates Extreme map on OBLIGE*

Hm.. where are the arch stairs I made?

So, hello there, people at Doomworld!

I've noticed OBLIGE joins rooms and makes some stuff using prefabs yet (while it does not use prefabbed rooms anymore; now it does random generation. Cool!). And I always wanted to do fun gimmicky structures (sometimes from ZDoom) on OBLIGE!

But... when I try, those don't show up! (and yes I've analyzed an existing stair joiner and made into the Arch-stair joiner above, but it doesn't show up in any of the levels OBLIGE generates for me ;_;)

I've tried changing the `prob`, `where` and many other values, but so far the result is that OBLIGE only uses default prefabs. :/

Is it still true that OBLIGE uses hardcoded names/default prefabs only? Or, if not, is there a detailed tutorial (and then reference manual) on how to do those?

Thank you,
-Gustavo

Share this post


Link to post

Almost none of the prefabs in 7.50 are hard-coded, the only exception is the little rooms used for teleporting-in monsters ("Depot_raise").

I am planning to document stuff about making prefabs, though I don't know when that will be done (still in the middle of setting up a wiki for such documentation, plus knee deep in a UI revamp....)

Looking at the definition in the spoiler tag, I see two issues:
(1) you have "shape = T" -- however only two shapes are currently supported: "I" (capital "i") is for stairs that simply go forward, and "L" for stairs that turn a corner. So using "T" as the shape will prevent that prefab from being used.

(2) you have the size as 2x2 seeds (which is 256x256 units), but stairs that size are never used in any of the grammar rules (layout prefabs) used to create rooms. The stairs used in the grammar rules currently are: 2x1 or 3x1 or 1x2 or 1x3 seeds.

So for a 2x2 stair you would need a rule like this in scripts/rules.lua

GROW_STAIR_2x2 =
{
  prob = 200 
  
  structure =
  {
    "....", ".AA."
    "x..x", "x^^x"
    "x..x", "x^^x"
    "x11x", "x11x"
  }
}
Hope that helps

Share this post


Link to post
andrewj said:

Almost none of the prefabs in 7.50 are hard-coded, the only exception is the little rooms used for teleporting-in monsters ("Depot_raise").

Perfect!

andrewj said:

I am planning to document stuff about making prefabs, though I don't know when that will be done (still in the middle of setting up a wiki for such documentation, plus knee deep in a UI revamp....)

May I help? I am knee-deep in unveiling the secrets about this awesome prefab system. :)

andrewj said:

Looking at the definition in the spoiler tag, I see two issues:
(1) you have "shape = T" -- however only two shapes are currently supported: "I" (capital "i") is for stairs that simply go forward, and "L" for stairs that turn a corner. So using "T" as the shape will prevent that prefab from being used.

Aw. In any case, thank you! I think I'll do L then. Shooould work.

andrewj said:

(2) you have the size as 2x2 seeds (which is 256x256 units), but stairs that size are never used in any of the grammar rules (layout prefabs) used to create rooms. The stairs used in the grammar rules currently are: 2x1 or 3x1 or 1x2 or 1x3 seeds.

So for a 2x2 stair you would need a rule like this in scripts/rules.lua

GROW_STAIR_2x2 =
{
  prob = 200 
  
  structure =
  {
    "....", ".AA."
    "x..x", "x^^x"
    "x..x", "x^^x"
    "x11x", "x11x"
  }
}
Hope that helps

Alright, I could try. In any case, thanks!

Also, I found this thread on rules yesterday, but I fond nothing about prefabs in Google (hopefully this thread will serve as a good starting point). But I'm not sure how I apply these chars, and I wonder if I could do T-sections out of those...

EDIT: Also what is the difference between the two structure parts in the code you posted?

Thank you,
-Gustavo

Share this post


Link to post

The forum post you found about rules is about the old system.

Here is a more informative post I made in the 7.37 thread:
http://oblige.sourceforge.net/forum/index.php?topic=479.msg4256#msg4256

The "structure" field in shape rules is basically a before and after system, the rectangle on the left is what is looked for, and the rectangle on the right is what to change it into.

So in the rule which I posted, the left side looks for "11" (an existing floor area of the room) with some free space near it, and replaces it with a stair AND a brand new area (the "AA").

Gustavo6046 said:

May I help? I am knee-deep in unveiling the secrets about this awesome prefab system.

Hmmm, not sure, as I haven't given that documentation much thought yet. Main one is to have a tutorial about making prefabs, and later have a "reference manual" that describes every little thing.

But yeah, even a list of topics you think the tutorial needs to cover would be useful.

Share this post


Link to post

Gustavo, unless you have in-depth of LUA programming, I'm not certain how you could assist on the UI revamp. However, you could help in other ways. Poke around the OBLIGE forums and see what's going on.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×