How to... ?

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting.
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Re: How to... ?

Post by zoom »

--maybe sharing graphics at this stage /moment is too early, because the surprise (due to new graphics) will be diminished ?
At least this is the only argument against sharing that I can think of right now. In the long run, a graphic collection only makes sense.
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: How to... ?

Post by Gambit37 »

@Mon Ful IR: Your downloads have been removed from Media Fire. Can you upload them again please?
Mon Ful Ir
Adept
Posts: 221
Joined: Sat Jan 07, 2006 1:54 am
Location: Britain

Re: How to... ?

Post by Mon Ful Ir »

I have the most recent version and I'll re-upload. Bear with me for a little while so I can organise it all a bit better, please.
Mon Ful Ir
Adept
Posts: 221
Joined: Sat Jan 07, 2006 1:54 am
Location: Britain

Re: How to... ?

Post by Mon Ful Ir »

Mon Ful Ir
Adept
Posts: 221
Joined: Sat Jan 07, 2006 1:54 am
Location: Britain

Re: How to... ?

Post by Mon Ful Ir »

Version 0.2's done. Get it here.

Changes:-
  • 2 new monsters
  • 1 new champion (prisoner-release version rather than a mirror)
  • 3 new statues
  • 1 new ceiling-hanging-thing
  • Assorted minor code fixes
Mon Ful Ir
Adept
Posts: 221
Joined: Sat Jan 07, 2006 1:54 am
Location: Britain

Re: How to... ?

Post by Mon Ful Ir »

Hmm. When someone clicks on one of the "prisoners" in this dungeon, they can release the prisoner, adding a character to the party. This is just called "resurrection" at the moment.

What I want to do is change where it says "resurrect" to "release". But this seems to mean replacing some code in dsb_offer_champion and I don't have the faintest idea how to do that. Help please?

Also, the prisoner object (the cloned mirror) ought to disappear when the relevant champion's added and I'm afraid I can't see how to make that happen either. Can I use qswapper to delete an object?
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: How to... ?

Post by Sophia »

Mon Ful Ir wrote:What I want to do is change where it says "resurrect" to "release".
If you mean the thing you click when the champion is being offered, you have to replace the image itself. It's a 232x146 image that must be called option_res.png (or .bmp or .pcx or whatever else) The bottom 26 pixels are the cancel button; the rest are the resurrection image. The image is in the extracted DSB graphics that you can download here, I think.
Mon Ful Ir wrote:Also, the prisoner object (the cloned mirror) ought to disappear when the relevant champion's added and I'm afraid I can't see how to make that happen either. Can I use qswapper to delete an object?
No, but you can send it a "destroy" message. A better option might be to do it automatically in the prisoner's take function, i.e., the function called when the party member is taken.
Here's some code:

Code: Select all

function obj.prisoner:on_click(id, clicked_with)
    if (clicked_with == nil and exvar[id]) then
        local inside = exvar[id].champion
        if (inside) then
            local offer_mode = 3
            if (exvar[id].offer_mode) then
                offer_mode = exvar[id].offer_mode
            end
            dsb_offer_champion(inside, offer_mode, function ()
                exvar[id].champion = nil
                got_triggered(id, nil)
                dsb_msg(1, id, M_DESTROY, 0) -- Added this line. Makes the prisoner disappear when taken.
            end)
        end
    end
end
Mon Ful Ir
Adept
Posts: 221
Joined: Sat Jan 07, 2006 1:54 am
Location: Britain

Re: How to... ?

Post by Mon Ful Ir »

Thank you, Amber. I've created a new option_res.png, and I've added it into my graphics.lua in the usual way:

Code: Select all

gfx.option_res = dsb_get_bitmap("option_res", "mfi_graphics/misc/option_res.png")
This doesn't seem to have changed anything. Have I missed a step?

Thanks
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: How to... ?

Post by Sophia »

You know, you stumbled on something that I didn't even think of. The problem is that this all was done before DSB was particularly mindful of file paths, so option_res.png has to be in your dungeon's root directory. At that point you don't even have to actually add it to gfx at all; the DSB core pulls it in directly.

This is sort of ugly, so I'll probably make it work like your way in future versions.
Mon Ful Ir
Adept
Posts: 221
Joined: Sat Jan 07, 2006 1:54 am
Location: Britain

Re: How to... ?

Post by Mon Ful Ir »

Thank you very much, that's working as intended now. :)
Mon Ful Ir
Adept
Posts: 221
Joined: Sat Jan 07, 2006 1:54 am
Location: Britain

Re: How to... ?

Post by Mon Ful Ir »

Hmm... when I release a prisoner it still says, "%NAME RESURRECTED" at the bottom of the screen. Can I make it say, "%NAME RELEASED"?
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: How to... ?

Post by Sophia »

Yes. It's in base/global.lua.

Code: Select all

msg_resurrected = " RELEASED."
Don't forget the leading space, because the name is prepended directly to whatever is in that string.
Mon Ful Ir
Adept
Posts: 221
Joined: Sat Jan 07, 2006 1:54 am
Location: Britain

Re: How to... ?

Post by Mon Ful Ir »

Okay, thanks. Is there a way to do it without editing base/global.lua? A custom dungeon really shouldn't change the base code.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: How to... ?

Post by Sophia »

It's a variable! You can change that variable's value and the output will change. :)
So in your custom dungeon's scripts just do

Code: Select all

msg_resurrected = " RELEASED."
The only reason I mentioned it was in base/global.lua was so you could see where it was and what other variables you could override to change other aspects of DSB's behavior.
Mon Ful Ir
Adept
Posts: 221
Joined: Sat Jan 07, 2006 1:54 am
Location: Britain

Re: How to... ?

Post by Mon Ful Ir »

Ah! Everything becomes clear. Thank you!
User avatar
Lord_BoNes
Jack of all trades
Posts: 1064
Joined: Mon Dec 01, 2008 12:36 pm
Location: Ararat, Australia.

Re: How to... ?

Post by Lord_BoNes »

Sorry to bump this thread... but... MonFulIr, do you happen to have a more recent version of this? I mainly ask because the last available download is several posts up, and you've discussed new changes that wouldn't be in that download. That, and I'm also curious to see your progress on this.
 
Image

1 death is a tragedy,
10,000,000 deaths is a statistic.
- Joseph Stalin

Check out my Return to Chaos dungeon launcher
And my Dungeon Master Clone
Mon Ful Ir
Adept
Posts: 221
Joined: Sat Jan 07, 2006 1:54 am
Location: Britain

Re: How to... ?

Post by Mon Ful Ir »

Yes, I have a more up to date version on my computer at home, but it'll be a few more days before I can post it I'm afraid.
User avatar
Lord_BoNes
Jack of all trades
Posts: 1064
Joined: Mon Dec 01, 2008 12:36 pm
Location: Ararat, Australia.

Re: How to... ?

Post by Lord_BoNes »

No problems. The previous download was May 12th 2011... so a few more days won't hurt :P
 
Image

1 death is a tragedy,
10,000,000 deaths is a statistic.
- Joseph Stalin

Check out my Return to Chaos dungeon launcher
And my Dungeon Master Clone
Mon Ful Ir
Adept
Posts: 221
Joined: Sat Jan 07, 2006 1:54 am
Location: Britain

Re: How to... ?

Post by Mon Ful Ir »

No, I'm sorry: I'm afraid I've misinformed you. Apparently I no longer have that file. :(
User avatar
terkio
Mon Master
Posts: 937
Joined: Tue Jul 10, 2012 8:24 pm

Re: How to... ?

Post by terkio »

Off topic.
@Mon Ful Ir
While you are here...
Is there a chance for a deeper dungeon to continue your excellent RTC "Escape 3.0" ? http://www.dungeon-master.com/forum/vie ... 31&t=28120
"You can be on the right track and still get hit by a train!" Alfred E. Neuman
Mon Ful Ir
Adept
Posts: 221
Joined: Sat Jan 07, 2006 1:54 am
Location: Britain

Re: How to... ?

Post by Mon Ful Ir »

I'll reply in that thread. :)
User avatar
Lord_BoNes
Jack of all trades
Posts: 1064
Joined: Mon Dec 01, 2008 12:36 pm
Location: Ararat, Australia.

Re: How to... ?

Post by Lord_BoNes »

Mon Ful Ir wrote:No, I'm sorry: I'm afraid I've misinformed you. Apparently I no longer have that file. :(
Damn :(

Any other DSB dungeons you feel like throwing my way (I'm learning how to do stuff in DSB, and you seem to have interesting ideas)?
 
Image

1 death is a tragedy,
10,000,000 deaths is a statistic.
- Joseph Stalin

Check out my Return to Chaos dungeon launcher
And my Dungeon Master Clone
Post Reply