ENGINE TIPS, TRICKS AND BITS (OF INFORMATION)

Posts

author=LightningLord2
Attack Priority in VX Ace works as follows:

First, Discard all attacks whose condition doesn't apply. Then, take the attack(s) with the highest priority and discard all whose priority is three or more points below that. I'm taking 5 as the highest value for the attack now.

Now, imagine pulling a lottery ticket, which represents the attack used. Attacks with 5 priority have three tickets, attacks with 4 have two and attacks with 3 have one.

So, if we have the skill list:

Double Attack - 5
Flame - 5
Attack Up - 4
Blind - 3
Fire II - 3
Heal - 2

We get the following odds:

Double Attack: 30%
Flame: 30%
Attack Up: 20%
Blind: 10%
Fire II: 10%
Heal: 0%


So then, it's possible for a skill to have chances to never being used? Huh. That explains the problems I've been having with some skills...

Just a question: How this would apply when adding higher priority values to the mix?
If you make a skill with a higher priority value, it becomes the new Baseline:

So if we add:

Fire Strike - 6
Double Attack - 5
Flame - 5
Attack Up - 4
Blind - 3
Fire II - 3
Heal - 2

we get:

Fire Strike: 37,5%
Double Attack: 25%
Flame: 25%
Attack Up: 12,5%
Blind: 0%
Fire II: 0%
Heal: 0%

Adding an attack with priority 9 or 10 to these would make it the only attack the enemy will ever use. Any attack with a priority that's 3 or more points above the lowest priority needs to have a condition or restriction for this reason. If I'm not mistaken, the AI will also discard attacks the enemy isn't capable of using (either via a restrictive state or being out of MP/TP).
Oh, I see... Thanks, that helped me a lot! :D
author=Deltree
-In XP and higher, you can inject text into variables and use them with the \V[ ] command in dialog boxes; it doesn't have to just be numbers. For instance, if your main character could be male or female, you can set some gender-specific pronouns (he/she, his/her, him/her) into some variables depending on which hero the player chose, and then just use the \V[##] macro to refer to them without having to make a million conditional statements. You'd set it up by doing some inline script like this when the choice is made at the beginning:

$game_variables[1] = "he"

$game_variables[2] = "his"
$game_variables[3] = "him"


...and then use \V[1], \V[2], or \V[3] to insert that pronoun into your dialog. Just in case, you may want to make three additional capitalized ones, too.


You can do that in 2k and 2k3 as well, but using actor names instead! Create dummy actors and name them "he", "his", etc, and you can use \n in text messages, where x is the actor id

You could use this to create a system to show item names in text boxes too, using a common event and the "change actor name" command, where actors names are basically variables that store text instead of numbers.
I'm not sure if this is common knowledge or not but it's definitely very useful. In rm2k3, and possibly 2k, setting a wait-time of '0.0' actually pauses the game for 1/60th of a second and can be used to create pauses shorter than 1/10 of a second or to reduce lag during looping events or parallel process events.
author=drenrin2120
I'm not sure if this is common knowledge or not but it's definitely very useful. In rm2k3, and possibly 2k, setting a wait-time of '0.0' actually pauses the game for 1/60th of a second and can be used to create pauses shorter than 1/10 of a second or to reduce lag during looping events or parallel process events.


That's also handy for battle animations. The "Halt Processing Until Animation Ends" option of the Show Battle Animation command will actually put a small but noticeable delay after the battle animation, which can be undesirable, especially if you want to use multiple animations in tandem. If you simply uncheck it, though, the animation can be overridden by other things happening, like another Show Battle Animation command being called. The trick is to uncheck the option and follow the Show Battle Animation command with a Wait 0.0 seconds command. The animation will play in full, then script execution will resume instantly (or 1/60th of a second later, I suppose).
how would i put a note on something in RPG Maker VX Ace? I want to put it on a sign but I'm fairly new to the game maker ^^ if you need what i want to put it on i can give you a picture. know it involves the script editor right?

You mean like a note on a sign post? Just make a new event, set its graphic to be that of a sign (this is usually in the tileset graphics), set its layer to be the same as a hero and its activation when the player interacts with it, and in the event body make it show a message with that you want the note to show.

If that isn't what you want then please give more details on what you're trying to do.
Yes! that is exactly what I needed thank you so much ^^
Glad to help! If you have any other questions feel free to make a new thread about it so it hopefully won't be lost as another post in a thread.
LOOKING for tip on:
locomotion AND triggers for unity characters....
Im still new but seems I can use the collider box for either a locomotion tool or a trigger. but I need both... Im trying to decide on which way to go for locomotion of 3rd person using both keyboard and xbox type controler...
any responses are welcome and forgive if this is not right place to ask..
In VX Ace, you can make a fake error message with msgbox_p("Your Text Here")
RPG Maker 2003:
When you call a common event from a parallel process, the common event won't run properly if you change the map in the middle of the common event.

However, it will run properly, if you run the common event from an auto start event instead.


RPG Maker XP (and other RGSS RPG Makers):
Modulus on a negative number will give unexpected results! You have to convert the negative number to a positive one, and then convert it back after you use the modulus operation on it.
RPGMAKER 2003:(Battle Animation Shake Screen Glitch/Workaround)
Original Post
author=Boulon
Hello,
I've encountered a strange issue for the first time in the battle animation editor today.

When I set a screen shake on several frame during the animation most of them are ignored when I test it in game, only one is displayed actually (the last one).

Do you have any idea why it happens and how to go around this?

Thanks!


Hi Boulon ❤

I know exactly what you're talking about. I have a few solutions to this.
Give me a moment and I'll edit this post with the answer and a couple of examples:

EDIT:The way ShakeScreen works in rpgmaker2003 battle animations:
either the target, or the screen will shake once, for 20-25 frames
(it just shakes once, it's very limiting, you don't have a whole lot of control over this unfortunately):




Now, if you try to play ShakeScreen more than once during those initial 20-25 frames,
the process will be interrupted and start all over again;
in rpgmaker2003, it will look as only one ShakeScreen command played, like you described in your post:




Now, a really neat workaround/glitch is to shake the screen and the target through alternating frames:

it's incredibly tedious, but it looks really cool once you're able to pull it off in rpgmaker2003: (you will have to plan it out, but once you know how many frames you want this effect to last for, you can create this effect very quickly)
(watch in 720@60fps, it's very subtle so it was very difficult to capture it correctly - I haven't experimented with this a whole lot but I'm assuming if you space out the frames you'll get a more intense or less shake etc)



EDIT2: I just tried this with alternating frames 1,3,5,7,9, etc:
This is what it look like for 40 frames (a bit more powerful):



That's one method.

Now if you want more control over ShakeScreen The second method, is as Link_2112 described, by simply creating a Battle Event, that would invoke the ShakeScreen command, followed with a Battle Animation to play (minus wait command), followed by a 0.0 wait command and a Stop ShakeScreen command


This is another workaround/glitch in rpgmaker2003, that will allow you to shake the screen for the duration of the animation. You'll have more control over the strength of the shakescreen command, but the problem with using this method is that it's ultimately reliant on being called upon by a battle condition in rpgmaker2003, so you'll have to figure how/when you want it to happen in battle - So this is more ideal for in-battle-cutscenes however.

Let us know if this helped. ❤
I just did my first tiny little itsy bitsy baby bit of scripting that was not based on someone else's well-documented script or someone else's advice. I'm proud at my baby step accomplishment, but more importantly, someone else might find this useful.

In VX Ace, if you go to line 195 or so of Game_Player and change

@encounter_count = rand(n) + rand(n) + 1

to

@encounter_count = n + rand(n) + 1

it will guarantee that you can walk AT MINIMUM the number of steps you enter into the "Steps Average" box in Map Properties before you have a chance of getting a random encounter. This prevents the "encounter, two steps, another fucking encounter" phenomenon from ever happening.

If this change broke anything else, I haven't found out yet. Oh, sorry if someone already posted this hint/tip, did not read thread thoroughly.
Yeah, it's common knowledge (and probably already in this thread somewhere, that the encounter system in the series is broken. The current way it works is that it adds a random number from 0-x twice, x being the number you put in the map field for random encounter weight. However, for some reason the engine tends to skew towards the lower end of the random number roll, meaning you're more likely to get smaller numbers. And the fact they add 0 as a possible number means that the +1 at the end will give you a one-step encounter.

There are many ways to make the encounter system better by affecting that line of code. the n + rand(n) + 1 works (you can get rid of the +1, though, as I doubt you're going to put a 0 in the number field for random encounters and it's there to make sure the encounters don't automatically keep triggering one after the other).

Other ways include giving a hard number, making the +1 into +(min)*, affected by a variable or a stat (giving that luck stat a nice new workout) and whatever else floats your boat.

It doesn't affect anything else except the encounter rate if you're using that system.


*min being what the least amount of steps you'll allow (I like to make it 20, personally)
Marrend
Guardian of the Description Thread
20691
I played around with the encounter rate script in my Theme Roulette event-game. The idea I had was to use the "steps" variable as a rough average. So, it looked a little more like...

class Game_Player < Game_Character
  def make_encounter_count
    n = $game_map.encounter_step
    #@encounter_count = rand(n) + rand(n) + 1
    min = (n.to_f * 0.8).to_i
    max = (n.to_f * 1.2).to_i
    @encounter_count = rand(max-min) + min
  end
end
...this.
If you're using Ace and Yanfly's Message Script and its Name Box feature, if you put the \n<CHARACTERHASNAME> at the END of the Show Text input box instead of the beginning, you don't have to guesstimate how much "extra" room you have for the first line of the text box. +1 Convenience.
Marrend
Guardian of the Description Thread
20691
Absolutely! I mean, that text would be displayed elsewhere anyway, so, why type it first? Type it last, and get a proper preview window!


Also-also: I love being able to do \n<\n[1]> (and the like) for the name-tag box.
author=Marrend
Absolutely! I mean, that text would be displayed elsewhere anyway, so, why type it first? Type it last, and get a proper preview window!


It seems obvious now, in hindsight, but I went years and years without it even occurring to me until I saw someone doing it that way on the Discord.