Page 1 of 1

How to reset the color of a car after player exits?

Posted: Tue Apr 07, 2020 11:50 pm
by SirFloIII
Hello everyone.

In the last few days I have created a mod that adds the Brutus, a car with the driver visible. Right now I am modeling the driver. My plan is to use the color layer (the one with "apply_runtime_tint = true") to add the driver if a player is actually in the car. However - I think since .18 - the color stays after the player exits. Now this would of course mean that the driver stays visible after the player exits which is what I obviously don't want to happen.

Is there a flag I can set to reverse this behaviour? If not, is there a way to do it with some runtime code?

Yours, Flo

Re: How to reset the color of a car after player exits?

Posted: Wed Apr 08, 2020 6:54 am
by darkfrei
Maybe place fake character with standard color to the passenger seat and remove them.

Re: How to reset the color of a car after player exits?

Posted: Wed Apr 08, 2020 11:39 am
by Pi-C
SirFloIII wrote: Tue Apr 07, 2020 11:50 pm Is there a flag I can set to reverse this behaviour? If not, is there a way to do it with some runtime code?
See here. I use this feature in GCKI to set the vehicle color back to it's "owner's" color when somebody else has used and left a vehicle that "belongs" to somebody else:

Code: Select all

if vehicle.valid then
        vehicle.color = game.players[owner].color
        […]        
end

Re: How to reset the color of a car after player exits?

Posted: Wed Apr 08, 2020 11:50 am
by Klonan
SirFloIII wrote: Tue Apr 07, 2020 11:50 pm Hello everyone.

In the last few days I have created a mod that adds the Brutus, a car with the driver visible. Right now I am modeling the driver. My plan is to use the color layer (the one with "apply_runtime_tint = true") to add the driver if a player is actually in the car. However - I think since .18 - the color stays after the player exits. Now this would of course mean that the driver stays visible after the player exits which is what I obviously don't want to happen.

Is there a flag I can set to reverse this behaviour? If not, is there a way to do it with some runtime code?

Yours, Flo
Just set the color back to the empty color:

Code: Select all

car.color = {0,0,0,0}

Re: How to reset the color of a car after player exits?

Posted: Wed Apr 08, 2020 1:49 pm
by SirFloIII
I see. I didn't realize I could set the color to 0 alpha and thought I had to turn this off via another bool or something.

Thank you very much!

Yours, Flo