Lune Item Weight

Raizen

Veteran
Veteran
Joined
Oct 24, 2012
Messages
381
Reaction score
660
First Language
Portuguese
Primarily Uses
RMMV
Lune Item Weight
Raizen
Introduction
 
 
Item Weight, it implements the feature of all items having weight, so some special cases can be made according to the weight limit and items carried.

Portuguese user? Portuguese script page
Features
 
- Items can have default weight, for faster Databasing
- Compatible with my Vault System, soon will be translated
- Easy to configure by notetagging
- Easy eventing based on normal variables
- Items can be throwed away

Screenshots
 

 
How to Use
 
Instructions on the script

 
Script
 
 
http://pastebin.com/raw.php?i=ghb3f4Qe


Credit and Thanks
- Raizen
 
Last edited by a moderator:

shiori4me

Veteran
Veteran
Joined
Nov 26, 2013
Messages
196
Reaction score
6
First Language
English
Primarily Uses
Now, I am very confused with your "attribute" function on here.

Say I wanted to have the formula for an actor's weight formula to be 

luk * 10 + 1000

or something, I tried that, and it didn't work.

I wanted to use Luck because I've renamed Luck to Strength.

How would I do that? It wouldn't let me.

Or might you be willing to add functionality for that?

Your system is the only one that works well for me.
 
Last edited by a moderator:

Raizen

Veteran
Veteran
Joined
Oct 24, 2012
Messages
381
Reaction score
660
First Language
Portuguese
Primarily Uses
RMMV
Now, I am very confused with your "attribute" function on here.

Say I wanted to have the formula for an actor's weight formula to be 

luk * 10 + 1000

or something, I tried that, and it didn't work.

I wanted to use Luck because I've renamed Luck to Strength.

How would I do that? It wouldn't let me.

Or might you be willing to add functionality for that?

Your system is the only one that works well for me.
The only variable you can use inside the formula is at, did you try this already?

# Exemple Carry_Limit = lvl1 will make only the strength of the# first actor to be put in the formula.Carry_Limit = :all_foror Carry_Limit = :for1 # if it is for just 1 actor

and then 

# def self.weight_formula(at)# at * 2 +1000# end?

Even though you renamed the atribute, I think it is still the same, if it isn't you can still do it by eventing with variables like this.

# Exemple Carry_Limit = lvl1 will make only the strength of the# first actor to be put in the formula.Carry_Limit = :varand then for variable 2 in events.

# def self.weight_formula(at)# 2# endthat way you can add a parallel event or event call for making that variable equals to the atribute you need :) .
 

shiori4me

Veteran
Veteran
Joined
Nov 26, 2013
Messages
196
Reaction score
6
First Language
English
Primarily Uses
Yeah, I made it so that the carry capacity is equal to a variable, but seeing as how my game is open-ended, you wouldn't be getting the LUK of Actors 1-4, you'd be getting the LUK of Index 1-8 (which can be done in a parallel process but is slower) but the thing is that constantly would the variable need to be bound towards say the LUK (aka STR or Strength) of Index 1 through 8, even in battle, as there can be debuffs and buffs and states that lower parameters. Might you be willing to add the ability to use parameters in the carry capacity of the party? Say self.luk * 100 would be the carrying capacity of a given index.

I'm using :all_for
 
Last edited by a moderator:

Raizen

Veteran
Veteran
Joined
Oct 24, 2012
Messages
381
Reaction score
660
First Language
Portuguese
Primarily Uses
RMMV
Sure, actually just for future cases, you can do it yourself like this xD.

find this at the beginning of the script.

when :all_for weight = 0 for members in 0...$game_party.members.size - 1 weight += weight_formula($game_party.members[members].param(2)) endyou see the param(2)?

the 2 is the id for strength, you can put 7 for luk, 6 for def.. and a lot more :p .

so changing that to this

when :all_forweight = 0for members in 0...$game_party.members.size - 1weight += weight_formula($game_party.members[members].param(7))endyou get the members luk.

If possible get the updated script on the topic, I fixed an issue some days ago xD.
 
Last edited by a moderator:

shiori4me

Veteran
Veteran
Joined
Nov 26, 2013
Messages
196
Reaction score
6
First Language
English
Primarily Uses
I cannot get this to work.
 
Here are my settings:

# Exemple Carry_Limit = lvl1 will make only the strength of the# first actor to be put in the formula.Carry_Limit = :all_for
Code:
def self.weight_formula(at)  at * 3.5 * 100end
Code:
    when :for1      weight = weight_formula($game_party.members[0].param(7))    when :all_for      weight = 0      for members in 0...$game_party.members.size - 1        weight += weight_formula($game_party.members[members].param(7))
I go to a shop and it says the weight is 
150/0
Which means I have a weight of 150 and I can carry 0
so even if I have a lot of gold, I cannot buy a potion.
 
I check variable 6 and its value is 0.
 
So I decided to play with some settings:

# Exemple Carry_Limit = lvl1 will make only the strength of the# first actor to be put in the formula.Carry_Limit = :var
Code:
def self.weight_formula(at)  700end
Code:
    when :for1      weight = weight_formula($game_party.members[0].param(2))    when :all_for      weight = 0      for members in 0...$game_party.members.size - 1        weight += weight_formula($game_party.members[members].param(2))
just to make sure. 
I set variable 6 to 700 then added 999 gold and went to the shop and
still the weight was 150/0
 
Actually I would like to make it so that items cannot be thrown away and that you can buy items even if you're overweight.
Although I suppose that's less of a concern at the moment.
 
The only thing that works for me is :fix
 
This is a fresh project, by the way. What's wrong?

I can give you a demo if need be.
 

--------
Here is what I'm trying to do.
 
The user can carry 100 pounds (lbs), around the equivalent of 45.36 kilograms.

At level 100, they can carry about twice that weight.

So the formula is

def self.weight_formula(at) at * 3.5 * 100end--------

There is only one project where it works for me (which I don't understand since I can copy the script from that project and paste it to that to the new one and it won't work) but when it does work, :all_for only counts for the first actor's attributes, not the whole party's.
 
Last edited by a moderator:

Raizen

Veteran
Veteran
Joined
Oct 24, 2012
Messages
381
Reaction score
660
First Language
Portuguese
Primarily Uses
RMMV
Oh this gets the .

# Exemple Carry_Limit = lvl1 will make only the strength of the# first actor to be put in the formula.Carry_Limit = :vardef self.weight_formula(at) 700endvariable 700 value, thats why it shows 0 if you want variable 6,

def self.weight_formula(at) 6end :D .

And I don't really get the first problem, just tested it on a fresh project, and here it shows 31150.0 Oz the limit,

which means it sums up all the strength of all the characters and them it multiplies by 350.
 

shiori4me

Veteran
Veteran
Joined
Nov 26, 2013
Messages
196
Reaction score
6
First Language
English
Primarily Uses
This is what Idid to make it work:

def self.weight_formula(at) ($game_party.members.inject(0) { |r, member| r += member.luk }) * 35 / 10 * 1000endAnd I'm not for sure why it is that it won't work for me. I can try english or japanese and still it won't. Hmm.

How would I make it so that items can't be thrown away and that you can still buy items when you're overweight?

Should there be certain parts that I remove?

I was just going to make it so that when you're overweight, your movement speed (so you'll always have map enemies bump into you and initiate a battle) and battle performance is lowered, but that there are various places where you can store items. 

What if you made it so that gold has weight, too? Like it can be a formula like for-every-10-is-one-more-point-of-weight
 
Last edited by a moderator:

shiori4me

Veteran
Veteran
Joined
Nov 26, 2013
Messages
196
Reaction score
6
First Language
English
Primarily Uses
Hello.

I wanted to get of the ability to throw away items. 

But more importantly, the variables for weight and max weight only update when I view them in the menu.

So that means if I were to have a variable window on the map using this 

http://www.gdunlimited.net/scripts/rpg-maker-vx-ace/window-scripts/window-multi-variable

or if I were to add 1 to the variable of Current Weight, it wouldn't re-adjust itself.

Which also means that I can't condition or use those variables without having them be updated by viewing the current weight by viewing info of an item/weapon/armor.

Is this an error, or default?
 

shiori4me

Veteran
Veteran
Joined
Nov 26, 2013
Messages
196
Reaction score
6
First Language
English
Primarily Uses
Not to bother, but is this something you experience as well? Or is it only me?

The weight variables will only update themselves when I go to the menu so I can't use the variables for eventing/scenes or display.
 

Raizen

Veteran
Veteran
Joined
Oct 24, 2012
Messages
381
Reaction score
660
First Language
Portuguese
Primarily Uses
RMMV
Hello.

I wanted to get of the ability to throw away items. 

But more importantly, the variables for weight and max weight only update when I view them in the menu.

So that means if I were to have a variable window on the map using this 

http://www.gdunlimited.net/scripts/rpg-maker-vx-ace/window-scripts/window-multi-variable

or if I were to add 1 to the variable of Current Weight, it wouldn't re-adjust itself.

Which also means that I can't condition or use those variables without having them be updated by viewing the current weight by viewing info of an item/weapon/armor.

Is this an error, or default?
Sry for biiig time without answer, the site was so slow I kind of didn't come here frequently to answer questions.

No, thats a problem with the script it self :/, I'll see if I can fix that for you :) .

for the first question, in the script there is a part to put to receive itens overweighted, so that you can event based on the weights x).

I'll fix the points you are telling me, sorry for long time to answer :/
 

shiori4me

Veteran
Veteran
Joined
Nov 26, 2013
Messages
196
Reaction score
6
First Language
English
Primarily Uses
That's okay :) I look forward to it.
 

Arsist

Veteran
Veteran
Joined
May 16, 2014
Messages
140
Reaction score
10
Primarily Uses
I'm interested.

I'm trying to get a grasp of this script...

Weight is updated in the shop, when you gain an item, and when you view an item, I think. I'm not for sure about when you equip/unequip something. Is weight updated when you lose an item?

I wouldn't think that the variable not adjusting itself would be an error. That would mean that the script would have to constantly update. If you want to adjust the variable, make a mock variable then modify that.
 
Last edited by a moderator:

radicalpain

Villager
Member
Joined
Oct 7, 2014
Messages
6
Reaction score
0
First Language
English
Primarily Uses
awesome script! I would love to use it but having issues with it working with my other scripts :(


R.P
 

Lonelywraith

The Storyteller of Woe
Veteran
Joined
May 5, 2015
Messages
54
Reaction score
5
First Language
Spanish
Primarily Uses
RMVXA
Hi, Raizen, I'm sorry for being so noob but a have a question a.a. I've already set all the items, armors and weapons weight and stuff, I didn't edit too much of the script, I just put ":all_for" and the formula's the same:


def self.weight_formula(at)
  at * 2 + 1000
end


But when I'm going to test it the player's weight is still 0. What can I do to fix it?
 

HugsAllAround

Warper
Member
Joined
Apr 13, 2016
Messages
1
Reaction score
0
First Language
English
Primarily Uses
Hello, Raizen!


Great work you've done here, I really appreciate it! I've already used this script a little in the game I'm currently working on, and it's great. It functions well, and looks really nice! I only have one issue that I've noticed, and it isn't really a large one. 


This may be that I have some weird option checked or that I have made a rookie mistake, but I noticed that I am able to select the 'Use' option for both weapons and armour. This is of course because of the extra window you have programmed in that allows you to throw away or use an item. However, it seems to override the game's core programming that prohibits the player from using a weapon or piece of armour. 


The end result is the game crashing if you select 'Use' on a weapon or piece of armour. The crash report is


Script 'Scene_ItemBase' line 80: NoMethodError occurred.


undefined method 'for_friend?' for #<RPG:Armor:0xb3e4a1c>


Obviously, that last little spiel with RPG:Armor refers specifically to the piece of armour that I happened to select. Either way, what I take from this is that it basically is saying it has no method of processing this use of the armour because armour is not programmed to be consumed in this manner.


As I said, it's not a huge issue as I can just warn against it in the tutorial, but if it's some kind of quick fix I can make to the coding, I'd love your input!


Cheers!
 
Last edited by a moderator:

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,923
Reaction score
534
First Language
English
Primarily Uses
N/A
Can this be used to disable running and even reduce movement speed if the character is carrying too much?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top