Falcao Pearl ABS Liquid - Trigger a common event at death

Hammerklavier

Veteran
Veteran
Joined
Dec 28, 2013
Messages
45
Reaction score
4
First Language
English
Primarily Uses
Hello,

I'm using the Falcao Pearl ABS Liquid scripts with RPG Maker VX Ace. Currently, when the character dies, the game proceeds to a game over screen. Is anyone aware of a script that has been created to allow for a common event to be called instead? When the player runs out of HP and "dies", I want them transferred to another map instead, retaining any XP, gold and items they may have procured along the way.

Thank you for any assistance you can offer!
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,565
Reaction score
541
First Language
English
Primarily Uses
RMVXA
Untested, but try this
Ruby:
module R2_nodie
    CEID = 1           # common event id. Specify which CE to call
    UseCE = 2       # switch to call common event. Turn on to call CE
    Rewards = 1     # switch to activate this script. Turn on to use features
    Map = 1            # variable to hold map id to transfer to
    X_spot = 2        # variable to hold player x position
    Y_spot = 3        # variable to hold the player y position
    Dir         = 4      # variable to hold the player direction facing. 2 or 4 or 6 or 8
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
            if $game_variables[R2_nodie::Map] == 0; $game_variables[R2_nodie::Map] = 1; end
            if $game_variables[R2_nodie::X_spot] == 0; $game_variables[R2_nodie::X_spot] = 5; end
            if $game_variables[R2_nodie::Y_spot] == 0; $game_variables[R2_nodie::Y_spot] = 5; end
            if $game_variables[R2_nodie::Dir] != 2 || 4 || 6 || 8; $game_variables[R2_nodie::Dir] = 2; end
            map_id = $game_variables[R2_nodie::Map]
            x = $game_variables[R2_nodie::X_spot]
            y = $game_variables[R2_nodie::Y_spot]
            dir = $game_variables[R2_nodie::Dir]
            $game_player.reserve_transfer(map_id, x, y, dir)
            $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
 
Last edited:

Hammerklavier

Veteran
Veteran
Joined
Dec 28, 2013
Messages
45
Reaction score
4
First Language
English
Primarily Uses
Hi Roninator2,

Thanks for taking the time to help me! I tried a quick test, and I'm still getting the game over screen, but I suspect I might not be using the script correctly. I think I'm a bit confused as to what value UseCE would hold. Would any of these variables need to be set during runtime, or would I only need to set them within the script editor?
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,565
Reaction score
541
First Language
English
Primarily Uses
RMVXA
Would any of these variables need to be set during runtime, or would I only need to set them within the script editor?
I made it so that it would have default values but you are supposed to set the values. I would imagine somewhere before a battle.
The variables are for you to change to whatever values you need for your game. I made it variables so that you can change it at any time.
The usece is a switch to turn on if you want to call a common event.
Rewards is a switch used if you want to change the defeat process (use the options I provided). If this is off then the normal defeat will process.
 

Hammerklavier

Veteran
Veteran
Joined
Dec 28, 2013
Messages
45
Reaction score
4
First Language
English
Primarily Uses
Hmm, still no luck. I've tried moving the script to the top of the Materials section as well as making it the last script, and I get the same result. I'm using the following default values:

CEID = 33 (This is a common event that would transfer the player to a particular map)
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.)
Map = 2 (I want the player to end up on map ID 002)
X_spot = 10 (I want the player on x=10, y=20 on the map ID 002)
Y_spot = 20 (see above)
Dir = 4 (left at default for now)

Basically, if possible, I would want any death over the entirety of the game to result in the player being sent back to the same specific spot, so I don't think I'd have a need to keep adjusting these values for different situations.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,565
Reaction score
541
First Language
English
Primarily Uses
RMVXA
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.
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
 

Hammerklavier

Veteran
Veteran
Joined
Dec 28, 2013
Messages
45
Reaction score
4
First Language
English
Primarily Uses
After taking your suggestions and trying your new script, I'm still getting the usual game over on my Pearl ABS project. That said, I created a quick test project that doesn't include any added scripts and your script worked as expected. So I suspect there is a compatibility issue with the Pearl ABS scripts, or maybe even one of the other scripts I'm using (which includes Khas lighting scripts, a couple of Galv scripts, and a few other miscellaneous ones.

I was really hoping something like this already existed, but I can certainly understand if getting this script to work for my project is a bit more of an undertaking than you'd care to pursue. I appreciate the time you've put in on this, and it definitely appears to be a slick script, it just doesn't seem to be working with this project for some reason.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,145
Reaction score
815
First Language
Hungarian
Primarily Uses
RMVXA
@Roninator2
He uses an ABS system, which means the actor will die on the map, and not on the default battle scene.
That's why your script won't work for him.

A very old script of mine:
This should work for you.

But there is a line like this in it:
Code:
$game_player.reset_action
If you get a crash with this line, just comment it out and try again.
That line is probably something I added for an ABS system, but no idea for which one, already forgot it, was too long ago.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,565
Reaction score
541
First Language
English
Primarily Uses
RMVXA
compatibility issue with the Pearl ABS scripts
the actor will die on the map,
That makes sense as then. Until the last message it still looked like he didn't use the script properly.
But I didn't bother to look at the Falco ABS script to see how the death method was processed.

Thanks for the help, for both of us.
 

Hammerklavier

Veteran
Veteran
Joined
Dec 28, 2013
Messages
45
Reaction score
4
First Language
English
Primarily Uses
Thank you Sixth, your script works like a charm!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Yesterday I made my first step towards eating more healthily.
I saw candy on discount and did not buy it.
"They yearn for what they fear for."
I always told my DA fans how much I hate slot machines. They're fine in games as a risk-and-reward system. But when you're spending REAL MONEY in a Vegas casino to try and hit the jackpot (which very, very few people will), it can really hurt your budget. Gambling is a bad habit, and I don't like wasting my money on a slim chance. Go to Vegas for the experience, not the jackpot.
Took the kids to a corn maze. They gave us a map and had lights at certain points in the maze. Not overwhelming... or underwhelming... just... whelming.
Okay, vacuuming fruit flies out of the air is surprisingly effective.

Forum statistics

Threads
104,393
Messages
1,006,075
Members
135,927
Latest member
ecelebrithytrend
Top