Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

AleDerXan

32
Posts
6
Topics
1
Followers
1
Following
A member registered 44 days ago

Recent community posts

Ну, благо не нужно ездить по городу по всяким странным местам, и раскапывать землю. Или лезть руками во всякие незаметные места. Пытаясь скрыть свои действия от народа вокруг. Тебе просто присылают данные карты.

(1 edit)

Update. 09404

This def in original game in 09404 now the same as in UMM.

So second version of code now will works in 09404 and older versions of game.

And it's able to make it simplier. If remove from code support for older versions of the game.


class Text
    
    alias_method :alias_load_file_Orig_modname, :load_file unless method_defined?(:alias_load_file_Orig_modname)
    def load_file(part = nil, file)
        mod_file = File.exists?("#{$modname_modFolder}/#{@parts[part]}/#{file}.txt")
        orig_file = File.exists?("#{@parts[part]}/#{file}.txt")
        if mod_file && orig_file
            hashh = alias_load_file_Orig_modname(part, file).merge(load_file_mod_modname(part, file))
        elsif mod_file
            hashh = load_file_mod_modname(part, file)
        else
            hashh = alias_load_file_Orig_modname(part, file)
        end
        
        return hashh
    end
    
    def load_file_mod_modname(part = nil, file)
        begin
            sth=File.read("#{$modname_modFolder}/#{@parts[part]}/#{file}.txt")
            return parse(sth.to_s.encode("utf-8"))
        rescue => ex
            msgbox "ERROR: missing translation file #{$modname_modFolder}/#{@parts[part]}/#{file}.txt"
            return Hash.new
        end
    end
    
end
(2 edits)

Я взял 40.
Но оплатил подписку за 29. И смог отправить следом еще 10 (что мне еще с ними делать? Не сжигать же вместе со сгоревшей через неделю картой). Тут наверное зависит от того какого банка тебе попадется карта…

Вопрос в том, какой номинал нужно брать, чтоб можно было по итогу после всех комиссий получить 29$, отправленных на подписку. Пайпал, кажись, безнадежное дело. Там даже зарегаться тяжко.

(9 edits)

In 09402 first version of code works propertly.  Second to. But i think that UMM don't. So second version isn't actual now.

(13 edits)

I understand this.
Strings better for eyes and for mind.

Next one is about code of barters.

I thing, that

def manual_barters(tmpTradeID)
    ...
    ...
end

- is good.

But something like this will be better:

def manual_barters(tmpTradeID=get_character(0).npc_name)
    ...
    ...
end

Or this:

def manual_barters(tmpTradeID) 
    if !tmpTradeID || !$data_barters[tmpTradeID]
        tmpTradeID = get_character(0).npc_name
    end
    ...
    ...
end
(6 edits)

My sample of json now in the game as sample for everyone.

But since I posted it, Eccma changed a little rules about skills.

I'm aboust "stype_id". In my sample it is Fixnym.

Eccma now use Strings. But when i posted sample, stype_id was a strange thing in rvdata2, that was copied by me from rvdata as is. To have a full info about skill. From json and from rvdata.

Now sample in main game need to be updated.

(2 edits)

Since the first post I've managed to improve the code a bit. From the same link.

** Some more fixes againg. Update after one day since first post.

(10 edits)

This is link to folder with my mods.

One of them - "Dynamic Trait Field" is about it.

It's beta. And tested on 0.9.3.0.

It's made for modding. Right now, all the pages are still blank. Except for the very first one, which is created on the basis of the current trait field. (Every page can be edited only in the game. After loading save or started new game.)

If modders are going to use it. They should specify this mod as required for work. Or copy the code from it to themselves without making any changes at all. That if mods with dynamic trait field in LonaRPG will be installed more than one, they do not conflict and do not do strange things. Global variables and def names should be identical and do identical things in all mods with this system.

If people there who have skill will help me to make this mod better i will welcome (or they can do it  themself, if they can do better). Because if this mod will be used,  code of this mod should be more stable. My skills in ruby not perfect.

LINK

(4 edits)

0.9.3.0 works.

0.9.4.0.2 works to.

This method allow to overwrite strings from "main game folder of Text" by similar folder from mod.
This method overwrite not a full files, but only existing strings in mod text files.
And after this, you can use $game_text for your custom mods translation and strings.
After this code game see your files not in modfolder, but in it's own text folder.

(2 edits)

He-he................

Why only npc_women? Lona to. (New ways of using Tail?)

(3 edits)

Next one. It's simply. Not about modding. Only question about game code.

Why this:

?

When it's possible to do this:


(8 edits)

As offtop. (It's a reason of my first post in this topic)

I'm working on one mine mod.


And I've made it so that under certain specific conditions, this will happen:

if ["",0,nil].include?($story_stats["sex_record_virginity_taken"])
    $story_stats["sex_record_virginity_taken"] = $game_text["menu:main_stats/name",true]
end


And if the conditions are met again with little changes:

if ["",0,nil].include?($story_stats["sex_record_first_kiss"])
    $story_stats["sex_record_first_kiss"] = $game_text["menu:main_stats/name",true]
end


And if the conditions are met again with another little changes:

if ["",0,nil].include?($story_stats["sex_record_butt_virginity_taken"])
    $story_stats["sex_record_butt_virginity_taken"] = $game_text["menu:main_stats/name",true]
end

(And now I'm thinking of adding not only the name, but also Lona's title as well. Or race.)

(34 edits)

Next. I made it's simplier to mind of modders.

Not:  (in "def manual_trade")

goods = add_mod_goods(charStoreHashName)
good += goods if goods != nil


Then:

begin; name = $game_map.interpreter.get_character(0).npc_name; rescue; name = nil; end
goods = add_mod_goods(name) if name != nil
good += goods if goods != nil

And then use in json normal names instead of numbers. 

{
    "npc_name": "UniqueTavernWaifu",
    "items":  [
        {
            "item_name": "ItemSurBot", 
            "custom_price": null, 
            "price_add": 0,
            "price_mult": 1, 
            "rndMin": 1,
            "rndMax": 5,
            "shop_nerf": [
                {
                    "base": 0, 
                    "base_mult": 1,
                    "attr_name": "weak", 
                    "attr_mult": 1, 
                    "attr_type": 0
                },
                { 
                    "base": -100,
                    "base_mult": 0,
                    "attr_name": "sexy",
                    "attr_mult": -1,
                    "attr_type": 0
                }
            ]
        },
        {
            "item_name": "ItemAdvBot",
            "custom_price": null,
            "price_add": 0,
            "price_mult": 1,
            "rndMin": 1,
            "rndMax": 5,
            "shop_nerf": [
                {
                    "base": 0,
                    "base_mult": 1,
                    "attr_name": "weak",
                    "attr_mult": 0.5,
                    "attr_type": 0
                }
            ]
        }
    ]
}


And we can add  story_stats check and stats check after shopnerf. And work with it in "def add_mod_goods", and when collect data from jsons to $barter_hash. Of course we should allow code to ignore if some of the hash-keys don't exist in some of jsons. If not need then allow human to don't write keys in json.. 

We can add something like this to allow adding item to good :


"req_lower_than": [{"stat_name": "name (as weak)", "value": num}, {.......}] ,

for example. If Lona have high weak then she can't buy something



"req_higher_than": [{"stat_name": "name (as sexy or morality)", "value": num}, {.......}] ,

for example. Lona need to have high sexy to buy something strange

Or may be:

"req_between": [{"stat_name": "name (as weak)", "valueMin": num, "valueMax": num }, {...}] ,



"req_story_stats": [{"story_stats_name": "name of story stat", "value": num (or other)}, {.......}] ,

for example. Lona need to done certain quest to buy something uniq


"req_game_player_stat": [{"player_stat_name": "name of stat", "value": num (or other)}, {.......}] ,

For example Elisa won't sell aids of stats while Lona don't need it. 

Or Lona can't buy something if her stat["SlaveBrand"] != 0 :

req_game_player_stat": [{"player_stat_name": "SlaveBrand", "value": 0}],
(24 edits)

Ok. It's fine.

My own quest is done.

Eccma's quest has started.

At the very least, I've already figured out a way for modders to add items to traders without overwriting  dialogs.

While Eccma's quest is not yet done all of this will not happen centrally. But it will still work.


Eccma can use json method for simple cases (may be it's possible to add some tags into items in jsons of traders, for story_stats[""] or actor.stat[""] check? ShopNerf is already added by me in code above), and use old method when it's something really unique, and slowly extend the json method. Let's say, Eccma can use a hybrid way, for short. And even that is enough for modders to connect to the existing structure and use it then.

(6 edits)

I updated method. Eccma can looks at it if want. Its more useful now. 

91 edits of post.

(91 edits)

I think, that it will be better if 

$data_NameBarters

Will be created officially in the game. May as {}. But with unique name.

And then create adding mod-goods from it to barters in oficcial scripts.

Then modder will need only to modify this hash.

Because while all modders need to create new hash, then they create new alias_method for "def manual_trade". And if there will be a lot of mods, there will be a "multi-story pagoda".

If $data_NameBarters (or another name) will be one for all of mods, and adding mod-goods to trade will be one in offficial code of game, it will be better for optimization.

And, may be, sometimes it will be easier for Eccma in some cases to use $data_NameBarters and json files, for adding goods,  instead of adding  manually.

——

And i see that it's possible to add shopNerf to this method.

But it's will really increase code complexity.

——

BigMama.json  (Update comm. It's more useful to make one file for one npc)

{
    "npc_name": "59_69",
    "items":  [
        {
            "item_name": "ItemSurBot", 
            "custom_price": null, 
            "price_add": 0,
            "price_mult": 1, 
            "rndMin": 1,
            "rndMax": 5,
            "shop_nerf": [
                {
                    "base": 0, 
                    "base_mult": 1,
                    "attr_name": "weak", 
                    "attr_mult": 1, 
                    "attr_type": 0
                },
                { 
                    "base": -100,
                    "base_mult": 0,
                    "attr_name": "sexy",
                    "attr_mult": -1,
                    "attr_type": 0
                }
            ]
        },
        {
            "item_name": "ItemAdvBot",
            "custom_price": null,
            "price_add": 0,
            "price_mult": 1,
            "rndMin": 1,
            "rndMax": 5,
            "shop_nerf": [
                {
                    "base": 0,
                    "base_mult": 1,
                    "attr_name": "weak",
                    "attr_mult": 0.5,
                    "attr_type": 0
                }
            ]
        }
    ]
}


WorldDifficulty - increase price

weak - increase price

sexy - decrease price

simply use 

"shop_nerf": [
                {
                    "base": 0, 
                    "base_mult": 0,
                    "attr_name": 0,
                    "attr_mult": 0, 
                    "attr_type": 0
                }
            ]

to set it's effect to zero.

Code for modders:

module DataManager
    class << self
        alias_method :load_mod_database_TEST, :load_mod_database
    end
    
    def self.load_mod_database
        load_mod_database_TEST
        $TEST_mod_name = "Mod TEST"
        $TEST_modFolder = "ModScripts/_Mods/#{$TEST_mod_name}"
        $data_NameBarters_TEST = {} if $data_NameBarters_TEST == nil
        FileGetter.getFileList("#{$TEST_modFolder}/Data/Barters/*.json").each{|file|
            add_new_goods(file)
        }
    end
    
    def self.add_new_goods(path)
        temp_hash = nil
        
        begin
            temp_hash = JSON.decode(open(path).read)
        rescue 
            msgbox("Error in Json == [[ #{path} ]] :: def self.add_new_goods")
        end
        return if temp_hash == nil
            
        goods = []
        temp_hash["items"].each{|item|
            item_name = item["item_name"]
            custom_price = item["custom_price"]
            price = (item["price_mult"])*($data_ItemName[item_name].price.to_i) + item["price_add"]
            minNum = item["rndMin"]
            maxNum = item["rndMax"]
            nerf = item["shop_nerf"]
            goods += [[*$data_ItemName[item_name].get_type_and_id, custom_price, price.round, Random.new.rand(minNum..maxNum), nerf ]]
        }
        if $data_NameBarters_TEST[temp_hash["npc_name"]] == nil
            $data_NameBarters_TEST[temp_hash["npc_name"]] = goods
        else
            $data_NameBarters_TEST[temp_hash["npc_name"]] += goods
        end
    end
end
#######   This part of code can be official. #######
#######  Without using alias_method, of course.  ###
####################################################
    
module GIM_ADDON
    
    alias_method :alias_manual_trade_TEST, :manual_trade unless method_defined?(:alias_manual_trade_TEST)
        
    def manual_trade(good,charStoreHashName=nil, charStoreTP=0, charStoreExpireDate=nil, noSell=false, noBuy=false)
        goods = add_mod_goods(charStoreHashName)
        good += goods if goods != nil
        alias_manual_trade_TEST(good, charStoreHashName, charStoreTP, charStoreExpireDate, noSell, noBuy)
    end
        
    def add_mod_goods(charStoreHashName=nil)
        goods_base = $data_NameBarters_TEST["#{charStoreHashName}"]   
        return if goods_base == nil
        goods = []
        goods_base.each{|good_one|
            begin
                shop_nerf = 0
                good_one[5].each{|nerf|
                    attr_mult = nerf["attr_mult"]
                    attr_name = nerf["attr_name"]
                    if attr_name.class == String
                        attr_type = nerf["attr_type"]
                        nerf_attr = $game_player.actor.battle_stat.get_stat(attr_name, attr_type)
                    else
                        nerf_attr = attr_name.to_i
                        #You can use number instead of name and then it will be simple value. And then you can use your mathematical skills to do whatever you want. It can be useful to make base "shop_nerf" - negative (to turn price to zero). For example. Start price from zero: price*(1(base formula) - 1(this iteration) + weak*0.001(next iteration)).
                    end
                    nerf_attr_mod = attr_mult*nerf_attr
                    nerf_base = nerf["base"]
                    nerf_base_mult = nerf["base_mult"]
                    shop_nerf1 = ([([$story_stats["WorldDifficulty"].round, 100].min)*nerf_base_mult + nerf_base, 0].max*0.001)
                    shop_nerf2 = nerf_attr_mod*0.001  #A lot of sexy can alow Lona to get item and earn money by getting item (only for example).
                    shop_nerf += shop_nerf1 + shop_nerf2
                }
                price = (good_one[3]*(1+shop_nerf)).round
            rescue
                price = good_one[3]
            end
            goods +=[[good_one[0], good_one[1], good_one[2], price, good_one[4]]]
        }
        return goods if goods != []
    end
end
(8 edits)

Yes. There is a way to emulate that.

—————

test json, made for Noer Tavern Waifu. But we can add another barters to this file. And add more than one item to barters. Or we can do it in more than one file.

{
    "barters": [{
        "npc_name": "59_69",
        "items":  [{
            "item_name": "ItemSurBot", 
            "custom_price": null, 
            "price_mult": 1, 
            "rndMin": 1,
            "rndMax": 5
        }]
    }],
}


Test code:

module DataManager
    class << self
        alias_method :load_mod_database_TEST, :load_mod_database
    end
    
    def self.load_mod_database
        load_mod_database_TEST
        $TEST_mod_name = "Mod TEST"
        $TEST_modFolder = "ModScripts/_Mods/#{$TEST_mod_name}"
        $data_NameBarters_TEST = {}
        FileGetter.getFileList("#{$TEST_modFolder}/Data/Barters/*.json").each{|file|
            add_new_goods(file)
        }
    end
    
    def self.add_new_goods(path)
        temp_hash = nil
        
        begin
            temp_hash = JSON.decode(open(path).read)
        rescue 
            msgbox("Error in Json == [[ #{path} ]] :: def self.add_new_goods")
        end
        return if temp_hash == nil
        
        temp_hash["barters"].each{|barter|
            goods = []
            barter["items"].each{|item|
                item_name = item["item_name"]
                custom_price = item["custom_price"]
                price = (item["price_mult"])*($data_ItemName[item_name].price.to_i)
                minNum = item["rndMin"]
                maxNum = item["rndMax"]
                goods += [[*$data_ItemName[item_name].get_type_and_id, custom_price, price.round, Random.new.rand(minNum..maxNum) ]]
            }
            if $data_NameBarters_TEST[barter["npc_name"]] == nil
                $data_NameBarters_TEST[barter["npc_name"]] = goods
            else
                $data_NameBarters_TEST[barter["npc_name"]] += goods
            end
        }
    end
end
        
module GIM_ADDON
    
    alias_method :alias_manual_trade_TEST, :manual_trade unless method_defined?(:alias_manual_trade_TEST)
        
    def manual_trade(good,charStoreHashName=nil, charStoreTP=0, charStoreExpireDate=nil, noSell=false, noBuy=false)
        goods = $data_NameBarters_TEST["#{charStoreHashName}"]
        good += goods if goods != nil
        alias_manual_trade_TEST(good, charStoreHashName, charStoreTP, charStoreExpireDate, noSell, noBuy)
    end
        
end
(77 edits)

And the second one suggestion for improvement:

Every barter list of items in trade, to be changed by modder, need from modder to overwrite the whole dialog . It makes huge conflicts between mods.

May be it's possible to use something like this in json of items:

"barters": [{
        "barter": {
            "name": "CommonOrc",
            "type": 0,
            "set": null,
            "price": 1000,
            "min": 10,
            "max": 20
        }
}],

With data of price multiplier, and with data of number of items, with two numbers, and use  Random.new.rand(num1..num2)   in any barter dialog. With anything else if need. (I know a little in trading code , so it's only idea.)

And add items to trade, by something like this (it's only example of idea)

NPCName Ivent: (.rb)
    ####A lot of code####
good = []
$data_ItemName.each{|item|
    next if item[1] == nil
    next if item[1].barters == nil 
    item[1].barters.each{|barter|
        next if barter == nil
        next if barter.name != NPCname #Or group of NPC
        it = barter
        good += [[it.type, item.id, it.set, it.price, Random.new.rand(it.min..it.max)]]
    }
}
    ###A lot of code###

This method will allow every modder to simply add his own armors, weapons, and items to any trader. And it won't stop others modders from doing the same things with the same  traders.

Or we can use (in some cases) group/type of trader instead of name. Or do it in one time. Use for NPC in their event not only their uniq "barters" in json. We can  do the same "each each good+=" for groups after uniq items adding to the "good" array.

This method can be used not only for traders. Drop, or chests to. Simply use codename of chest as name of barter and then use the same code to create a list of items.

Or we can think of any other way to ensure that modders don't have to change the event code.

May we can create $data_BarterName… And use data from item's json (or create special folder for barters with special json files and collect them by the same way as $data_arpgskills) and put it in $data_BarterName, not in $data_ItemName, to decrease computer strain of working with $data_ItemName.

$data_BarterName  - hash of barters

 $data_BarterName["NPCName"]  - array (of barter's items)  

  $data_BarterName["NPCName"][n] - array or hash for each item

  $data_BarterName["NPCName"]  += [modders array/hash for modder item]

And then modders can do something like this (not exactly this) $data_BarterName["NPCName"] += hash_data_from_their_json["NPCName"]    (Or do it manually in code instead of using json)

good = []
$data_BarterName["NPCName"].each{|it|
     good += [[it["type"], $data_ItemName[it["item_name"]].id, it["set"], it["price"], Random.new.rand(it["min"]..it["max"])]]
}


Or, may be i don't know something and this is already exist.

(14 edits)

Now, in menu, names of persons, who was first for Lona, is dinal strings.

IMHO…


Now there in game:

["#{$game_text["menu:sex_stats/record_butt_virginity_taken"]} : ", $story_stats["sex_record_butt_virginity_taken"]],

I think, that it isn't good. Because changing language in the middle of the game, won't change names there.


Next code will be better:

Before:
    
textV = ""
    
textV +=      $game_text[$story_stats["sex_record_butt_virginity_taken"][0],true]
    
textV +=     " " + $game_text[$story_stats["sex_record_butt_virginity_taken"][1],true] if !["",0,nil].include?($story_stats["sex_record_virginity_taken"][0]) && !["",0,nil].include?($story_stats["sex_record_virginity_taken"][1])
    
textV +=     " " + $game_text[$story_stats["sex_record_butt_virginity_taken"][2],true] if !["",0,nil].include?($story_stats["sex_record_virginity_taken"][1]) && !["",0,nil].include?($story_stats["sex_record_virginity_taken"][2])
    
In the middle
["#{$game_text["menu:sex_stats/record_butt_virginity_taken"]} : ", textV],


And if we wants normal menu without strange strings, we need change all code in game as this:

$story_stats["sex_record_virginity_taken"] = "#{$game_text["DataNpcName:race/#{occupied_holes[i][1]}",true]}#{$game_text["DataNpcName:name/#{occupied_holes[i][2]}",true]}#{$game_text["DataNpcName:part/penis",true]}" if ["",0,nil].include?($story_stats["sex_record_virginity_taken"])

To something like this:

if ["",0,nil].include?($story_stats["sex_record_virginity_taken"][0])
    $story_stats["sex_record_virginity_taken"][0] = "DataNpcName:race/#{occupied_holes[i][1]}"    
    $story_stats["sex_record_virginity_taken"][1] = "DataNpcName:name/#{occupied_holes[i][2]}"
    $story_stats["sex_record_virginity_taken"][2] = "DataNpcName:part/penis"
end

Or do something like:

$story_stats["sex_record_virginity_taken"] = "DataNpcName:race/#{occupied_holes[i][1]}" + "|||" + "DataNpcName:name/#{occupied_holes[i][2]}" + "|||" + "DataNpcName:part/penis" if ["",0,nil].include?($story_stats["sex_record_virginity_taken"])

And then use this method:

$story_stats["sex_record_virginity_taken"].split("|||").each{|part|; textV = textV.to_s + $game_text[part,true] + " "} if !["",0,nil].include?($story_stats["sex_record_virginity_taken"])
["#{$game_text["menu:sex_stats/record_butt_virginity_taken"]} : ", textV.to_s],
(10 edits)

When Lona wearing Normal Mid, and SexyBot, she isn't nude.

Because SexyBot covers "Groin" in json.

Of course. it's covers Groin. But only phisically. Everyone can see through it.

IMHO:

  • We need to make Partial Covers. To separate physical coverage from visual coverage.
  • Or simply delete ["Groin"] from "equip_part_covered" in SexyBot json.
  • Or do something like this (not exactly this):
def player_nude?
    chest_present = actor.equip_part_covered.include?("Chest")
    anal_present = actor.equip_part_covered.include?("Anal")
    vag_present = actor.equip_part_covered.include?("Vag")
    return !(chest_present && vag_present && anal_present)
end
#Probably, it will be good idea to create "Breasts". And use it with "Chest" as "Groin"/"Vag" or "Butt"/"Anal". When it together it cover physically and visual, when only Groin/Butt/Chest/, without Vag/Anal/Breasts, then only physically. 
(1 edit)

Or, you can use something like this:

{
"base": {
    "attribute_name": "sta",
    "attribute_type": "current",
    "adjustor": "*",
    "adjustment": "1",
    "lowest_req" : "0",
    "highest_req" : "65535"
},
"compare": {
    "attribute_name": "health",
    "attribute_type": "current",
    "adjustor": "*",
    "adjustment": "0.01"
}
}

This method will create cost in "sta" fully depend on current health.  More "health" more cost of skill. Zero "health", zero cost of skill, (in this part of fully cost).

And use zero change in base part of cost, you can do it many times in one skill, and make cost in "sta" depending from many other stats.

(15 edits)

But, now, i think only about "-" or "+" in code and in json files.

What type will be more useful?

1) 

def process_skill_cost(skill):

cost_val = get_affected_attr(cost.base) - get_affected_attr(cost.compare)

def process_skill_cost_reverse(skill):

cost_val2= cost_val1 - ( get_affected_attr(cost.base) - get_affected_attr(cost.compare) )

OR:

2) 

def process_skill_cost(skill):

cost_val = get_affected_attr(cost.base) + get_affected_attr(cost.compare)

def process_skill_cost_reverse(skill):

cost_val2= cost_val1 - ( get_affected_attr(cost.base) + get_affected_attr(cost.compare) )

Json code above will propertly works with 1).
If use 2) ruby-code, i will need to use "0.02" ("0.01" for mood) instead of "-0.02" ("-0.01" for mood) in compare with wisdom_trait to decrease cost.

It's just a matter of convenience. Eccma can decide for himself which option he likes best.

(4 edits)

For example.


{

"item_name": "FireN",

"message2":"", 

"description":"", 

"name":"FireN", 

"occasion":0, 

"icon_index":680, 

"message1":"", 

"scope":1, 

"animation_id":0, 

"tag_main_settings":{"tag":"FireN","flag":"FireN","type":"other"}

"mp_cost":0, 

"speed":0, 

"features":[], 

"effects":[], 

"type":0, 

"element_id":0, 

"formula":"0", 

"variance":20, 

"critical":false, 

"success_rate":100, 

"hit_type":0, 

"stype_id":1, 

"tp_cost":0, 

"required_wtype_id1":0, 

"required_wtype_id2":0, 

"repeats":1, 

"tp_gain":0,

"textFlag": {

"folder": "Text",

"name": "DataSkill:FireStaffNormal/item_name",

"description": "DataSkill:FireStaffNormal/description"

},

"CHS_animation": "animation_casting_mh_long",

"wait_hit_frame": true,

"range": 5,

"back_stab":1,

"stealth": false,

"hit_frame":10,

"summon_user": "EffectCastingFireMagic",

"summon_hold": "EffectFireMagicShortHold",

"summon_hit": "FireBallMissileProjectile",

"no_parry":true,

"no_dodge":false,

"sap":false,

"hold_type": "energizing",

"hold_animation": "animation_hold_casting_mh",

"hit_detection":"Missile",

"projectile_type": 1,

"effect_since" : 5,

"launch_since" : 30,

"launch_max" : 31,

"ai_value": {

"assulter": 100,

"killer": 100,

"fucker": 100

},

"cost": [{

"base": {

"attribute_name": "sta",

"attribute_type": "current",

"adjustor": "-",

"adjustment": "4",

"lowest_req" : "0",

"highest_req" : "65535"

},

"compare": {

"attribute_name": "wisdom_trait",

"attribute_type": "current",

"adjustor": "*",

"adjustment": "-0.02"

}

},{

"base": {

"attribute_name": "mood",

"attribute_type": "current",

"adjustor": "-",

"adjustment": "1",

"lowest_req" : "-200",

"highest_req" : "65535"

},

"compare": {

"attribute_name": "wisdom_trait",

"attribute_type": "current",

"adjustor": "*",

"adjustment": "-0.01"

}

}],

"effect": [],

"add_state": [],

"hit_gate": "-1",

"hit_chance": []

}

Ok.

(19 edits)

module Battle_System

alias_method :process_skill_cost_base_MODNAME, :process_skill_cost

def process_skill_cost(skill)

# process_skill_cost_base_MODNAME(skill)

process_skill_cost_compare_MODNAME(skill)

end

def process_skill_cost_compare_MODNAME(skill)

skill.cost.each{

|cost|

cost_val = self.battle_stat.get_stat(cost.base.attr,cost.base.attr_type)

cost_val = get_affected_attr(cost.base) - get_affected_attr(cost.compare)

self.battle_stat.set_stat(cost.base.attr,cost_val,cost.base.attr_type)

}

end

alias_method :process_skill_cost_reverse_base_MODNAME, :process_skill_cost_reverse

def process_skill_cost_reverse(skill)

# process_skill_cost_reverse_base_MODNAME(skill)

process_skill_cost_reverse_compare_MODNAME(skill)

end

def process_skill_cost_reverse_compare_MODNAME(skill)

skill.cost.each{

|cost|

cost_val1=self.battle_stat.get_stat(cost.base.attr,cost.base.attr_type)

cost_val2= cost_val1 - ( get_affected_attr(cost.base) - get_affected_attr(cost.compare) )

cost_val2= (cost_val2*0.5).to_i

cost_val3=cost_val1+cost_val2

self.battle_stat.set_stat(cost.base.attr,cost_val3,cost.base.attr_type)

}

end

end



—————————

Simply use this code as mod. This method allow to use value of another stat (or percent of it), to decrease (or increase) base cost of skill. Using compare in skill's cost data.

I found that "cost" - "compare" in skills data doesn't work. And then i fixed it, or figured out a way to use it.

For example, now you can use (one percent of?) constitution trait to decrease (or increase) cost (in sta) of skill. Or ony another stat instead of constitution trait.

Or you can do something strange.

First cost [{}] in sta (cost=3), compare with constitution trait * (0.01). But second cost [{}] in this skill in sta too, but base cost=0, and compare in mood * (0.01). And it's gonna go like this, constitution trait will decrease cost, and positive mood wil decrease too, but negative mood will increase cost.

(5 edits)

Updating for items in inventory.

———

class Game_BattlerBase
    def states_save_fix
        @states = @states.reject {|id| $data_states[id] == nil}
    end
end
    
class Game_Actor < Game_Battler
    def skills_save_fix
        @skills = @skills.reject {|id| $data_skills[id] == nil}
    end
end
    
class Game_Party < Game_Unit
    def items_save_fix
        @armors = @armors.reject {|id| $data_armors[id] == nil}
        @weapons = @weapons.reject {|id| $data_weapons[id] == nil}
        @items = @items.reject {|id| $data_items[id] == nil}
    end
end
    
class Game_Player
    def hotkey_save_fix
        $game_player.slot_skill_normal = nil if $game_player.slot_skill_normal != nil && $data_skills[$game_player.slot_skill_normal] == nil
        $game_player.slot_skill_heavy = nil if $game_player.slot_skill_heavy != nil && $data_skills[$game_player.slot_skill_heavy] == nil
        $game_player.slot_skill_control = nil if $game_player.slot_skill_control != nil && $data_skills[$game_player.slot_skill_control] == nil
        $game_player.slot_hotkey_0 = nil if $game_player.slot_hotkey_0 != nil && $data_skills[$game_player.slot_hotkey_0] == nil
        $game_player.slot_hotkey_1 = nil if $game_player.slot_hotkey_1 != nil && $data_skills[$game_player.slot_hotkey_1] == nil
        $game_player.slot_hotkey_2 = nil if $game_player.slot_hotkey_2 != nil && $data_skills[$game_player.slot_hotkey_2] == nil
        $game_player.slot_hotkey_3 = nil if $game_player.slot_hotkey_3 != nil && $data_skills[$game_player.slot_hotkey_3] == nil
        $game_player.slot_hotkey_4 = nil if $game_player.slot_hotkey_4 != nil && $data_skills[$game_player.slot_hotkey_4] == nil
        $game_player.slot_hotkey_other = nil if $game_player.slot_hotkey_other != nil && $data_skills[$game_player.slot_hotkey_other] == nil
    end
end
    
module DataManager
    class << self
        alias_method :extract_save_contents_save_fix, :extract_save_contents
    end
    
    def self.extract_save_contents(contents)
        extract_save_contents_save_fix(contents)
        $game_player.actor.states_save_fix
        $game_player.actor.skills_save_fix
        $game_party.items_save_fix
        $game_player.hotkey_save_fix
    end
end
(4 edits)

Why not?
Make 2 versions of soundlib, and when game starting, chose one of them. Depend of settings.
In first there is a full audio. In the second some parts is silent.

Or make somthing like $lang for voice. With loud of voice audio, and everityme, when voice-audio is calling in game, use $loud to change loudness of voice. Voice audio will be a new code strings, and it will be easy to insert $loud in every new code string with voice callings. It will be really problem to insert $loud in old callings soundlib. But easy to new.

(2 edits)

Voiceover, if added, then so that it can be turned off in the settings.

(4 edits)

If you load 'broken save' with this code as mod, and then create 'new save file' you don't need this code more to load your 'new save file'. This code cleans game, and 'new save file' clean too.

(2 edits)

If some mod added states or skills, and then gamer purchased them…

And if gamer deleted this mod, and then trying to load the save file with added skills and states… 

A lot of errors!!!