MiD

Veteran
Veteran
Joined
Oct 22, 2018
Messages
89
Reaction score
36
First Language
Greek
Primarily Uses
RMMV
Forgot to create an object before the IF condition, so condition failed every time.

It has happened to me before. I setup the properties i'm going to use in the beginning of the game to make sure they will exist when the time comes to check them!
 

SarcasticSloth

Villager
Member
Joined
Jul 11, 2018
Messages
11
Reaction score
0
First Language
English
Primarily Uses
RMMV
I will be using this to lessen the number of variables I actually have to keep track of. Thanks, mate!
 

kako05

Veteran
Veteran
Joined
Sep 11, 2017
Messages
194
Reaction score
30
First Language
Australian
Primarily Uses
RMMV
Is it possible to store game's normal variable value to plugins variable property?
Using "Variable ID 1>set>random 200-400" and store (add/set) the outcome to the variable created by this plugin command?
 

MiD

Veteran
Veteran
Joined
Oct 22, 2018
Messages
89
Reaction score
36
First Language
Greek
Primarily Uses
RMMV
Is it possible to store game's normal variable value to plugins variable property?
Using "Variable ID 1>set>random 200-400" and store (add/set) the outcome to the variable created by this plugin command?

Not sure if i understood the question but i'll attempt to answer it:
When you have a variable as an object variable, you cannot assign values to it as normal. But you can store the value of another variable. So, for example,
1) you can setup variable 1 to hold a property called "random", with a value of 0
2) then set variable 2 to the random number you want
3) store the outcome to variable 1's "random" property

That would be:

1) maka.objVar.setProp(1, "random", 0)
2) Variable 2 -> set -> random 200-400
3) maka.objVar.setProp(1, "random", $gameVariables.value(2))

You could skip step 1, since the property will also be created by step 3, but i always like to initialize whatever i'm going to use beforehand.

Then you can show it by \VOBJ[1:random]
 

kako05

Veteran
Veteran
Joined
Sep 11, 2017
Messages
194
Reaction score
30
First Language
Australian
Primarily Uses
RMMV
Screenshot_7.png

Instead of adding to total sum "1+2=3"
this script command just add value after the first value "1+2=12"
Is this how it suppose to work?
 

MiD

Veteran
Veteran
Joined
Oct 22, 2018
Messages
89
Reaction score
36
First Language
Greek
Primarily Uses
RMMV
View attachment 152951

Instead of adding to total sum "1+2=3"
this script command just add value after the first value "1+2=12"
Is this how it suppose to work?

Hey man, let me check it out one moment and i'll get back to you.
 

MiD

Veteran
Veteran
Joined
Oct 22, 2018
Messages
89
Reaction score
36
First Language
Greek
Primarily Uses
RMMV
View attachment 152951

Instead of adding to total sum "1+2=3"
this script command just add value after the first value "1+2=12"
Is this how it suppose to work?

Hey, I just checked it, and you're right, it's a bug i missed with the plugin command. Instead of

Plugin Command - > NewVarProp: 55 xxx 1

please use instead:

Script - > maka.objVar.setProp(55,"xxx",1)

until i fix this. With this change, the rest should add the numbers correctly.

I'll contact again once it has been fixed. Thanks for telling me!
 

kako05

Veteran
Veteran
Joined
Sep 11, 2017
Messages
194
Reaction score
30
First Language
Australian
Primarily Uses
RMMV
Hey, I just checked it, and you're right, it's a bug i missed with the plugin command. Instead of

Plugin Command - > NewVarProp: 55 xxx 1

please use instead:

Script - > maka.objVar.setProp(55,"xxx",1)

until i fix this. With this change, the rest should add the numbers correctly.

I'll contact again once it has been fixed. Thanks for telling me!

When this going to be fixed? And will adding values to objects created by plugin command before the fix will work? I just rewrote my game to use plugin command objects instead of regular variables and would take half a day to change them to script command :smile:
 

MiD

Veteran
Veteran
Joined
Oct 22, 2018
Messages
89
Reaction score
36
First Language
Greek
Primarily Uses
RMMV
When this going to be fixed? And will adding values to objects created by plugin command before the fix will work? I just rewrote my game to use plugin command objects instead of regular variables and would take half a day to change them to script command :smile:

I've already fixed the plugin command, i'm just testing it now, I'll update the plugin command in a couple of seconds, sorry about the trouble, i'm still a junior in JS :s
 

kako05

Veteran
Veteran
Joined
Sep 11, 2017
Messages
194
Reaction score
30
First Language
Australian
Primarily Uses
RMMV
I've already fixed the plugin command, i'm just testing it now, I'll update the plugin command in a couple of seconds, sorry about the trouble, i'm still a junior in JS :s

One suggestion.
Add an entry that you can add a number or variable to object using

maka.objVar.changeProp("add", $gameVariables.value(2), 55, "xxx");
or
maka.objVar.changeProp("add", 2 , 55, "xxx");
:smile:

Great plugin. Makes default variables unnecessary in most cases.
 
  • Love
Reactions: MiD

MiD

Veteran
Veteran
Joined
Oct 22, 2018
Messages
89
Reaction score
36
First Language
Greek
Primarily Uses
RMMV
When this going to be fixed? And will adding values to objects created by plugin command before the fix will work? I just rewrote my game to use plugin command objects instead of regular variables and would take half a day to change them to script command :smile:
I just made a quick fix, it's version v1.3b now. Can you please re-download the plugin and verify that it has been fixed?
 

kako05

Veteran
Veteran
Joined
Sep 11, 2017
Messages
194
Reaction score
30
First Language
Australian
Primarily Uses
RMMV
I just made a quick fix, it's version v1.3b now. Can you please re-download the plugin and verify that it has been fixed?
Yes. It's fixed now. Thank you for your hard work :kaoluv:
 
  • Like
Reactions: MiD

MiD

Veteran
Veteran
Joined
Oct 22, 2018
Messages
89
Reaction score
36
First Language
Greek
Primarily Uses
RMMV
Yes. It's fixed now. Thank you for your hard work :kaoluv:

Great ! I'm glad the plugin has helped you!
Just as a note,

Code:
maka.objVar.setProp(55, "xxx", 1)

is the same as

Code:
$gameVariables.setValue(55,{xxx: 1})

and

Code:
maka.objVar.getProp(55, "xxx")

is the same as

Code:
$gameVariables.value(55)["xxx"]

Also, when i use this plugin with scripts, i ALWAYS do this:

Code:
var a = maka.objVar;
a.setProp(55, "xxx", 1);

So that i can type commands faster (but these must be on the same script).

I mostly made this plugin to simplify this process, to include arrays as properties (far more useful once you get into it) and to enable you to show them in a text easily.

Also, in my opinion this should work far better with scripts, since you can have variable properties "xxx1"all the way to "xxx100" (100 properties!) and you can simply alter ALL of them by using:


Code:
var a = maka.objVar;
for(var i=1; i<=100; i++){
a.changeProp('add', 1, 55, "xxx"+i);
}

This would add 1 to all properties of variable 55 from "xxx1" to "xxx100". I thought it was a cool thing to mention here.

Just as an example of why you would need something like that: Imagine if you had a city with a 100 people inside, and you wanted to mention that each one of them had age, and, each turn, all of them aged by 1 year. So you could use "age1" instead of "xxx" in the example above to imply "age of person 1". Then you could have chances of them falling ill if they're older, or producing more goods if they're younger, etc.
 
Last edited:

wolfr136a1

Villager
Member
Joined
May 7, 2021
Messages
24
Reaction score
10
First Language
English
Primarily Uses
RMMV
Makai, you're the same guy who made that Steam tutorial about object variables right?
How to make a variable hold more than 1 value (aka Fun with Object variables)
Are you forbidden from linking that to this thread? I think it helps users understand more about the inner workings of your plugin.

Before I read your tutorial I never even thought about using object variables. After that I can't imagine making an RMMV game without one. I find nested object variables so much more intuitive to use than nested array variables. Plus you can add new objects on the fly unlike when using arrays wherein you need to keep track of what goes into which index.

Thanks a lot for the tutorial! Great help for noobs just starting to learn javascript.
 
  • Love
Reactions: MiD

MiD

Veteran
Veteran
Joined
Oct 22, 2018
Messages
89
Reaction score
36
First Language
Greek
Primarily Uses
RMMV
Makai, you're the same guy who made that Steam tutorial about object variables right?
How to make a variable hold more than 1 value (aka Fun with Object variables)
Are you forbidden from linking that to this thread? I think it helps users understand more about the inner workings of your plugin.

Before I read your tutorial I never even thought about using object variables. After that I can't imagine making an RMMV game without one. I find nested object variables so much more intuitive to use than nested array variables. Plus you can add new objects on the fly unlike when using arrays wherein you need to keep track of what goes into which index.

Thanks a lot for the tutorial! Great help for noobs just starting to learn javascript.

Thanks! Yeah I wrote that guide.

I can't imagine making a project without them either. Since then I've come up with more versatile ways of setting up objects and reading from them but I can't really make a simplified plugin like this one for them - they would require some editting. If you want to learn more, send me a private message and I'll guide you through there! :)
 

Latest Threads

Latest Posts

Latest Profile Posts

Awright ya marshmallows! :kaopride: Here's a peek of what Alice's 8-bit Gothic gonna be like! EXPECT IT! (...in 2025?) :kaoswt:

alice_gothictiles.png
SF_People3_4 added!
index.php

Finds notes for an old side project... Oh, that's right, the two tracks that sounded really cool and gave inspiration for the big bad in that game... Spends day working on cutscene from old notes, looks okay, now lets slot in the first track... um... I did have those tracks??? It was a year or so ago but I did buy them didn't I?
CA9mtHJ.gif

Everything is really confusing for me

Forum statistics

Threads
118,588
Messages
1,117,149
Members
155,655
Latest member
Pepperboi
Top