Skip to content

No Whiteout After Player Loss

psf edited this page Sep 19, 2023 · 2 revisions

No Whiteout After Player Loss

Introduction

No whiteout functionality versus regular functionality demo

In many video games, it is common to have a foe that you simply cannot defeat. In Emerald, when your character whites out, you are normally transported back to the last heal location you used. This modification will allow the player to continue after losing and is designed primarily for use in cutscenes and special events.

Thank you very much to Jaizu who contributed to this modification. Please read more about their contributions and support their projects!

Installation

These instructions assume that you can build pokeemerald, have a basic understanding of C, and are familiar with using the in-game scripting language. If you do not, please watch the tutorials series from Team Aqua's Hideout.

git merge (recommended)

From the root directory of your project, run the following commands in your terminal program of choice:

git remote add psf-emerald https://github.com/PokemonSanFran/pokeemerald/ # This adds our team's pokeemerald branch as a remote repo.
git pull psf-emerald no-whiteout #This pulls in the no-whiteout feature branch

Manual merge

If your project is:

  • Too far behind pokeemerald
  • Using a different base (pokeemerald-expansion or pokefirered)
  • Some other reason that I can't think of

You can manually implement the features using the diff between this branch and vanilla pokeemerald as a guide. You will need to manually edit or create each of these files in your own project to recreate the feature properly.

Warnings

Heal Party

If the player does lose the battle as planned, their party still be knocked out. The player will need to be healed before their next encounter. One example fix is to use

special HealPlayerParty

directly after the battle.

Usage & Scripting Commands

No Intro

Rival Battle 1 using Continue After Loss functionality

Route103_EventScript_RivalMay::
	msgbox Route103_Text_MayRoute103Pokemon, MSGBOX_DEFAULT
	closemessage
	playbgm MUS_ENCOUNTER_MAY, TRUE
	applymovement LOCALID_RIVAL, Common_Movement_FacePlayer
	waitmovement 0
	applymovement LOCALID_RIVAL, Common_Movement_ExclamationMark
	waitmovement 0
	applymovement LOCALID_RIVAL, Common_Movement_Delay48
	waitmovement 0
	msgbox Route103_Text_MayLetsBattle, MSGBOX_DEFAULT
	switch VAR_STARTER_MON
	case 0, Route103_EventScript_StartMayBattleTreecko
	case 1, Route103_EventScript_StartMayBattleTorchic
	case 2, Route103_EventScript_StartMayBattleMudkip
	end

Route103_EventScript_StartMayBattleTreecko::
	trainerbattle_no_intro_no_whiteout TRAINER_MAY_ROUTE_103_TREECKO, Route103_Text_MayDefeated
	goto Route103_EventScript_AfterMayBattle
	end

This will allow the player to lose the first rival battle on Route 103, and still proceed normally with the game.

Continue Script

Demo of No White Out Continue Script Functionality

Route103_EventScript_RivalMay::
	msgbox Route103_Text_MayRoute103Pokemon, MSGBOX_DEFAULT
	closemessage
	playbgm MUS_ENCOUNTER_MAY, TRUE
	applymovement LOCALID_RIVAL, Common_Movement_FacePlayer
	waitmovement 0
	applymovement LOCALID_RIVAL, Common_Movement_ExclamationMark
	waitmovement 0
	applymovement LOCALID_RIVAL, Common_Movement_Delay48
	waitmovement 0
	msgbox Route103_Text_MayLetsBattle, MSGBOX_DEFAULT
	switch VAR_STARTER_MON
	case 0, Route103_EventScript_StartMayBattleTreecko
	case 1, Route103_EventScript_StartMayBattleTorchic
	case 2, Route103_EventScript_StartMayBattleMudkip
	end

Route103_EventScript_StartMayBattleTreecko::
	trainerbattle_no_whiteout_continue_script TRAINER_MAY_ROUTE_103_TREECKO,Route103_Text_MayLetsBattle, Route103_Text_MayDefeated,Script_PostBattle
	end

Script_PostBattle::
	specialvar VAR_RESULT, GetBattleOutcome
	compare VAR_RESULT, B_OUTCOME_WON
	goto_if_eq Route103_EventScript_AfterMayBattle
	msgbox Script_PostBattle_Text_1

Script_PostBattle_1:
	givemon SPECIES_LUGIA, 100, ITEM_CHOICE_BAND
	closemessage
	return

Script_PostBattle_Text_1:
	.string "You are too weak to face me.$"

This version allows the developer to define intro text and an explicit script to execute after battle.

Support

If you have read all of the documentation here and still have questions, please ask a good question in the pokeemerald channel of the pret Discord server. You can tag psf#2983 or JaizuFangaming#2172 and we will try to help if we can.

Donations

If you got some use out of this feature, please consider donating.

Contributors

CHANGELOG

All changes to this project will be documented in this section. The format is based on Keep a Changelog, and this project tries to adhere to Semantic Versioning.

Unreleased

  • n/a

[1.1.1] - 2022-08-15

Added

  • "{PLAYER} lost the battle!" is now printed instead of "{PLAYER} whited out!}" · (050b47b)
  • trainerbattle_no_whiteout_continue_script can now be used as well. This takes intro text and an explicit event script to be executed post battle · (050b47b)

[1.0.1] - 2022-08-14

Fixed

  • The string for when the player wins were not properly loaded. When the player won a battle instead of the planned loss, the game would return garbage text instead of the proper string. (Lunos#4026)