RUNES & SPELL Help

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. You may Image to help finance the hosting costs of this forum.
Post Reply
User avatar
Kesa
Journeyman
Posts: 67
Joined: Fri Sep 10, 2010 11:44 pm

RUNES & SPELL Help

Post by Kesa »

I am looking for the definition of the runes to verify what number is placed to which rune.

In the spells you have to numbers like [152] in below. I take it this defines what runes will be used when casting the spell. So wth is 152? Is there a chart for what runes = what numbers I can find so i can make custom spells? cause I am lost on this matter...

[152] = {
class = CLASS_WIZARD,
subskill = SKILL_DES,
difficulty = 1,
idleness = 18,
cast = magic_footprints
},
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Re: RUNES & SPELL Help

Post by zoom »

I think it is first rune, then 5th rune then 2nd rune. This makes up the spell
cannot reach the dm encyclopedia right now, so no link to a spell chart. But there is some around I am positive about that!! ;)

Power runes are left out because it does not change the spell.
then come up to 3 runes you can choose out of the 6 runes that are displayed.
power -->alignment >element force -->class or sth. like that.

a vi potion would be :
[2]
fireball would equal: ful ir
[43]??
User avatar
Sophia
Concise and Honest
Posts: 4306
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: RUNES & SPELL Help

Post by Sophia »

I'll just "officially" confirm it. zoom has it exactly right.
User avatar
Kesa
Journeyman
Posts: 67
Joined: Fri Sep 10, 2010 11:44 pm

Re: RUNES & SPELL Help

Post by Kesa »

that helped a lil, I was more looking for what rune = what #

Like vi = 2 right
ful = 4
ir = 3

is there any way to view or find out all this without testing numbers all day?
User avatar
Sophia
Concise and Honest
Posts: 4306
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: RUNES & SPELL Help

Post by Sophia »

It's positional. The exact relationship between number and rune depends on which set of runes you're currently using.
Think of the six runes displayed as 1 2 3 4 5 6, and the spell is entered as which of those six spots you have to click in turn.

If you want rune name correlations, though, here they are:
For "elemental influence", 1 = ya, 2 = vi, 3 = oh, 4 = ful, 5 = des, and 6 = zo.
For "form", 1 = ven, 2 = ew, 3 = kath, 4 = ir, 5 = bro, 6 = gor.
For "class/alignment", 1 = ku, 2 = ros, 3 = dain, 4 = neta, 5 = ra, 6 =sar.
User avatar
Kesa
Journeyman
Posts: 67
Joined: Fri Sep 10, 2010 11:44 pm

Re: RUNES & SPELL Help

Post by Kesa »

oh I c now, thank you very much ^.^
User avatar
Gambit37
Should eat more pies
Posts: 13770
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: RUNES & SPELL Help

Post by Gambit37 »

User avatar
Kesa
Journeyman
Posts: 67
Joined: Fri Sep 10, 2010 11:44 pm

Re: RUNES & SPELL Help

Post by Kesa »

The spell raise dead is bugging me here. I tried coping and pasting the vi alcove, but then I got stuck on how to recode some parts so it is like a spell not a vi_alcove remake completely.

The object: I want to change on_click=use_vi_altar, into something to use like a weapon, but then I need to make a method, but I dont have a raise mention and unsure how to do that so figured a shoot spell method would work and make a raise spell instead. Am I getting over my head here or did I just take a long route to do all this?

Code: Select all

OBJECT:

obj.phoenix_down = {
	type="THING",
	class="SPELLITEM",
        icon=gfx.icon_phoenixdown,
	dungeon=gfx.phoenixdown,
	methods = {
		{ "RAISE", 0, CLASS_PRIEST, method_shoot_spell }
	}
}

obj.raise = {
    name="FIREBALL",
    type="THING",
    class="SPELL",
    	dungeon=gfx.raise,
	revive_class = "BONES"
	on_click=use_raise,
	msg_handler = raise_msg_handler,
	no_shade = true
}
I dont think on_click=use_raise, is gonna work well with this spell, I have a trigger ready also, but on_click isnt right is it? I mean if you use the spell from the phoenix down on_click wouldnt be used in the spell so what is a better command, is there an on_use or something that just spawns it like the dsb_spawn?
User avatar
Sophia
Concise and Honest
Posts: 4306
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: RUNES & SPELL Help

Post by Sophia »

You don't really need a separate "raise" object. The best approach, in my opinion, is to write a method_raise_dead which is invoked by the phoenix down's attack method. In this code you can take care of raising the dead party members.

A simple method would look something like this. Note that I haven't tested this code, but I think it should work ok.

Code: Select all

function method_raise_dead(name, ppos, who, what)
    local m = lookup_method_info(name, what)
    if (not m) then return end
    
    for checkppos=0,3 do
        local checkchar = dsb_ppos_char(checkppos)
        if (checkchar and dsb_get_bar(checkchar, HEALTH) == 0) then
            dsb_set_bar(checkchar, HEALTH, 10)
        end
    end

    method_finish(m, ppos, who)
end
This will bring anyone dead back with 1 hp.

If you use this code, you'll have to add method_info for RAISE to obj.phoenix_down, since it's not a standard DM attack method.

Code: Select all

obj.phoenix_down = {
    --
    -- The rest of your object definition goes here...
    --
    method_info = {
        RAISE = {
            xp_class = CLASS_PRIEST,
            xp_sub = SKILL_POTIONS,
            xp_get = 10,
            idleness = 10,
            stamina_used = 10
        }
    }
}
User avatar
Kesa
Journeyman
Posts: 67
Joined: Fri Sep 10, 2010 11:44 pm

Re: RUNES & SPELL Help

Post by Kesa »

No method appeared when I went to test the item, the hand showed up blank.

When holding the item nothing is shown not even the hand, unable to click
User avatar
Kesa
Journeyman
Posts: 67
Joined: Fri Sep 10, 2010 11:44 pm

Re: RUNES & SPELL Help

Post by Kesa »

ok by adding the

methods = { RAISE, 0, CLASS_PRIEST, method_raise_dead}

it worked, so I got it to work but the bones do not disappear from the ground lol

Also when i try to set a def_charge I get an error when loading the game:

Code: Select all

"lua FUNCTION RAISE: base/util.lua:702: dsb_get_charge requires int in param 1"

Code: Select all

obj.phoenix_down = {
	name="PHOENIX DOWN",
	type="THING",
	class="SPELLITEM",
	shortdesc="SPELL ITEM",
	mass=0,
	icon=gfx.icon_phoenixdown,
	dungeon=gfx.phoenixdown,
	def_charge=1,
	methods = { 
		{ "RAISE", 0, CLASS_PRIEST, method_raise_dead }
     	},
	method_info = {
	RAISE = {
            xp_class = CLASS_PRIEST,
            xp_sub = SKILL_POTIONS,
            xp_get = 10,
            idleness = 10,
            stamina_used = 10,
	    charge = 1
       		 }
    	},
	convert_deplete="ashes"	
}
User avatar
Sophia
Concise and Honest
Posts: 4306
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: RUNES & SPELL Help

Post by Sophia »

Removing the dead bones will be a bit more complicated. On the other hand, we can make the function work a bit more elegantly, too.

Code: Select all

function method_raise_dead(name, ppos, who, what)
    local m = lookup_method_info(name, what)
    if (not m) then return end

    local revive_target = nil
    local found_bones = nil

    local checkbones = dsb_fetch(CHARACTER, who, INV_L_HAND, 0)
    if (checkbones) then
        local checkarch = dsb_find_arch(checkbones)
        if (checkarch == obj.bones) then
            found_bones = true
            use_exvar(checkbones)
            if (exvar[checkbones].owner) then
                revive_target = exvar[checkbones].owner
                dsb_msg(0, checkbones, M_DESTROY, 0)
                dsb_sound(snd.zap)
            end
        end
    end

    if (revive_target) then
        local r_ppos = dsb_char_ppos(revive_target)
        if (r_ppos) then
            dsb_set_bar(revive_target, HEALTH, 10)
            dsb_write(player_colors[r_ppos + 1], dsb_get_charname(revive_target) .. " REVIVED.")
            method_finish(m, ppos, who, what)
        end
    else
        if (found_bones) then
            dsb_write(system_color, dsb_get_charname(who) .. " CANNOT REVIVE THOSE BONES.")
        else
            dsb_write(system_color, dsb_get_charname(who) .. " MUST HAVE BONES IN HAND.")
        end
    end
end
User avatar
Kesa
Journeyman
Posts: 67
Joined: Fri Sep 10, 2010 11:44 pm

Re: RUNES & SPELL Help

Post by Kesa »

ah it worked thnx so much Sophia ^.^
User avatar
Kesa
Journeyman
Posts: 67
Joined: Fri Sep 10, 2010 11:44 pm

Re: RUNES & SPELL Help

Post by Kesa »

ok next situation is a HEAL SPELL I made

Code: Select all

function heal(atype, ppos, who, power, skill, delay)
	local s_power = (power+1)/8 + 32
	local heal_divide = (511 - power) / (2 * s_power)
	local maxhp = dsb_get_maxbar(who, HEALTH)
	local gain_hp = maxhp / heal_divide
	local hp = dsb_get_bar(who, HEALTH) + gain_hp
	if (hp > maxhp) then hp = maxhp end
	
	local i_heal = power/42
	if (i_heal < 1) then i_heal = 1 end
	i_heal = i_heal * 9
	local c
	for c=0,i_heal do
		local inj_loc = random_body_loc()
		local inj = dsb_get_injury(who, inj_loc)
		if (inj) then
		    local ipower = s_power/4
		    if (ipower > 45) then ipower = 45 end
		    
			inj = inj - ipower
			
			if (inj <= 0) then
				dsb_set_injury(who, inj_loc, 0)
			else
				dsb_set_injury(who, inj_loc, inj)
			end
		end
	end
	
	dsb_set_bar(who, HEALTH, hp)	
end
it works fine except, i want to hear sound when it is used. I havent learned much about sounds yet and DM is lacking snds for me to fully learn how to do this myself.

So what code am I missing to add sound to this spell above so it can sound like its being cast? ^.^
User avatar
Gambit37
Should eat more pies
Posts: 13770
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: RUNES & SPELL Help

Post by Gambit37 »

Wow, you got to grips with DSB programming pretty quick. I'm impressed :)
User avatar
Kesa
Journeyman
Posts: 67
Joined: Fri Sep 10, 2010 11:44 pm

Re: RUNES & SPELL Help

Post by Kesa »

^.^ well sorta getting there, but I still lack enough to make bad@$$ scripts.
User avatar
Sophia
Concise and Honest
Posts: 4306
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: RUNES & SPELL Help

Post by Sophia »

Kes wrote:So what code am I missing to add sound to this spell above so it can sound like its being cast? ^.^
Sound is pretty simple. :)
It's just dsb_sound. You can get a list of the standard DM sounds from base/graphics.lua, near the bottom.
For example, in the script above, to make a zap sound:

Code: Select all

dsb_sound(snd.zap)
User avatar
Kesa
Journeyman
Posts: 67
Joined: Fri Sep 10, 2010 11:44 pm

Re: RUNES & SPELL Help

Post by Kesa »

*feels retarded now*

thnx now I can finish this and crawl in a corner for stupidity lol
Post Reply