Skip to content
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

ghostcars: /ghost sets players driven vehicle as ghost #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

ghostcars: /ghost sets players driven vehicle as ghost #44

wants to merge 1 commit into from

Conversation

dracc
Copy link
Owner

@dracc dracc commented Feb 13, 2019

Closes #43

Idea is to set cars as ghosts. Undocumented feature but with a bit of imagination you can interpret the function as "disable collisions".

I have yet to test this code.

}

function onPlayerExitVehicle( player, vehicle ) {
vehicle.IsGhost = false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this also happen if a passenger left your car?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, yeah, probably. I'll add a check for vehicle.Driver - should be == null if the driver is the one leaving. Or == player.ID.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved?

@JayFoxRox
Copy link
Collaborator

  • We should also find a way to mark ghost cars (if it's player controllable), possibly by giving them a unique color or something (unfortunately there's no Vehicle.Alpha). Until this happens, it should probably not be done, because it leads to unpredictable behaviour.

  • I believe I'd rather have this as a command (than a keybind - see Create bind script #15 ).

  • It should probably be default-off, as user-controlled ghosting should be a last resort (to avoid cars parked in a way, or congestion).

  • We'll have to make sure this never runs out of synchronization to avoid unpredictable behaviour:

    • What happens if the script forces the player into a vehicle?

    • What happens if a player joins a game?

    • What happens if a player leaves the game?

    • ...

  • Do ghosts still have collisions with script-objects?

@dracc
Copy link
Owner Author

dracc commented Feb 14, 2019

* We should also find a way to mark ghost cars (if it's player controllable), possibly by giving them a unique color or something (unfortunately there's no `Vehicle.Alpha`). Until this happens, it should probably not be done, because it leads to unpredictable behaviour.

Place them in player.UniqueWorld?

* I believe I'd rather have this as a command (than a keybind - see #15 ).

Fixed!

* It should probably be default-off, as user-controlled ghosting should be a last resort (to avoid cars parked in a way, or congestion).

I believe it already is.
https://github.com/JayFoxRox/modular-vc-mp-server/pull/44/files#diff-a7f6143f8376f658de3dfb515520e4aeR3

* We'll have to make sure this never runs out of synchronization to avoid unpredictable behaviour:      
  * What happens if the script forces the player into a vehicle?

I need to test this, my theory is onPlayerEnterVehicle() is triggered.

  * What happens if a player joins a game?

Requires testing but I don't see why this would be different than usual behavior (i.e. cars are visible, have their current traits such as color1/color2, model and so on)

  * What happens if a player leaves the game?

Should probably add a check for player.Vehicle != null in onPlayerPart(). Fixed!

* Do ghosts still have collisions with script-objects?

It does not deactivate object collision.
screenshot

@dracc dracc changed the title ghostcars: Bind KEY_G to setting car as ghost ghostcars: /ghost sets players driven vehicle as ghost Feb 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants