I'm finding functions in the wiki that have no docs yet, will ask about them here:
dsb_viewport_distort(effect)
Sounds interesting! What does this do and how can we use it?
dsb_animate(bitmap, frames, frame_delay)
Can we get an example? I'm not clear how to define the sequence of frames?
Questions about currently undocumented functions
Moderator: Sophia
Forum rules
Please read the Forum rules and policies before posting. You may
to help finance the hosting costs of this forum.
Please read the Forum rules and policies before posting. You may

Re: Questions about currently undocumented functions
The viewport distort is a function that displaces the pixels.Gambit37 wrote:I'm finding functions in the wiki that have no docs yet, will ask about them here:
dsb_viewport_distort(effect)
Sounds interesting! What does this do and how can we use it?
A good example can be found in MFI's dungeon with the Quake "underwater effect"
This one is very easy: it cuts "bitmap" horizontally into a number (frames) of sub-bitmaps and switches the bitmap displayed on screen by the next sub-bitmaps every "frame_delay" (number of ticks)gfx.bmp = dsb_animate(bitmap, frames, frame_delay)
Can we get an example? I'm not clear how to define the sequence of frames?
Example: Say you have two images of the same size: Goblin, and goblin frowning, and want the front view of the goblin to alternate every 3 frames. Make one image, double-horizontal size (named double_goblin), with one copy on the left half, the other on the right half, and do: gfx.goblin_anim = dsb_animate(double_goblin, 2, 3)
Am I clear ? I'll release a dungeon with a lot of stuff like that

What Is Your Quest ?
- Gambit37
- Should eat more pies
- Posts: 13773
- Joined: Wed May 31, 2000 1:57 pm
- Location: Location, Location
- Contact:
Re: Questions about currently undocumented functions
Oooh, sounds nice, I'll have to check that out. Is there a download somewhere?Joramun wrote:The viewport distort is a function that displaces the pixels.
A good example can be found in MFI's dungeon with the Quake "underwater effect"
Oh, that's annoying. I build up frames in layers in a Photoshop document, then export each layer to it's own image. Having to then put all that into a super wide image is extra work and makes creating animations less flexible (if you want to add an extra frame, that's a lot of fiddling with moving things around and making a space). It also means if you have 20 frames of a 640px image, your image will be way too wide to view as thumbnails in Windows Explorer, which I use to rapidly identify resources.Joramun wrote:Make one image, double-horizontal size (named double_goblin), with one copy on the left half, the other on the right half
I wonder if this can be improved to use a table of individual files instead?
- Sophia
- Concise and Honest
- Posts: 4307
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Re: Questions about currently undocumented functions
If you want to just test it out, add something like this to your startup code:
Then just invoke it via a "function_caller" somewhere.
There will be other distortions in DSB 0.48, and I'll try to better document it then.
Code: Select all
function go_underwater()
dsb_viewport_distort(DISTORTION_UNDERWATER)
end
There will be other distortions in DSB 0.48, and I'll try to better document it then.
Good idea. I'll look into doing exactly that.Gambit37 wrote:I wonder if [dsb_animate] can be improved to use a table of individual files instead?
- Gambit37
- Should eat more pies
- Posts: 13773
- Joined: Wed May 31, 2000 1:57 pm
- Location: Location, Location
- Contact:
Re: Questions about currently undocumented functions
I tried doing the distortion by assigning the function to a wall button -- when I press it, everything goes black!?
- Sophia
- Concise and Honest
- Posts: 4307
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Re: Questions about currently undocumented functions
It's very murky water...
...
I have a few bugs to fix, it seems.
...

I have a few bugs to fix, it seems.