These are chat archives for ikkentim/SampSharp

10th
Oct 2016
Florian van Dillen
@fvandillen
Oct 10 2016 14:16
@ikkentim About the vehicle factory: Did you place that inside a vehicle class?
Tim Potze
@ikkentim
Oct 10 2016 14:20
public static Vehicle Load(VehicleInfo info){}, yes, the vehiclefactory class itself can be placed whereever as long as you load the service into the service provider with the code above (LoadServices)
Florian van Dillen
@fvandillen
Oct 10 2016 14:20
And do you by any chance have your VehicleInfo class for me?:)
I'll try and hook it up to my gamemode now and see if it works
Florian van Dillen
@fvandillen
Oct 10 2016 14:23
thanks mate! Working on it now
Florian van Dillen
@fvandillen
Oct 10 2016 19:06
In the RegisterServices override, it says that it is part of a controller
It seems I am missing the bigger picture here :smile:
I currently structured it like this: http://prntscr.com/cs7llz
Tim Potze
@ikkentim
Oct 10 2016 20:27
(On phone) look at the source, at the BaseVehicleController for an example
Florian van Dillen
@fvandillen
Oct 10 2016 20:27
Aight, thx
Florian van Dillen
@fvandillen
Oct 10 2016 20:57
In my vehicle init code, i'm getting a server crash when calling the vehicle Load method. http://prntscr.com/cs97i6
No actual crash, it just exits the server window, no error at all
Florian van Dillen
@fvandillen
Oct 10 2016 21:13
Only semi-meaningful info is my crashinfo.txt
Tim Potze
@ikkentim
Oct 10 2016 21:24
Put in craploads of log messages to see where it crashes
Florian van Dillen
@fvandillen
Oct 10 2016 21:24
Will do :)
Also, what is the reason for using a "Factory"? What's the main advantage?
Why not do new Vehicle( args ) like before?
Tim Potze
@ikkentim
Oct 10 2016 21:46
It's never been like that
IMO it's a bad practice to put loading logic, or db inserts in a constructor, therefore, a factory