obj/Viper
icon='viper.dmi'
density=1
verb
Get_In()
if(usr.incar == 0)
set src in oview(1)
for(var/obj/Viper/O in usr)
usr.loc=O.loc
O.dir=usr.dir
src.Move(usr)
usr.icon='viper.dmi'
usr.incar = 1
usr.MDelay = 1
usr.inCar2 = 1
else
usr << ""
Problem description:
The code works perfectly, The only issue i currently have is that when a user trys to enter the Car, Instead of goign to the Cars location (1 Space away from the user) the car comes to the users location.
I suspect it's this:
usr.loc=O.loc
O.dir=usr.dir
But all seems fine to me.
Users location goes to Objects location,
Objects direction faces users direction?
Correct me if i'm wrong.
You need to learn either how Move() works, or what the usr and src vars are.
Also, you just just use if(!usr.in_car) rather than if(usr.in_car == 0); it saves time and it makes the game run faster.