To browser these website, it's necessary to store cookies on your computer.
The cookies contain no personal information, they are required for program control.
  the storage of cookies while browsing this website, on Login and Register.

Author Topic:  Tutorial: Artifacts and the .art files  (Read 567404 times)

0 Members and 1 Guest are viewing this topic.


« Reply #30 on: 18, December 2020, 16:16:08 »
akes sense on papwe but it hASN'T WORKED. Eg we have value 417500/417500/417500 and weight 12000/12000/-3000. Should be 572500/155000/417500 and 9000/12000/-3000.


« Reply #31 on: 18, December 2020, 16:39:13 »
save_object() calls buff_set_original_stats, so the base object is always saved without buffs applied (though all forces still exist in its inventory).
-- _people_ :)


« Reply #32 on: 12, January 2021, 13:43:42 »
Re buffed items. Why revert to original unbuffed attrs on save, save t5his item AND the origina; unbuffed buff object AND every buff, then on reload reapply all the buffs?

Why not just saVE THE CURRENT STATE OF THE OBJ, WHICH includes aol the buff info? Then no neewd to reapply buffs og reload. }If 2e do need to 'disenchant' any buffs ever the info is there to do it. But only ifcwe hneed to.

* smacky n2eeds a buff ofd typing


« Reply #33 on: 12, January 2021, 18:53:37 »
Historically I think there was a bug where buffing an item increased it's value and then it was discovered that if you buffed it again value was multiplied again so that increases in value became exponential (I think it might have been a 5x increase so after 3 runs it was x125) when people (not me!) farmed the Bebeniss quest. At that time a buff in effect created a new arch for the item so future iterations have instead opted for buff force rather than arch changes.

Having said that I don't think it's relevant to current code but does explain rationale behind convoluted approach that was probably too heavily focused on one specific exploit rather than practicality.
Doesn't matter, you'd die anyway. ;D Shroud's a hacker. After many hours of deep thought I have came to that conclusion.


« Reply #34 on: 14, January 2021, 17:26:49 »
I can't remember the thought process (or even if there was one) behind debuffing items when  saving and re-buffing them on load. I think it's probably fine to only revert items in the rare case in which a buff is to be removed. I'll do some quick testing to make sure there are no issues with that and commit the changes.
-- _people_ :)


« Reply #35 on: 15, January 2021, 11:55:18 »
Well I have thought of something.

By reverting to original attrs on save we can properly reload the arch, rather than a static object.

Eg,arch sillysword has dam 2000/ Someone buffs such an object with, say, dam 20. Eventually we figure out 2000 was a typo and should be 20 so we fix thr arch.

If we'vwe saved with buffs reverted everything is fine and on reload/reapply we end up with dam 40. Else we're stuck with dam 2020, short of laBORIOUS MAnual --vor at least dodgyc speciaL code/script -- fixing.


« Reply #36 on: 16, January 2021, 10:43:53 »
With that line of thinking, I think I should rework buffs to each have their own arch rather than the stats being defined in Lua. This way, in the case of typos (or if we need rebalancing down the road) all items with a specific buff can be altered by modifying the buff's .arc rather than bulk replacing in playerfiles.
-- _people_ :)


« Reply #37 on: 16, January 2021, 13:24:36 »
but that means all mappers/scripters who cause a buff need to commit a separate .arc to sf/daiserv for every buff variation (so, one for wc 1, another for wc 2, another for wc 3, ..., etc). thatll become very unmanageable very fast.

no, i quite like the otem buff system. we do need a couple of tweaks and to use it more widely to integrate it fully with the arch system.

for ex, all scripts which mod item attrs [in a significant, non-temp, change the nature way] should use a buff. eg, gofannon's rebalancing.

BTW here's ca rewrite of the beniss bit:

Code: [Select]
            ib:AddSelect("Talisman", "quest complete talisman", "amulet_lif.101", "I can give you an amulet blessed by my god")
        elseif reward == "weapon" or
            reward == "armour" then
            ib:SetTitle(string.capitalize(reward).." blessing")
            ib:SetMsg("Hand me your "..reward..", and I will bless it for you.")
            local item = pl:FindMarkedObject()
            if item == nil or
                ((reward == "weapon" and
                  item.type ~= game.TYPE_WEAPON) or
                 (reward == "armour" and
                  item.type ~= game.TYPE_ARMOUR)) then
                ib:AddMsg("\n\n|Mark your "..reward.." in your inventory, and request your reward again.|")
                local buffadd = item:CheckBuff("bebeniss_reward_"..reward)
                if buffadd == game.BUFF_ADD_EXISTS or
                    buffadd == game.BUFF_ADD_LIMITED then
                    ib:AddMsg("\n\nI'm sorry, but I can't bless that item. It has already been touched by my god!")
                elseif buffadd == game.BUFF_ADD_MAX_EXCEEDED then
                    ib:AddMsg("\n\nThat item is already too powerful for me to bless!")
                elseif buffadd ~= game.BUFF_ADD_SUCCESS then
                    ib:AddMsg("\n\nI'm sorry, I cannot bless that item.")
                    local buff = game:CreateObject("buff_force")
                    buff.value = weapon.value -- doubles value
                    buff.magic = 1 -- causes buffed item to be magical
                    buff.wis = 1
                    buff.last_sp = 1
                    if reward == "weapon" then
                        buff.grace = 4 -- regen
                    else -- if reward == "armour" then
                        buff.maxgrace = 60 -- max total
                        buff.weight = 0 - math.floor(0.25 * armour.weight)
                    item:AddBuff("bebeniss_reward_"..reward, buff)
                    ib:AddMsg("\n\n|"" takes your "..reward.." and prays...|")
                    ib:AddMsg("\n\nYour "..reward.." has been blessed. You now possess a truly great "..reward..".")

game:CreateObject [doesn't exist yet] returns a new obj of the specified arch [or lua error nif something fails]., obj has no env/map.

obj:AddBuff works simil to now but arg 2 is obj not string aND IT does not returhn a value [again, ;ua err on fail].


Related Topics

  Subject / Started by Replies Last post

Started by smacky Scripts

6 Replies
Last post 28, February 2007, 00:18:12
by smacky
3 Replies
Last post 23, May 2007, 21:07:17
by smacky
2 Replies
Last post 03, September 2009, 15:50:28
by smacky

Started by myths Spoilers

3 Replies
Last post 22, November 2010, 16:24:18
by zrubavel

Started by Joe « 1 2 » Arches

17 Replies
Last post 06, September 2014, 21:30:58
by _people_