New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ready] Respawn functionality #446

Merged
merged 2 commits into from May 18, 2018

Conversation

Projects
None yet
3 participants
@husho
Copy link
Contributor

husho commented May 9, 2018

Respawning is now handled, related opcodes seemed to work.

Closes #48

  • Respawning to closest place
  • Island overrides for hospitals and jails
  • Raw position overrides
  • Handling money
  • Free health care
  • Getting out of jail free
  • Penalty calculation based on number of wanted stars
  • Fading with correct timing and colours
  • Advancing time
  • Clearing weapons
  • Improve dying state for character object
  • Opcodes
  • Refactor? fading stuff, so you can fade by calling a function
  • Show wasted / busted text
  • ~~~Camera flying away~~~ (not going to do now)
  • Increment death/jail stat
  • Mission override restart fixed
@ShFil119
Copy link
Member

ShFil119 left a comment

;)

bool isWasted();
bool isBusted();

void restartLogic();

This comment has been minimized.

@ShFil119

ShFil119 May 9, 2018

Member

Some comment would be useful. ;)

}

void addPoliceRestart(const glm::vec4 location) {
policeRestarts.push_back(location);

This comment has been minimized.

@ShFil119

ShFil119 May 9, 2018

Member

To reformat.

@@ -319,8 +319,55 @@ class GameState {
/** Objects created by the current mission */
std::vector<GameObject*> missionObjects;

bool overrideNextStart;
bool overrideNextRestart;

This comment has been minimized.

@ShFil119

ShFil119 May 9, 2018

Member

It should be initialized.

@@ -645,3 +645,9 @@ void CharacterObject::useItem(bool active, bool primary) {
}
}
}

void CharacterObject::clearInventory() {
for (int slot = 0; slot < kMaxInventorySlots; ++slot) {

This comment has been minimized.

@ShFil119

ShFil119 May 9, 2018

Member

Range loop?

This comment has been minimized.

@husho

husho May 10, 2018

Contributor

in this case range loop makes things complicated, because we are getting a value which we need to unpack

This comment has been minimized.

@ShFil119

ShFil119 May 10, 2018

Member

You are right, I haven't noticed usage of slot.

@@ -33,6 +33,11 @@ class PlayerController : public CharacterController {

void enterNearestVehicle();

bool isWasted();
bool isBusted();

This comment has been minimized.

@ShFil119

ShFil119 May 9, 2018

Member

Maybe todo comment?

dracc added a commit to dracc/openrw that referenced this pull request May 10, 2018

dracc added a commit to dracc/openrw that referenced this pull request May 10, 2018

dracc added a commit to dracc/openrw that referenced this pull request May 10, 2018

@husho husho referenced this pull request May 13, 2018

Closed

suicide checks #456

@danhedron
Copy link
Member

danhedron left a comment

Coming along great.

int islandOverride;

if (type == Hospital) {
iter = hospitalRestarts;

This comment has been minimized.

@danhedron

danhedron May 13, 2018

Member

You could avoid copying the list here

This comment has been minimized.

@husho

husho May 13, 2018

Contributor

Will do

RW_UNUSED(args);
void opcode_016c(const ScriptArguments& args, ScriptVec3 coord, const ScriptFloat heading) {
coord = script::getGround(args, coord);
args.getState()->addHospitalRestart(glm::vec4(coord, heading));

This comment has been minimized.

@danhedron

danhedron May 13, 2018

Member

Mixing tabs and spaces?

This comment has been minimized.

@husho

husho May 13, 2018

Contributor

yes, I can fix these exact lines, but whole file should be reformatted anyway

@ghost

This comment has been minimized.

Copy link

ghost commented May 13, 2018

when fail the mission the game dont restart after this merge, looks like gtasa but in gta3 the game restart right ?

@husho

This comment has been minimized.

Copy link
Contributor

husho commented May 13, 2018

@mythrillex I don't understand what you meant by that

@ghost

This comment has been minimized.

Copy link

ghost commented May 13, 2018

hmm sorry, if u fail the first mission (newgame), the game will restart the mission, but with this respawn the restart dont occur
image

@husho

This comment has been minimized.

Copy link
Contributor

husho commented May 13, 2018

#443 patch required to make missions failable upon death

@husho husho changed the title Very basic respawn functionality [WIP] Very basic respawn functionality May 13, 2018

@husho husho changed the title [WIP] Very basic respawn functionality [WIP] Respawn functionality May 13, 2018

@husho husho changed the title [WIP] Respawn functionality Respawn functionality May 13, 2018

@ghost

This comment has been minimized.

Copy link

ghost commented May 14, 2018

if u kill 8-ball the game will make a respawn loop, restarting the mission over and over, its cause the game dont restart things when start the mission again (example if u break a lampost, when restart the lampost still broken)
i make this mistake of kill 8-ball when the mission restart, before he gets into the car, I kept the mouse pressed and killed him with the gun :v

i think u need remove the weapons when restart or block the shoot action ?

image

@husho

This comment has been minimized.

Copy link
Contributor

husho commented May 14, 2018

Yes, you are not supposed to shoot or move or do anything during cutscenes, also when cutscene starts it should clear all projectiles and make player safe. But that's not related to this PR. Maybe I'll do it later.

@husho husho changed the title Respawn functionality [Ready] Respawn functionality May 14, 2018

dracc added a commit to dracc/openrw that referenced this pull request May 14, 2018

dracc added a commit to dracc/openrw that referenced this pull request May 14, 2018

dracc added a commit to dracc/openrw that referenced this pull request May 15, 2018

dracc added a commit to dracc/openrw that referenced this pull request May 15, 2018

husho added some commits May 15, 2018

husho
husho

@danhedron danhedron merged commit b77ca47 into rwengine:master May 18, 2018

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@husho husho deleted the husho:respawn branch May 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment