Looking for some tricks and scripts to make gameplay easier
Moderator: Sophia
Forum rules
Please read the Forum rules and policies before posting.
Please read the Forum rules and policies before posting.
Re: Looking for some tricks and scripts to make gameplay eas
What about my suggestion - to have the classical CSB magic map and have a larger automap that records, what that item has detected - including false pits revealed by OhGorRos etc.?
Parting is all we know from Heaven, and all we need of hell.
Re: Looking for some tricks and scripts to make gameplay eas
The map works now, and it is quite lovely! There are three more things I want to do with it:
Set it up as a permanent GUI button
Bind it to the TAB key for quick access
Change the centering feature so the full level can be drawn without cutoff (assuming a default level size) or, failing that, just adding the ability to scroll it around
So... how would I do this?
Set it up as a permanent GUI button
Bind it to the TAB key for quick access
Change the centering feature so the full level can be drawn without cutoff (assuming a default level size) or, failing that, just adding the ability to scroll it around
So... how would I do this?
- Gambit37
- Should eat more pies
- Posts: 13720
- Joined: Wed May 31, 2000 1:57 pm
- Location: Location, Location
- Contact:
Re: Looking for some tricks and scripts to make gameplay eas
I'm investigating those very issues, but it'll take me some time. You'll probably get a quicker and more accurate reply from Sophia
And yes, the map is indeed a cool piece of work. Very nice indeed, thank you Joramun
And yes, the map is indeed a cool piece of work. Very nice indeed, thank you Joramun
- Sophia
- Concise and Honest
- Posts: 4240
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Re: Looking for some tricks and scripts to make gameplay eas
For the record, Parallax made the map, not Joramun.
Anyway:
I'll look into making this doable for DSB 0.53, though.
So, I guess the only advice I can offer is to start digging around in the code and learning how it works.
Anyway:
You'll need to set up a msgzone. Take a look at base/render.lua which should point you in the right direction. The documentation on dsb_msgzone on the wiki will also be useful, although the wiki is a little out of date.Zaidyer wrote:Set it up as a permanent GUI button
Right now, the DSB engine doesn't support this.Zaidyer wrote:Bind it to the TAB key for quick access
I'll look into making this doable for DSB 0.53, though.
I assume this could be done by mucking about in the internals of the automap itself, which, I must admit, I'm not that familiar with.Zaidyer wrote:Change the centering feature so the full level can be drawn without cutoff (assuming a default level size) or, failing that, just adding the ability to scroll it around
So, I guess the only advice I can offer is to start digging around in the code and learning how it works.
Re: Looking for some tricks and scripts to make gameplay eas
I'm trying to figure out weapon methods now.
For example, I want to create a sword that when used will instantly do a physical attack, without even bothering to display the methods menu. This is as far as I've gotten...
Right now it does absolutely nothing. Just changing the methods to "physical_attack" has no effect, and giving it a basic Slash attack like any other weapon will still bring up the Methods menu. I need a more in-depth explanation to figure this out.
For example, I want to create a sword that when used will instantly do a physical attack, without even bothering to display the methods menu. This is as far as I've gotten...
Code: Select all
obj.greatsword_trouble = {
name="GREAT SWORD TROUBLE",
type="THING",
class="WEAPON",
mass=32,
icon=gfx.icons[34],
dungeon=gfx.sword,
flying_away=gfx.sword_flying_away,
flying_toward=gfx.sword_flying_toward,
flying_side=gfx.sword_flying_side,
methods = {nil
},
base_range=10,
base_tpower=34,
impact=10,
fit_sheath=true,
hit_sound=snd.dink
}
- Gambit37
- Should eat more pies
- Posts: 13720
- Joined: Wed May 31, 2000 1:57 pm
- Location: Location, Location
- Contact:
Re: Looking for some tricks and scripts to make gameplay eas
I haven't done this yet, but my understanding is you need to write a custom function which you assign to methods=. In that new function, you do all your clever stuff and it bypasses the normal menu. I could be wrong though....
- Sophia
- Concise and Honest
- Posts: 4240
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Re: Looking for some tricks and scripts to make gameplay eas
In thinking about it, there's a quicker hack if you just want to totally override how DSB handles attack methods.
Use this function:
Instead of rendering a choice of attack methods, it will always just automatically "click" the first one before anything else happens.
Naturally, if you want some items to present a choice and others to work automatically, we'll need to revise this approach, but this requires minimal changes. For example, all standard objects will "just work," although some will do weird things depending on what their first method is.
Use this function:
Code: Select all
function sys_render_attack_method(bmp, frozen, ppos, slot, inst, num, names)
if (not frozen) then
local n_inst = inst
if (not n_inst) then n_inst = 0 end
dsb_msg(0, SYSTEM, SYS_METHOD_SEL, n_inst, 1)
end
end
Naturally, if you want some items to present a choice and others to work automatically, we'll need to revise this approach, but this requires minimal changes. For example, all standard objects will "just work," although some will do weird things depending on what their first method is.
Re: Looking for some tricks and scripts to make gameplay eas
With the recent engine updates, I'm wondering now if smooth scrolling is possible.
I'm also considering a contest to create a group-authored dungeon on another forum. How would that work?
I'm also considering a contest to create a group-authored dungeon on another forum. How would that work?
- Sophia
- Concise and Honest
- Posts: 4240
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Re: Looking for some tricks and scripts to make gameplay eas
No. It's just not the kind of thing that will be very easy to do given the way DSB is designed.Zaidyer wrote:With the recent engine updates, I'm wondering now if smooth scrolling is possible.
Anything that wouldn't be quite difficult to do would probably be ugly.
Re: Looking for some tricks and scripts to make gameplay eas
My idea of smooth scrolling in this case is to fake it as hard as possible.
It can be done with the following tools:
Time stops while the animation is taking place, and resumes again when the animation is finished. This is important to make sure things don't get too complicated.
If the player sidesteps or turns, the two screenshots are drawn side-by-side in rapid succession (probably about eight times) at progressive offsets, simulating a panning motion from one to another.
If the player moves forward, the "at keypress" screenshot is drawn atop the viewport and then redrawn (again, about eight times) with progressively larger scaling.
If the player moves backward, the "step completed" screenshot is drawn atop the viewport with a large scale, and progressively redrawn smaller until it's at 100%.
When the animation is complete, the temporary screenshots are erased and time resumes as normal.
To preserve the illusion and keep the constant pausing from getting annoying, each frame of the smooth scroll event would probably only last for a 60th of a second.
Now, what's so hard about this?
It can be done with the following tools:
- Temporary screenshot of an arbitrary portion of the screen (in this case, the viewport)
- Recalling the temporary screenshot as a bitmap to be drawn
- Drawing a bitmap at a specified scale and horizontal/vertical offset within an arbitrary rectangle (in this case covering up the viewport and only the viewport)
Time stops while the animation is taking place, and resumes again when the animation is finished. This is important to make sure things don't get too complicated.
If the player sidesteps or turns, the two screenshots are drawn side-by-side in rapid succession (probably about eight times) at progressive offsets, simulating a panning motion from one to another.
If the player moves forward, the "at keypress" screenshot is drawn atop the viewport and then redrawn (again, about eight times) with progressively larger scaling.
If the player moves backward, the "step completed" screenshot is drawn atop the viewport with a large scale, and progressively redrawn smaller until it's at 100%.
When the animation is complete, the temporary screenshots are erased and time resumes as normal.
To preserve the illusion and keep the constant pausing from getting annoying, each frame of the smooth scroll event would probably only last for a 60th of a second.
Now, what's so hard about this?
- Sophia
- Concise and Honest
- Posts: 4240
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Re: Looking for some tricks and scripts to make gameplay eas
Nothing about that is terribly difficult, although, of course, it would still have to be coded and tested and such, and that takes time.Zaidyer wrote:Now, what's so hard about this?
However, like I said, it's either difficult or it's ugly. That approach wouldn't look at all convincing.
Re: Looking for some tricks and scripts to make gameplay eas
This gif will show you how it works.
The slow speed is for demonstration only. It happens much faster in-game.
Notice also that when turning, the two viewport images stretch to give the illusion of the walls changing angle.
The slow speed is for demonstration only. It happens much faster in-game.
Notice also that when turning, the two viewport images stretch to give the illusion of the walls changing angle.