UseCE = 0 (I've tried both 1 and 0 for this, assuming this is a boolean value. Neither seems to work for me.)
Rewards = 1 (I'm assuming 1 is needed to turn this functionality on.)
As I said before and in the script,
UseCE is a switch. pick a number from 1 to 5000. What number you pick will be the switch used. $game_switches[UseCE]
turn that switch on to use the Common event option. Switch command -> pick the number -> turn on
Rewards is also a switch. same as above.
If it is to be a specific spot and never change then I can change it to do that.
Map, X_spot, y_spot and Dir are all set to variables.
So as you have it now the script would do this
Set coordinates, check variables -> $game_variables[Map] == 0, $game_variables[X_spot] == 0, $game_variables[Y_spot] == 0, $game_variables[Dir] == 0.
Transport player to map 0, x 0, y 0 dir 0.
What you are confused about is that you don't seem to understand how variables work or how to use scripts.
When a script uses a variable, you have to set the value of that variable. In the script you used 2 for the map. This means that variable 2 is used to hold the value for the map id. you have x_spot = 10, so variable 10 is used to hold the value for the X coordinate.
But since you want to specify a value that never changes then I can modify what I made and then the values you have in the options will be fine.
Map = 2, x = 10, y = 20, dir = 4.
Spoiler: No variables option
Ruby:
module R2_nodie
CEID = 33 # common event id
UseCE = 2 # switch to call common event
Rewards = 1 # switch to activate this script
Map = 2 # map id to transfer to
X_spot = 10 # player x position
Y_spot = 20 # player y position
Dir = 4 # player direction facing
end
module Vocab
Livetext = "Barely made it out!"
end
module BattleManager
def self.process_defeat
if $game_switches[R2_nodie::Rewards] == true
$game_message.add(sprintf(Vocab::Livetext, $game_party.name))
wait_for_message
revive_battle_members
display_exp
gain_gold
gain_drop_items
gain_exp
replay_bgm_and_bgs
SceneManager.return
map_id = R2_nodie::Map
x = R2_nodie::X_spot
y = R2_nodie::Y_spot
direction = R2_nodie::Dir
$game_player.reserve_transfer(map_id, x, y, direction)
$game_player.perform_transfer
$game_temp.reserve_common_event(R2_nodie::CEID) if $game_switches[R2_nodie::UseCE] == true
battle_end(0)
return true
else
$game_message.add(sprintf(Vocab::Defeat, $game_party.name))
wait_for_message
if @can_lose
revive_battle_members
replay_bgm_and_bgs
SceneManager.return
else
SceneManager.goto(Scene_Gameover)
end
battle_end(2)
return true
end
end
end