- 14
- Posts
- 9
- Years
- Seen Sep 25, 2023
(This should seem familiar to anyone who's played Tetra Master--or certain TCG-based video games.)
In this scenario, when the player presses the "V" key, the following things should occur in immediate sequence:
- pbExclaim triggers on the player's sprite, causing a "!" to appear above his/her head
- Global Switch 100 is turned on
- Input::C is triggered (as if the player pressed the "C" key)
- Global Switch 100 is turned off
If I'm right, this should mean:
1. If you press V in front of most events, it will interact with them normally (as if you pressed C).
2. If you press V in front of an event that specifically has a Condition set for Switch 100, you'll get a different result than if you pressed C.
In other words, I want to make the "V" key a "challenge the person I'm facing to a battle" button. It could be used to battle trainers you wouldn't normally battle--like a Professor, or the nurse at a Pokémon Center. It could also be used to fish for rematches, in a somewhat similar way to the canonical "Vs. Seeker" item.
I've put the following code in Scene_Map, starting at line 156:
That part is working just fine. It toggles switch 100 whenever you press the V key. But, I haven't figured out how to...
- Get pbExclaim to trigger over the player's head, instead of over an event.
- Have the script trigger Input::C, or an equivalent.
Presumably, I could simply have switch 100 turn off after Input::C was triggered. (It wouldn't need to "toggle" like it currently does, I think.)
I've tried a few different things, but feel as though I'm at a dead-end... Needless to say, I'm kind of a noob, but, any help would be much appreciated~!
In this scenario, when the player presses the "V" key, the following things should occur in immediate sequence:
- pbExclaim triggers on the player's sprite, causing a "!" to appear above his/her head
- Global Switch 100 is turned on
- Input::C is triggered (as if the player pressed the "C" key)
- Global Switch 100 is turned off
If I'm right, this should mean:
1. If you press V in front of most events, it will interact with them normally (as if you pressed C).
2. If you press V in front of an event that specifically has a Condition set for Switch 100, you'll get a different result than if you pressed C.
In other words, I want to make the "V" key a "challenge the person I'm facing to a battle" button. It could be used to battle trainers you wouldn't normally battle--like a Professor, or the nurse at a Pokémon Center. It could also be used to fish for rematches, in a somewhat similar way to the canonical "Vs. Seeker" item.
I've put the following code in Scene_Map, starting at line 156:
Code:
if Input.trigger?(Input::V)
unless pbMapInterpreterRunning? or $game_player.moving?
if $game_switches[100]
$game_switches[100]=false
else
$game_switches[100]=true
pbExclaim(EV023)
end
end
end
- Get pbExclaim to trigger over the player's head, instead of over an event.
- Have the script trigger Input::C, or an equivalent.
Presumably, I could simply have switch 100 turn off after Input::C was triggered. (It wouldn't need to "toggle" like it currently does, I think.)
I've tried a few different things, but feel as though I'm at a dead-end... Needless to say, I'm kind of a noob, but, any help would be much appreciated~!