Commit graph

289 commits

Author SHA1 Message Date
in0finite
613ecd215a Fix resetting ped when falling below the world 2020-05-31 19:09:42 +02:00
in0finite
4a60c43ca2 Limit fps to 60 by default 2020-05-31 19:09:42 +02:00
in0finite
cf3fc109f8 Update status of rigid body every frame 2020-05-31 19:09:41 +02:00
in0finite
efd831f504 Change format of a setting - now rigid body can be disabled on local player 2020-05-31 19:09:41 +02:00
in0finite
f9c8a5d31f Destroy OutOfRangeDestroyer script on peds which are controlled by players 2020-05-31 19:09:41 +02:00
in0finite
3869ff0a09 Destroy OutOfRangeDestroyer script on clients 2020-05-31 19:09:41 +02:00
in0finite
33c3700291 Disable vehicle damage 2020-05-31 19:09:41 +02:00
in0finite
ed7ce1429f Improvements 2020-05-31 19:09:41 +02:00
in0finite
266c90deac Improvements 2020-05-31 19:09:41 +02:00
in0finite
e117c2cd81 Fixed several bugs:
- vehicle states are activated on clients at the end of frame, because at the moment of ped creation, vehicle may not be created yet

- ped doesn't switch to stand state in Start(), on clients

- state is now synced using string, not struct, because struct failed to sync after first modification
2020-05-31 19:09:41 +02:00
in0finite
aeb0c8fc1e Apply "Disable vehicle's rigid body on clients" setting immediately 2020-05-31 19:09:41 +02:00
in0finite
d91cd759e3 Attempt to fix state sync 2020-05-31 19:09:41 +02:00
in0finite
027319df86 Attempt to fix state sync 2020-05-31 19:09:41 +02:00
in0finite
e9ef2e583d Working on misc stats 2020-05-31 19:09:41 +02:00
in0finite
54c44a89a7 Create some files 2020-05-31 19:09:41 +02:00
in0finite
ec4435e181 Converting vehicle states to new API 3 2020-05-31 19:09:41 +02:00
in0finite
b474d7df85 Converting vehicle states to new API 2 2020-05-31 19:09:41 +02:00
in0finite
4faa53bb1d Converting vehicle states to new API 2020-05-31 19:09:41 +02:00
in0finite
7fb6256b3a States can provide additional data for clients when being switched 2020-05-31 19:09:41 +02:00
in0finite
8da6e641b2 Apply sync rate to NetworkTransform too 2020-05-31 19:09:40 +02:00
in0finite
a4329fedea When entering/exiting vehicle, don't change sync interval, but instead disable/enable NetworkTransform 2020-05-31 19:09:40 +02:00
in0finite
927044d517 Add setting 2020-05-31 19:09:40 +02:00
in0finite
23ed98633a Remove DefaultTransformSyncInterval variable 2020-05-31 19:09:40 +02:00
in0finite
548f0ee57c Add configurable ped sync rate 2020-05-31 19:09:40 +02:00
in0finite
6cca13e705 Add option to toggle control of vehicle input on local player 2020-05-31 19:09:40 +02:00
in0finite
50b7d7630c Added option to toggle control of wheels on local player 2020-05-31 19:09:40 +02:00
in0finite
c44ba4146b OutOfRangeDestroyer: don't increase out-of-range time if target object doesn't exist 2020-05-31 19:09:40 +02:00
in0finite
c49b1cf2a5 Add anti roll force only on server 2020-05-31 19:09:40 +02:00
in0finite
0e6f471db6 Apply sync rate on start 2020-05-31 19:09:40 +02:00
in0finite
06af108c8e Add configurable vehicle sync rate 2020-05-31 19:09:40 +02:00
in0finite
4c3f09e279 NetworkTransform is enabled/disabled in Update() 2020-05-31 19:09:40 +02:00
in0finite
752c59116c Cache NetworkTransform 2020-05-31 19:09:40 +02:00
in0finite
4dcad381b0 Fix NRE in syncvar hooks 2020-05-31 19:09:40 +02:00
in0finite
9d0f0cfa0d Add option to sync vehicle transform using syncvars 2020-05-31 19:09:40 +02:00
in0finite
63435ad446 Sync vehicle's transform using syncvars 2020-05-31 19:09:40 +02:00
in0finite
8b75f2c3e2 Remove some code 2020-05-31 19:09:40 +02:00
in0finite
be2e685257 Cache vehicles 2020-05-31 19:09:40 +02:00
in0finite
2370a67335 Only on server or local player 2020-05-31 19:09:40 +02:00
in0finite
0d5a90a3c0 Add comments 2020-05-31 19:09:40 +02:00
in0finite
3b3f70288b Removed code which freezes vehicle if there is nothing below it 2020-05-31 19:09:40 +02:00
in0finite
800a6d1558 Extract method 2020-05-31 19:09:40 +02:00
in0finite
f90624c510 Remove commented code 2020-05-31 19:09:40 +02:00
in0finite
3e4f8d91a1 Extract method 2020-05-31 19:09:40 +02:00
in0finite
03de3a068d Remove unused code 2020-05-31 19:09:40 +02:00
in0finite
32737f4618 Add some net getters 2020-05-31 19:09:40 +02:00
in0finite
233bb3c472 Remove toggle lights 2020-05-31 19:09:40 +02:00
in0finite
6ba73af243 Remove car flip 2020-05-31 19:09:40 +02:00
in0finite
10b5e541bc Spine's direction is obtained from aim direction 2020-05-31 19:09:40 +02:00
in0finite
cb92bdd3dd Properly obtain aim direction 2020-05-31 19:09:40 +02:00
in0finite
5a4d82de13 Fix NRE in minimap when camera is null 2020-05-31 19:09:40 +02:00
in0finite
fb0c137a56 Sync wheels 2020-05-31 19:09:40 +02:00
in0finite
238f0c565b Apply server's velocity on all clients 2020-05-31 19:09:40 +02:00
in0finite
781553d6a4 ... 2020-05-31 19:09:40 +02:00
in0finite
2f82eca889 Register ped as Cell focus point 2020-05-31 19:09:40 +02:00
in0finite
502d211174 Only update division loading when there are focus points available 2020-05-31 19:09:40 +02:00
in0finite
05617caa15 Extract method 2020-05-31 19:09:40 +02:00
DannyWebbie
1e378b4d9c Change Camera.current to Camera.main to avoid OutOfRangeDestroyer from
grabbing scene camera
2020-05-31 19:09:40 +02:00
in0finite
7f5b37f85e Disable ped transform syncing while in vehicle 2020-05-31 19:09:40 +02:00
in0finite
d76320682a Cache NetworkTransform and save default sync interval 2020-05-31 19:09:40 +02:00
in0finite
ce2631ca99 Improvement 2020-05-31 19:09:40 +02:00
in0finite
d0f756fb81 Add comments 2020-05-31 19:09:40 +02:00
in0finite
2dcdbe526f Don't apply syncvars on client who controls vehicle 2020-05-31 19:09:40 +02:00
in0finite
2dc21ccfb8 Enable/disable rigid body based on authority 2020-05-31 19:09:40 +02:00
in0finite
461a3087b8 Remove authority when ped exits vehicle 2020-05-31 19:09:40 +02:00
in0finite
45897ebd9d Working on vehicle authority 2020-05-31 19:09:40 +02:00
in0finite
a9283739eb Sync car color 2020-05-31 19:09:40 +02:00
in0finite
7ea49b763c Add option to disable rigid body on clients 2020-05-31 19:09:39 +02:00
in0finite
394e08b458 States now control switching when they are forcefully switched to by the server. Fix for vehicle exiting state. 2020-05-31 19:09:39 +02:00
in0finite
e99839de0a Fix sending submit button event 2020-05-31 19:09:39 +02:00
in0finite
a7e0c91f31 Sync rigid body's linear and angular velocity 2020-05-31 19:09:39 +02:00
in0finite
f1c3f00574 Don't add or destroy VehicleController 2020-05-31 19:09:39 +02:00
in0finite
f6ddd442e7 Working on vehicle networking 5 2020-05-31 19:09:39 +02:00
in0finite
12e6c31fd0 Working on vehicle networking 4 2020-05-31 19:09:39 +02:00
in0finite
2e623e71f1 Sending input to server 2020-05-31 19:09:39 +02:00
in0finite
8993690946 Working on vehicle networking 3 2020-05-31 19:09:39 +02:00
in0finite
65961d4efe Working on vehicle networking 2 2020-05-31 19:09:39 +02:00
in0finite
2b3d85244b Remove some unused code 2020-05-31 19:09:39 +02:00
in0finite
c38c386563 Working on vehicle networking 2020-05-31 19:09:39 +02:00
in0finite
ad2c8c9010 Rename var 2020-05-31 19:09:39 +02:00
in0finite
78507f0f32 Send submit button event 2020-05-31 19:09:39 +02:00
in0finite
7360e6f0ca Rename var 2020-05-31 19:09:39 +02:00
in0finite
531da482ff Fix for vehicle receiving input from non-local peds 2020-05-31 19:09:39 +02:00
in0finite
1865251ebb Additional check 2020-05-31 19:09:39 +02:00
in0finite
07fa4c2752 Comments 2020-05-31 19:09:39 +02:00
in0finite
45418f88e0 Working on vehicle exiting 2 2020-05-31 19:09:39 +02:00
in0finite
be83e941a7 Working on vehicle exiting 2020-05-31 19:09:39 +02:00
in0finite
6ae76e392f Working on vehicle sync 7 2020-05-31 19:09:39 +02:00
in0finite
8026142938 Add cleanup 2020-05-31 19:09:39 +02:00
in0finite
9a5d6a3ec6 Working on vehicle sync 6 2020-05-31 19:09:39 +02:00
in0finite
c3bd5362d5 Don't set camera parent 2020-05-31 19:09:39 +02:00
in0finite
7a6c6b4aa8 Fix cleanup 2020-05-31 19:09:39 +02:00
in0finite
5e32312a77 Fix cleanup 2020-05-31 19:09:39 +02:00
in0finite
b1dcbd80c8 Improvement 2020-05-31 19:09:39 +02:00
in0finite
028c63955c Remove commented code 2020-05-31 19:09:39 +02:00
in0finite
e4644c1319 Fix 2020-05-31 19:09:39 +02:00
in0finite
4cae66d0c2 Sitting state should be done 2020-05-31 19:09:39 +02:00
in0finite
2842d653ef Working on vehicle sync 5 2020-05-31 19:09:39 +02:00
in0finite
63491e76ea Working on vehicle sync 4 2020-05-31 19:09:39 +02:00
in0finite
f3eff67bdf Improvement 2020-05-31 19:09:39 +02:00
in0finite
c7ce53f6e1 Almost done with vehicle entering 2020-05-31 19:09:39 +02:00
in0finite
6472f3c73e Working on vehicle sync 3 2020-05-31 19:09:39 +02:00
in0finite
b89e365619 Remove unused code for camera 2020-05-31 19:09:39 +02:00
in0finite
9944d54c20 Split into another function 2020-05-31 19:09:39 +02:00
in0finite
a90cb21be6 Cleanup coroutine 2020-05-31 19:09:39 +02:00
in0finite
f159f76806 Remove log message 2020-05-31 19:09:39 +02:00
in0finite
5e8d96aead Working on vehicle sync 2 2020-05-31 19:09:39 +02:00
in0finite
09b1bfae30 Working on vehicle sync 2020-05-31 19:09:39 +02:00
in0finite
f9e89e25ea Improvements 2020-05-31 19:09:39 +02:00
in0finite
30dc42d3ad Enter vehicle only on server 2020-05-31 19:09:39 +02:00
in0finite
91ffd9531f Removed commented code 2020-05-31 19:09:39 +02:00
in0finite
5a720b020a Fix another NRE 2020-05-31 19:09:39 +02:00
in0finite
344318f558 Fix NRE caused by updating camera in LateUpdate() 2020-05-31 19:09:39 +02:00
in0finite
669daa23be Send crouch button event 2020-05-31 19:09:39 +02:00
in0finite
9f64097b5e Exit crouch move state only on server 2020-05-31 19:09:39 +02:00
in0finite
2681264b40 Exit crouch state only on server 2020-05-31 19:09:39 +02:00
in0finite
e2895deb31 Improvement 2020-05-31 19:09:39 +02:00
in0finite
4d00d5df55 Add comments 2020-05-31 19:09:39 +02:00
in0finite
bda70b5bfb Only on server 2020-05-31 19:09:39 +02:00
in0finite
8ea0d445ac Add comment 2020-05-31 19:09:39 +02:00
in0finite
c88920e3f8 Send input from Update(), with a specified max rate 2020-05-31 19:09:38 +02:00
in0finite
787603cdb8 Don't reset input after sending it 2020-05-31 19:09:38 +02:00
in0finite
60c5284984 Camera is updated in LateUpdateState() - this seems to have fixed the problem with camera shaking 2020-05-31 19:09:38 +02:00
in0finite
929bb22fb5 Testing client behaviour when input is reset 2020-05-31 19:09:38 +02:00
in0finite
3d814ed028 PlayerController reads input on clients too 2020-05-31 19:09:38 +02:00
in0finite
38b8def30f Add comment 2020-05-31 19:09:38 +02:00
in0finite
1462897bfc Add comment 2020-05-31 19:09:38 +02:00
in0finite
be231b0f7d Working on sending input to server 2 2020-05-31 19:09:38 +02:00
in0finite
abf9db0818 Working on sending input to server 2020-05-31 19:09:38 +02:00
in0finite
10da16dced Remove spamming logs 2020-05-31 19:09:38 +02:00
in0finite
3607621665 Don't try to switch state when string is empty 2020-05-31 19:09:38 +02:00
in0finite
dbaf2f00df Remove spamming log 2020-05-31 19:09:38 +02:00
in0finite
11848cc351 Only load model on startup if it wasn't loaded so far 2020-05-31 19:09:38 +02:00
in0finite
6aadc268c0 Only load ped model if id > 0 2020-05-31 19:09:38 +02:00
in0finite
5c390d2be1 Don't assign syncvars in hooks 2020-05-31 19:09:38 +02:00
in0finite
c920d6f455 Assign syncvars only if values changed 2020-05-31 19:09:38 +02:00
in0finite
6fbbef784e Display current ped state 2020-05-31 19:09:38 +02:00
in0finite
c1a320ea3d Better log messages 2020-05-31 19:09:38 +02:00
in0finite
30f379da41 Ped state is synced 2020-05-31 19:09:38 +02:00
in0finite
feea8ffbe6 Enter crouch/fly states only on server 2020-05-31 19:09:38 +02:00
in0finite
dad31d5918 Switch to movement/aim state only on server 2020-05-31 19:09:38 +02:00
in0finite
09dbaaa12c Update movement only on server 2020-05-31 19:09:38 +02:00
in0finite
a5ff23268b Update rotation only on server 2020-05-31 19:09:38 +02:00
in0finite
574ad5d21b Improve constraining position and rotation 2020-05-31 19:09:38 +02:00
in0finite
ce674ed007 Update heading only on server 2020-05-31 19:09:38 +02:00
in0finite
0a4a760ac4 Constrain position and rotation only on server 2020-05-31 19:09:38 +02:00
in0finite
dddda3a9df Add comment 2020-05-31 19:09:38 +02:00
in0finite
823b8ea8fd Forbid reading input in PlayerController 2020-05-31 19:09:38 +02:00
in0finite
656ad48124 Rename var 2020-05-31 19:09:38 +02:00
in0finite
a4d9195dd0 Forbid entering/exiting vehicle 2020-05-31 19:09:38 +02:00
in0finite
2dee074bb1 Forbid 2020-05-31 19:09:38 +02:00