ARandomDoggo

Villager
Member
Joined
Mar 25, 2022
Messages
10
Reaction score
12
First Language
English
Primarily Uses
RMVXA
Hey! I'm super new to this website, but I wanted to see if anyone could help me out with a problem I'm having in my game!

... Well, truth be told, I'm having multiple problems with my game, but I figured I'd just take things one problem at a time.

I'm trying to make a move that triggers a common event which then forces that same character to use another specific move during their next turn.

Initially I wanted to simply use the 'force action' option in the event commands, but it only gave two options for the action subject, which was the enemy or the actor.

If I select 'actor', then the player uses the move against the enemy, and if I select 'enemy', then the enemy uses it against the player. What I'm looking for is a way to make the action subject be whoever first performed the skill.

I thought maybe a potential fix to this would be to use scripting. Basically, I thought that maybe if I used the script equivalent for the 'force action' command, I could sneak into the code and alter the action subject part of it and make it apply to whoever triggered the event. Is something like that possible?

TLDR: What's the script equivalent of the 'force action' common event command, and how would I be able to change it to make it impact specifically the character that triggered the event (both players and enemies)

Any help with this would be awesome! Thanks in advance! c:

EDIT: I realized it might not be apparent what I'm asking for, so here's an example:

The player or enemy uses move "A" for their turn. When used, move "A" will force the player to use move "B" during their next turn. You can think of it like the 'dig' move in Pokemon, where the first move does nothing but the second actually damages the opponent.

The way I'm currently doing this is by using common events. Move "A" triggers a common event, which forces the player to use move "B".

The 'Force Action' command is set up like this:
Action Subject (who performs the action): Doge (who is the player in this game)
Action Skill: Fireblast A
Action Target (who is being attacked): index 1 (enemy 1)
(You can see it in the attached file.)

This is perfect for when my player will use this skill to attack the enemy, but I want this skill to be used BOTH ways! And unfortunately with how the force action command is set up, when the enemy plays it, it causes the player to damage the enemy again instead of the other way around.

I was wondering if there was a way to alter the 'force action' command to where it just causes whoever activated it to use the move against the opponent.
 

Attachments

  • RPGVXA force action problem screenshot 1.PNG
    RPGVXA force action problem screenshot 1.PNG
    68.2 KB · Views: 1
Last edited:

ARandomDoggo

Villager
Member
Joined
Mar 25, 2022
Messages
10
Reaction score
12
First Language
English
Primarily Uses
RMVXA
Update: I still haven't found a way to do this... can anyone help?
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,273
Reaction score
1,163
First Language
English
Primarily Uses
RMVXA
The player or enemy uses move "A" for their turn. When used, move "A" will force the player to use move "B" during their next turn. You can think of it like the 'dig' move in Pokemon, where the first move does nothing but the second actually damages the opponent.
This reminds me of Victor Sants Jump Command. Looks like you want the same thing for your other skill but no jumping.
 

ARandomDoggo

Villager
Member
Joined
Mar 25, 2022
Messages
10
Reaction score
12
First Language
English
Primarily Uses
RMVXA
This reminds me of Victor Sants Jump Command. Looks like you want the same thing for your other skill but no jumping.
Oh! Alright, I'll look into that one! Thank you!

I hope you don't mind if I keep this thread open in the meantime, just in case this doesn't end up being the right solution.
 

ARandomDoggo

Villager
Member
Joined
Mar 25, 2022
Messages
10
Reaction score
12
First Language
English
Primarily Uses
RMVXA
Well, Victor Sants' Jump Command didn't quite work out, but I did find something that will help me!


This post is titled "Force action using current character" , which is exactly what I'm looking for!

My current plan is to have a common event triggered whenever a move is used, and have a conditional branch inside of it. If the 'enemy' switch is on, then the enemy is forced to do the action. If the 'player' switch is on, then the player is forced to do the action.

...the problem is that I don't quite know what to do with the script that Heirukichi provided. Rather, I don't know which part of the code does what. I'll do some experimenting and I'll post about what I find out!
 

ARandomDoggo

Villager
Member
Joined
Mar 25, 2022
Messages
10
Reaction score
12
First Language
English
Primarily Uses
RMVXA
Alright, here's what I've been able to figure out:

I need a script that will turn on a different switch depending on who just played the move (the 'enemy' switch or the 'player' switch.)

If the player used the move, then the 'player' switch turns on. If the enemy used the move, then the 'enemy' switch turns on.

Could anyone help me figure out a script that will do this?
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,273
Reaction score
1,163
First Language
English
Primarily Uses
RMVXA
the easy way around that is to use a different skill for the enemies, not the same skill. (duplicate)
but goes to a different CE.
From what I saw in that post, (good find) you just set the variables.
I don't quite see how this would work. I would personally modify the jump command.
But if you have it figured out, then go for it.
 

ARandomDoggo

Villager
Member
Joined
Mar 25, 2022
Messages
10
Reaction score
12
First Language
English
Primarily Uses
RMVXA
the easy way around that is to use a different skill for the enemies, not the same skill. (duplicate)
but goes to a different CE.
From what I saw in that post, (good find) you just set the variables.
I don't quite see how this would work. I would personally modify the jump command.
But if you have it figured out, then go for it.
See, I wanted to do that at first, but the problem is I have 130 different skills, which would mean I'd have to make 260 skills (one set for the enemy and one set for the player).

And also I've set this up where the skills always trigger a follow-up skill to be played, which would mean I'd have to make 520 individual skills (player moves "A", player moves "B", enemy moves "A", and enemy moves "B".)

Needless to say, that'd take a lot of time and data storage. I'd like to avoid that as much as possible, especially if all I need is a simple line of code that says "if the enemy played this skill, turn on this switch. If the player played this skill, turn on this other switch."

I really appreciate your input though!
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,273
Reaction score
1,163
First Language
English
Primarily Uses
RMVXA
So you're saying EVERY single skill needs to run a different Common Event and enemies will NEVER share skills?
Sounds like you have a complicated game.
The default is all enemies and actors use skill 1.
Why can't you do the same.
You should only have this for one skill, so only one extra skill is needed.
 

ARandomDoggo

Villager
Member
Joined
Mar 25, 2022
Messages
10
Reaction score
12
First Language
English
Primarily Uses
RMVXA
So you're saying EVERY single skill needs to run a different Common Event and enemies will NEVER share skills?
Sounds like you have a complicated game.
The default is all enemies and actors use skill 1.
Why can't you do the same.
You should only have this for one skill, so only one extra skill is needed.

Well, that's the problem; in my game, ALL my skills are set up like this (that's just how I'm designing the game.)

Here, let me try to explain it like this:

I have 130 different skills that both the player and enemy can use against each other. Each skill, while being used to attack each other, also boosts defense (depending on the card that is being used.) In order to have the defense applied, I made two sets of these skills. These consist of "A skills" and "B skills".

The A skills are setting up the defense and triggering the B skills.
So... player 1 uses Footsmash skill A! That would give them a defense boost for the next turn, as well as triggering the next move, which will be Footsmash skill B.

The B skills are the moves that actually cause damage to the opponent and remove the defense boost from skill A. So... player 1 used Footsmash skill B! It hits the enemy! Oof!

That's what I'm looking for. Unfortunately, you can't get that with the regular "force action" command.

In the "force action" command, you can choose who uses the move and who gets hit with the move.

So for example, if I set it up where the player is forced to use the move against the enemy, then no matter what, it would force player 1 to attack the enemy. So if player 1 used this move, it would work like normal and player 1 would hit the enemy. But if the enemy used it, then player 1 would still hit the enemy.

I've thought about avoiding this problem by making identical moves: one set of A and B skills for the player, and another set of A and B skills for the enemy. And of course, each set of skills would need their own list of common events that triggers everything.

That, needless to say, would be WAY too complicated. Way more complicated than it already is, anyways. That would involve me making 520 different skills and 260 different common events.


What I'm looking for is a piece of code or a way to activate a switch every time the move is used by player 1 or the enemy. That way, in the common events I could set up a conditional branch. If the "player 1" switch is on, then it forces the player to use it against the enemy. If the "enemy" switch is on, then it forces the enemy to use it against player 1. It would save me a LOT of hassle.

(Also sorry for the bad editing on this post! I'm on my phone right now.)
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,273
Reaction score
1,163
First Language
English
Primarily Uses
RMVXA
Ok, so I see you simply editing the skill damage formula or injecting into the CE for the skill to determine who used the skill.
Personally I don't see what you want to do as easy and will fail.
But here is an option. And yes turns a switch on.

This script is one option
# Get Battle Info [VXA]
# Author: Mesiah A.K.A. Mako Infused
# Version: 1.04
# Contact: www.cetrastudios.com/

Set the skill to call the common event, use the event script command to call the script command.
user = battle_info_user
if user.is_a?(RPG::Enemy)
$game_switches[1] = true
else
$game_switches[2] = true
end


Second is using the damage formula
Set to hp damage
formula is id=20;Kernel.eval($data_skills[id].note.scan(/<\s*formula\s*:\s*((\s|\S)+)>/))
id is the skill id
variance is 0
In note box add in
<formula: if a.is_a?(RPG::Enemy); $game_switches[1] = true; else $game_switches[2] = true; end; 0>
 
Last edited:

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
498
Reaction score
207
First Language
English
Primarily Uses
RMXP
I think it'd look better if you write something like the following:

<formula: sid = a.is_a?(RPG::Enemy)? 1 : 2; $game_switches[sid] = true; 0>
 

ARandomDoggo

Villager
Member
Joined
Mar 25, 2022
Messages
10
Reaction score
12
First Language
English
Primarily Uses
RMVXA
I'll try both these out when I get the chance. Thank you guys! I'll let you know what works and what doesn't.

I really appreciate everyone's contributions to this!! :D
 

ARandomDoggo

Villager
Member
Joined
Mar 25, 2022
Messages
10
Reaction score
12
First Language
English
Primarily Uses
RMVXA
Well, I tried both, but I ended up having error messages for both methods.


For Roninator2's method, this error pops up.
Roninator2 method error message.PNG

For Kyonides' method, this error pops up.
kyonides method error message.PNG

I tried poking around a bit with Kyonides' code (basically because this shorter code intimidated me a lot less), but I still didn't get anywhere. Any advice? (Please keep in mind that I suck at coding.)

I really appreciate your guys' help!
 

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
498
Reaction score
207
First Language
English
Primarily Uses
RMXP
Just start at sid and don't include any final > symbol. Those were meant to tell you it should be typed in the formula box.
 

Latest Threads

Latest Posts

Latest Profile Posts

Here's a showcase of layers of visual effects I've added over a scene. By stripping them off, one by one. :kaoblush:












Aaaaand, here's me working on the above scene, adding weather effects to it: :kaoeh:


DamageActor1_2.png added!
index.php


Krow and Dova's Cool New Game | Release Trailer

Forum statistics

Threads
124,576
Messages
1,164,519
Members
163,403
Latest member
jirohdyt
Top