Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> [XP] Set actor level to that of another actor or the entire party, A fair bit detailed but overall simple process
Daxis
post Aug 3 2010, 06:58 AM
Post #1


Level 6
Group Icon

Group: Member
Posts: 76
Type: Event Designer
RM Skill: Skilled




Set actor level to that of actor or the entire party
By Daxisheart


WTF is this:
A tutorial on how to change an actor's level to that of a party member or the entire party. It's an very simple idea for me, and despite the directions it's only a couple of clicks, so I'd thought I'd put this up for any noob.
Of course, the tutorial is just how I'd do it, not anyone else. If you have different ways, good for you, maybe post them up for the community to use. This tutorial is just my way.
Also to be noted, I'm doing this on RMXP since I'm XP biased. Quite easy to adapt to any other RM, and you should get an idea of what just happened and be able to adapt by the end of it.

Prerequisites:
You need to know the basics of controlling variables. The basics are really all that's needed; just know to set variables, basic addition, etc. A competent user, which I will assume you are, can glance at the event screen and can pretty figure out what it's supposed to do (I mean, Control variable controls the variables obviously, setting a variable SETS it to a certain number of your choosing, etc.). When I state a word, like an operand, at least check your control variable screen for the blue word "operand" before asking what it is, etc.


Picture:
Here's a picture of the "Control Variables" Event screen. Throughout the tutorial, I'll refer to the things and numbers that I'd marked out and highlighted a couple times throughout the tutorial.


Tutorial A: Set actor level to that of another character.
You have a level 32 CHAR1. You want to introduce CHAR2 into your party, and CHAR2's level is 1. You want to change CHAR2 to the same level as CHAR1. Here's how we do it:

Action 1: Go to the first page of events. Go to "Control Variables." Set out a variable. Let's call it ACTOR_VAR. Done at (1), and set using operation at (2)

Action 2: Set your ACTOR_VAR to operand actor, which is (4). For the actor, (5), change it to the actor you want to the other to change to.
(So, if we want CHAR2 to be like CHAR1, set it to the actor CHAR1)
Right next to (5) is (6), and set it, (6), to level, which it should already be at actually.

Action 3: Same controlled Variables screen, In Operations, (2), subtract ACTOR_VAR by exactly 1. You'll find out why, and I'm quite sure there are ways around this, but it's the easiest thing I've got in mind at the moment.

Action 4: Go to the 3rd event page, and go to "Change Level." Set actor to the actor's level you want to change to (CHAR2). Set the operation to decrease, and just set it to constant 99.

Action 5: Now, got to the same "Change Level" event again, and then set it to the same actor (CHAR2). Then, instead of the operand constant, we set it to variable ACTOR_VAR. Increase CHAR2's level by ACTOR_VAR.

Congrats! Now, you have a level 32 CHAR2, the same level as Level 32 CHAR1!


Wait a minute, WTF happened? Let's recap now so you can understand what just happened.

For Actions 1-2, we made it so that a variable is the same number as CHAR1's level.
For Actions 3-4, because RMXP's change level event operation has to increase or decrease, we decrease ACTOR_VAR BY 1, and change CHAR2's level TO 1 so we can add a number that would then be the same as CHAR2. Don't worry about the huge 99; decreasing CHAR2's level by 99 would simply bring it to 1.
For Action 5, we then add ACTOR_VAR to CHAR2's current level, resulting in the same level as CHAR1.

Here's a little mathematical example:

1 + (X-1) = X
X is CHAR1's level, courtesy of action 2
1 is CHAR2's initialized level, courtesy of Action 4.
The (X-1) is the ACTOR_VAR minus 1, courtesy of Action 3.
1 + (X-1) is basically courtesy of Action 5, which finishes the whole thing.

For this, you basically had to know the operations of the event screen and basic control variables. Simple enough, and if you actually count the number of clicks, it's barely anything at all.

Tutorial B: Change a new party member to the average level of the entire party
The title says it all. You want to introduce CHAR 5 to the party, which consists of CHAR1, CHAR2, CHAR3, and CHAR4. You want CHAR5 to be the AVERAGE of the entire party. Basically, once you've learned how to do Tutorial A, B is just repetition crap.

Action 1: Go to the 1st page of events. Go to "Control Variables". Create 5 variables, ACTOR_VAR1, ACTOR_VAR2, ACTOR_VAR3, ACTOR_VAR4, and Party Average

Action 2: Set your ACTOR_VAR1 to operand actor. For the actor, change it to the first party member in your party, found at (6), remember? Set it to level, of course, found at (7).

Action 3: Repeat Action 2 to each of the party members in your party, but using the corresponding ACTOR_VAR#, aka, use ACTOR_VAR1 for CHAR1, ACTOR VAR2 for CHAR2, etc.

Action 4: Go to the "Control Variables" screen once more, and set the variable you want to change to PARTY_AVERAGE. Next, for operations (2), change the operations to add. Next, for Operands (3), set it to Variable, and choose ACTOR_VAR1.

Action 5: Repeat Action 4 to each of the four ACTOR_VAR#. By the end, PARTY_AVERAGE should have the amount of ACTOR_VAR1-4 added up.

Action 6: Divide PARTY_AVERAGE by 4, or the amount of party members you have. THAT'S IT!!! THAT'S THE AVERAGE LEVEL! GUESS WHAT THE H*** WE DO NEXT?!?!?!

Action 7: Subtract PARTY_AVERAGE by exactly 1.

Action 8: Go to the 3rd event page, and go to "Change Level." Set actor to the actor's level you want to change to (CHAR5). Set the operation to decrease, and just set it to constant 99.

Action 9: Now, got to the same "Change Level" event again, and then set it to the same actor (CHAR5). Then, instead of the operand constant, we set it to variable PARTY_AVERAGE. Increase CHAR5's level by PARTY_AVERAGE.


AND.... YOU'RE DONE. Okay, the usual WTF, and now for the explanation:

For Action 1, we created the variables we're about to use. Simple enough.
For Actions 2-3, we set all the ACTOR_VAR# to the respective party members that you currently have.
For Actions 4-5, we added up all of the ACTOR_VAR# into PARTY_AVERAGE. That gives you the amount of ACTOR_VAR# added up, which is used...
For Action 6, where we got the average of the 4 party members added together.
For Actions 7-9, we did the usual familiar thing that we did in Tutorial A. With that, CHAR5 has the average of your party, or at least CHAR1-4.

Now, there's something that pops up when doing all this. What would happen if, at step 6, PARTY_AVERAGE was an odd number, or one not perfectly divisible by 4?
Well, RMXP's program rounds DOWN if the number if it's not an integer. If it's 2.5, the variable would become 2. If it's 2.9999999999999, it rounds down to 2. For any programmer out there, you know exactly what I'm talking about.
So, let's give an example with basic numbers to show why rounding down is the proper choice for this with an example:
1 + 1 + 2 + 1 = 5. 5/4 = 1.25, which rounds down to 1. When we finish up Actions 7-9, it becomes 0, which added to the initialized level of 1, the character would then be level 1. Now, if it had rounded up, the character would be level 2, which, as you clearly see, is not the average. 1.25 is closer to 1 than to 2.
The level that is given from Tutorial B is the average, or as close as it can get considering that "levels" deals purely in integer numbers.

As you can clearly see, Tutorial B is simply Tutorial A extended a little bit. The extra variables were purely made to accommodate the number of CHARs that we are working with. Tutorial B can work with only 2 CHARs and adding CHAR3, resulting in only 3 variables, or 22 CHARs, resulting in 23 variables.

Oh yeah, I should mention at this moment if you really didn't know...
You don't HAVE to introduce a new actor into your party. You can just fiddle around with the actors in your database for whatever your needs are. I'm using the variables names PARTY_AVERAGE and things like that to only easily accommodate you with the ideas of using the variables in this way. I'm pretty sure you already know this, so whatever.



So, anyway, those are the two tutorials right there for something simply done. A lot is written, if you notice, but it's actually very, very simple once you understand where the direction's going, which is nothing hard at all.
Of course, this is the way I'd do things. If I had to, I would do it this way. If anyone has a problem with the ideas I've written down, there's a technical problem because of some careless error/instruction of mine, or someone thinks that they have a more efficient way to do things, just inform me.

Moving this to event emporium DH.


__________________________
The same reason they call it hold water is the same reason they call it holy s***
Go to the top of the page
 
+Quote Post
   
Alt_Jack
post Aug 4 2010, 03:13 PM
Post #2


Level 19
Group Icon

Group: Revolutionary
Posts: 377
Type: Event Designer
RM Skill: Skilled
Rev Points: 40




Yep. And it's a bit shorter, too.

create the event

Create a variable called "Level"
Go "set"
then "actor (whoever)'s-Level
So it should say "variable [ level ] = actor [1] level
next is "change level", then instead of filling in the number, set the variable to "level"
If your actor 1 is L32, and the member ou introduce is 1, then the system does 32+1, giving the new one a level of 33, which is why we subtract 1, to make them the same

to fix it

you can either have the change level subtract the 1 or create another variable function that removes the 1

As for changing it to the average party level...why? You can even just have the system generate a random # for the variable, or just set it to a specific number (if you play through it enough, you should have an idea what the party's level will be like at that point).

This post has been edited by Alt_Jack: Aug 4 2010, 03:17 PM


__________________________

the Alternate Jacks event demo
As well as all of my images in one place, free for use.
Most of my images will be there, since this site takes too long to approve stuff and VX.net has no bulk uploader.
Go to the top of the page
 
+Quote Post
   
Wellus
post Dec 28 2011, 10:02 PM
Post #3


Level 4
Group Icon

Group: Member
Posts: 54
Type: Event Designer
RM Skill: Intermediate




Daxis nice job.

Alt jack sorry but NO your tutorial isn't viable I just tested it.
yours might be easier but the whole idea of setting the actors level to another actor in your party is meant to be automatic not hoping the person who plays the game doesn't sit in the field and max out his/her level to 99.


_____________________________________________________________________
Example:

ME: I think the player will roughly be level 55 once he reaches the cave.

GAME ADDICT: I might stay in the mountains util I've maxed out my level.

He eventually finds the 2nd character & GOD DAMN now I have to level him up aswell!

argg I just spent half the day leveling I'm sick of this!
______________________________________________________________________

there's a massive difference between level 55 and 99.

I'm sorry the idea is awesome but in practice not so much.








__________________________


My userbar was made with Paint.
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th June 2013 - 05:13 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker