19.11.2015, 10:39
[GameMode] PPC_Trucking V1
19.11.2015, 15:51
Update sscanf and streamer plugins,both the .dll files in /plugins folder,and the .inc files in the /pawno/includes folder,recompile your script,and try again.
08.03.2016, 21:39
As stated on the previous page, I've started from scratch again with a blank script.
I'm copying bits and pieces from all my previous V2-attempts and making new code as well.
I can't tell when it will be ready. Hopefully by the end of this year if all goes well.
I gave up previously because I wasn't getting the flexibility I needed after having started over from scratch 4 times.
Now I've got a good idea of how it's going to become and I can say I'm pleased with it.
All previous versions of V2 were just a remake of V1 with some extra features, but still pretty static.
It was mostly new code though, but it has roughly the same system with just extra commands to do some editing in-game while the server was running instead of the need to edit the script, recompile and restart the server.
You still had fixed payments per route, based on distance.
Now there will be different sizes of cargobays per vehiclemodel.
This means that a sportcar can hold 25 units for example, and a box-truck can hold 500 units, and a Roadtrain with box-trailer might have a cargobay size of 1500 (just some numbers, the true sizes haven't been decided yet).
This means you can carry more goods on a bigger vehicle than you can hold in a small vehicle, increasing your profits along with it for the same run.
This also means I had to implement some form of restrictions and that way, I'm also splitting up vehicles over different levels.
Otherwise, all players would just go for the roadtrain and never bother with the smaller vehicles.
Using this setup, it will also be possible to use almost any vehicle for every class, as long as the vehicle is capable of transporting that kind of cargo.
For pilots for example, it would even be possible to use a taxi or a bus to transport their passengers because all those vehicles can transport passengers.
For truckers, you can use your Elegy for example to transport "bottled beer", because an Elegy has the capability to transport bottled liquids.
But the Elegy will have a very small cargobay so you can't transport alot at once, but it is possible.
Any previous version of V2 didn't have that capability.
In all previous versions of V2, the route-system was fixed per class and vehicle.
For pilots using a Dodo or Stuntplane for example, all routes had something to do with dropping packages.
Another type of route (transporting passengers or carrying cargo from A to B) wasn't possible.
Or truckers with a truck+liquid trailer was only meant to transport liquids from A to B.
In the new V2, while having the same class and vehicle, it will be possible to mix up route-types.
One route will require you to take cargo from A to B, while another route required you to complete an actual traject, picking up cargo from multiple locations and dropping it of at multiple locations.
Or taking cargo from one location to houses or companies.
It's much more flexible this way.
All this is brand new code, which doesn't exist in previous versions of V2, so I can't copy/paste it with minor adjustments. And it all needs to be tested properly and takes time.
But all features will be explained in videos on my youtube channel.
I'm posting videos about new features regularly as soon as each feature is working properly.
That way, you can see how the script is progressing.
My coding time is also quite limited: full time job, house with alot of work, 2 kids, a wife, and more.
This leaves me with only 2 hours of coding time a day, sometimes an hour extra, sometimes nothing because of other priorities.
I'm copying bits and pieces from all my previous V2-attempts and making new code as well.
I can't tell when it will be ready. Hopefully by the end of this year if all goes well.
I gave up previously because I wasn't getting the flexibility I needed after having started over from scratch 4 times.
Now I've got a good idea of how it's going to become and I can say I'm pleased with it.
All previous versions of V2 were just a remake of V1 with some extra features, but still pretty static.
It was mostly new code though, but it has roughly the same system with just extra commands to do some editing in-game while the server was running instead of the need to edit the script, recompile and restart the server.
You still had fixed payments per route, based on distance.
Now there will be different sizes of cargobays per vehiclemodel.
This means that a sportcar can hold 25 units for example, and a box-truck can hold 500 units, and a Roadtrain with box-trailer might have a cargobay size of 1500 (just some numbers, the true sizes haven't been decided yet).
This means you can carry more goods on a bigger vehicle than you can hold in a small vehicle, increasing your profits along with it for the same run.
This also means I had to implement some form of restrictions and that way, I'm also splitting up vehicles over different levels.
Otherwise, all players would just go for the roadtrain and never bother with the smaller vehicles.
Using this setup, it will also be possible to use almost any vehicle for every class, as long as the vehicle is capable of transporting that kind of cargo.
For pilots for example, it would even be possible to use a taxi or a bus to transport their passengers because all those vehicles can transport passengers.
For truckers, you can use your Elegy for example to transport "bottled beer", because an Elegy has the capability to transport bottled liquids.
But the Elegy will have a very small cargobay so you can't transport alot at once, but it is possible.
Any previous version of V2 didn't have that capability.
In all previous versions of V2, the route-system was fixed per class and vehicle.
For pilots using a Dodo or Stuntplane for example, all routes had something to do with dropping packages.
Another type of route (transporting passengers or carrying cargo from A to B) wasn't possible.
Or truckers with a truck+liquid trailer was only meant to transport liquids from A to B.
In the new V2, while having the same class and vehicle, it will be possible to mix up route-types.
One route will require you to take cargo from A to B, while another route required you to complete an actual traject, picking up cargo from multiple locations and dropping it of at multiple locations.
Or taking cargo from one location to houses or companies.
It's much more flexible this way.
All this is brand new code, which doesn't exist in previous versions of V2, so I can't copy/paste it with minor adjustments. And it all needs to be tested properly and takes time.
But all features will be explained in videos on my youtube channel.
I'm posting videos about new features regularly as soon as each feature is working properly.
That way, you can see how the script is progressing.
My coding time is also quite limited: full time job, house with alot of work, 2 kids, a wife, and more.
This leaves me with only 2 hours of coding time a day, sometimes an hour extra, sometimes nothing because of other priorities.
08.03.2016, 23:00
Nice.
12.03.2016, 20:01
Why don't you post one of your old V2's (so we can use something from it) until you release the latest V2?
13.03.2016, 00:19
Only my first V2 has working classes and is basically a rewritten version of V1 but with the added traindriver class and route-editor. It also uses files for storage, same as the old V1.
All other versions of V2 don't have any working jobs yet, no classes or whatever required to be able to play it.
So posting one of those is quite useless.
My latest V2 is fully MySQL based and won't use any files.
I've been busy writing some extra code to complete a few features.
V2 has a command to add spawn-locations to any class (/addsl = add spawn-location).
This command requires level, bindprice and a name.
The level is required and determines the minimum level for players to bind them to that location.
The bindprice is the price the player needs to pay to bind himself at this location.
The name is self explanatory.
It also asks for a class via a list-dialog to add this spawn-location to.
Players bound to a location will respawn there when they die (losing some experience-points in the process as penalty for dying).
Also, the /rescue command is able to teleport you for free to your bind-location every 10 minutes.
When a player dies, he'll lose some experience.
Players level 1-4 won't lose any experience.
Players level 5-9 lose 5% experience.
Players level 10-19 lose 4% experience.
Players level 20-29 lose 3% experience.
Players level 30-39 lose 2% experience.
Players level 40+ lose 1% experience.
These values will be adjustable in-game later on and can be modified per level and per class.
For now, all classes have the same values.
I've just added the /delsl command to delete a spawn-location as well.
This one asks to select a class first, then select an existing spawn-location for that class and finally gives a summary about the location to be deleted and asks for confirming the deletion of the spawn-location.
The summary also includes a replacement bind-location for players who were bound to the location you're about to delete.
This replacement location is found automatically and will be a spawn-location for the same class of course.
It also needs to be a lower level (or the same level).
When a replacement is found, the spawn-location can be deleted. You can't delete a spawn-location when no replacement can be found. In that case, you need to create a replacement location first.
Players bound to this deleted location will be re-bound to the replacement spawn-location.
Players affected who are online will also be informed about it.
All other versions of V2 don't have any working jobs yet, no classes or whatever required to be able to play it.
So posting one of those is quite useless.
My latest V2 is fully MySQL based and won't use any files.
I've been busy writing some extra code to complete a few features.
V2 has a command to add spawn-locations to any class (/addsl = add spawn-location).
This command requires level, bindprice and a name.
The level is required and determines the minimum level for players to bind them to that location.
The bindprice is the price the player needs to pay to bind himself at this location.
The name is self explanatory.
It also asks for a class via a list-dialog to add this spawn-location to.
Players bound to a location will respawn there when they die (losing some experience-points in the process as penalty for dying).
Also, the /rescue command is able to teleport you for free to your bind-location every 10 minutes.
When a player dies, he'll lose some experience.
Players level 1-4 won't lose any experience.
Players level 5-9 lose 5% experience.
Players level 10-19 lose 4% experience.
Players level 20-29 lose 3% experience.
Players level 30-39 lose 2% experience.
Players level 40+ lose 1% experience.
These values will be adjustable in-game later on and can be modified per level and per class.
For now, all classes have the same values.
I've just added the /delsl command to delete a spawn-location as well.
This one asks to select a class first, then select an existing spawn-location for that class and finally gives a summary about the location to be deleted and asks for confirming the deletion of the spawn-location.
The summary also includes a replacement bind-location for players who were bound to the location you're about to delete.
This replacement location is found automatically and will be a spawn-location for the same class of course.
It also needs to be a lower level (or the same level).
When a replacement is found, the spawn-location can be deleted. You can't delete a spawn-location when no replacement can be found. In that case, you need to create a replacement location first.
Players bound to this deleted location will be re-bound to the replacement spawn-location.
Players affected who are online will also be informed about it.
15.03.2016, 02:41
Awesome.
17.03.2016, 20:25
(
Last edited by PowerPC603; 17/03/2016 at 08:55 PM.
)
I've added some extra parameters to the script which allow the server-owner to enable/disable vehiclemodels per class and set their level as well.
This level can be adjusted per vehiclemodel and per class.
These levels will be used when you request a vehicle at your spawn-location.
You won't be able to spawn a vehicle which you're not allowed to drive yet.
And don't bother to ask a high-level player to spawn one for you, you still won't be able to enter it and use it.
There is also a level for the houses (which aren't implemented yet) so it will be possible to link certain vehicles to a certain house-level.
Every vehicle also has an admin-level and this is used when an admin spawns a vehicle using the /v command.
There are 6 admin-levels and it's already possible to link vehiclemodels to admin-levels as well.
So a level 1 admin won't have all vehiclemodels available in that menu.
Linking vehiclemodels to classes is done because basically, every class is separate like most MMORPG games have different characters in your account.
Those games don't allow your newly created level 1 Summoner to use the same armor, weapons and other stuff your level 50 Sorcerer is using, as every character uses it's own data.
PPC Trucking V2 will use the same system.
So, your level 5 courier won't be able to use a Roadtrain vehicle just because your trucker is at level 50 and can use a Roadtrain just fine.
The linking is there because this allows you to fine-tune which vehicles are available for which class.
When you spawn at a spawn-location, there will be a vehicle-request pickup nearby where you can request a mission vehicle.
The models available to you are determined by your class and level.
In V1, there were a few vehicles spawned at each spawn-location and you could just enter a vehicle and start a job.
Since V2 uses so many levels and vehiclemodels per level+class, the vehicle-limit would be reached very soon because there need to be multiple vehicles per level-range to accomodate every player.
Having only 2 vehicles meant for level 1-4 truckers at each spawn-location would be too limited and when there are more than 2 lowbie truckers, that would mean some players don't have a vehicle to start earning money.
It's better to allow everyone requesting a vehicle that's available for them and automatically linking it to their character.
When you already requested a vehicle before and you request a new one, the first one will be deleted.
This will prevent having too many un-used vehicles all over the place.
A level 1 trucker only has a handful of vehicles available to him while a level 50 trucker has all trucker vehicles unlocked.
This also means that not ALL vehicles in the game are linked to the trucker class.
Truckers basically have no use for sportcars or bikes, so they won't be able to choose those, even when they're at max level (level 50).
Same as busdrivers don't have any use for planes or helicopters.
Or pilots using a flatbed truck or some other weird combo.
But when they buy a house and a house-vehicle, then they WILL be able to use their own vehicle to transport stuff as long as the vehiclemodel has the ability to transport that product.
A trucker won't be able to request an Elegy for example at their spawn-location as mission-vehicle, but the Elegy will still be able to transport "Bottled Beer" for example.
So if that trucker buys a house and an Elegy as house-vehicle, he can transport "Bottled Beer" with his Elegy.
This is not recommended though, because the Elegy cannot hold that much beer in his trunk (cargobay).
Your profit will be far less than using an actual trucker vehicle as those will have a larger cargobay so you can transport more at once, making more profit per run.
Same for almost any other class.
Being a pilot doesn't mean you're restricted to helicopters and planes to transport passengers.
You won't be able to select a bus at your spawn-location but you can still buy a bus as house-vehicle.
With a bus as house-vehicle, pilots could also use that bus to transport their passengers because the bus is designed to transport passengers as well.
But your house-vehicle won't refuel for free like mission vehicles do.
So you're better off in the end requesting a mission vehicle to do your jobs instead of using your own house-vehicles.
On the other hand, certain vehiclemodels won't be available as mission-vehicle.
Sportcars don't have any direct use for any class, so they won't appear in the vehicle-menu's at spawn-locations.
But you'll be able to buy and tune them and park them in front of your house and use them for jobs as well.
Since nobody else can use your house-vehicles (these are restricted to be driven by their owner only), truckers will be safe from mafia's when they're doing jobs with their own house-vehicle.
Mafia's need to steal the trucker's vehicle and drive away with it and it's cargo to make a profit. Mafia's also have their own jobs in case too few truckers are online.
Trailers on the other hand aren't safe as they can still be detached and attached to the mafia's truck.
Houses and house-vehicles won't come cheap though (but that's up to the server-owner as he can change the prices). So don't expect newcomers to buy their first house and house-vehicle on day 1 after having completed a few jobs.
Also, not every house will be able to be upgraded to level 10.
Roadtrains will be linked to level 10 houses, so if you buy a house which can only go as high as level 8, you'll never be able to buy that Roadtrain.
Also, besides paying alot of money to buy a house, you also need to pay for your house on a weekly basis to keep it.
This will be part of the auto-evict system.
When a player stops playing, he'll eventually run out of money and the house becomes available again to be bought by other players.
When you lose your house because you ran out of money, all vehicles linked to that house will be gone as well.
And you won't get a refund.
House-vehicles on the other hand are insured automatically (you had to insure your vehicles by hand in V1), so when they're destroyed, you won't lose them.
I may set their health to 50% or so after they're destroyed so you still need to pay for repairs, I'm not sure about this yet.
I'm trying to make every class useable, even when no other player is online.
Assistance in V1 was pretty useless when nobody else was online or nobody needed assistance.
This class will now also get their own jobs so they can be played without the need to wait for hours hoping someone calls for assistance.
I'll soon be in the process to link every vehicle to each class and determine the levels at which they are unlocked per level.
As soon as I have those values setup, I'm starting on the job-system itself, which will be huge and complex.
It has to account for every possibility like explained above.
It also needs to be able to use different cargotypes like flammable goods like alcohol, explosive goods such as gas canisters, deterioration goods like food (they have a limited time to be delivered to the destination or they get wasted and you won't get paid for those) and much more.
This level can be adjusted per vehiclemodel and per class.
These levels will be used when you request a vehicle at your spawn-location.
You won't be able to spawn a vehicle which you're not allowed to drive yet.
And don't bother to ask a high-level player to spawn one for you, you still won't be able to enter it and use it.
There is also a level for the houses (which aren't implemented yet) so it will be possible to link certain vehicles to a certain house-level.
Every vehicle also has an admin-level and this is used when an admin spawns a vehicle using the /v command.
There are 6 admin-levels and it's already possible to link vehiclemodels to admin-levels as well.
So a level 1 admin won't have all vehiclemodels available in that menu.
Linking vehiclemodels to classes is done because basically, every class is separate like most MMORPG games have different characters in your account.
Those games don't allow your newly created level 1 Summoner to use the same armor, weapons and other stuff your level 50 Sorcerer is using, as every character uses it's own data.
PPC Trucking V2 will use the same system.
So, your level 5 courier won't be able to use a Roadtrain vehicle just because your trucker is at level 50 and can use a Roadtrain just fine.
The linking is there because this allows you to fine-tune which vehicles are available for which class.
When you spawn at a spawn-location, there will be a vehicle-request pickup nearby where you can request a mission vehicle.
The models available to you are determined by your class and level.
In V1, there were a few vehicles spawned at each spawn-location and you could just enter a vehicle and start a job.
Since V2 uses so many levels and vehiclemodels per level+class, the vehicle-limit would be reached very soon because there need to be multiple vehicles per level-range to accomodate every player.
Having only 2 vehicles meant for level 1-4 truckers at each spawn-location would be too limited and when there are more than 2 lowbie truckers, that would mean some players don't have a vehicle to start earning money.
It's better to allow everyone requesting a vehicle that's available for them and automatically linking it to their character.
When you already requested a vehicle before and you request a new one, the first one will be deleted.
This will prevent having too many un-used vehicles all over the place.
A level 1 trucker only has a handful of vehicles available to him while a level 50 trucker has all trucker vehicles unlocked.
This also means that not ALL vehicles in the game are linked to the trucker class.
Truckers basically have no use for sportcars or bikes, so they won't be able to choose those, even when they're at max level (level 50).
Same as busdrivers don't have any use for planes or helicopters.
Or pilots using a flatbed truck or some other weird combo.
But when they buy a house and a house-vehicle, then they WILL be able to use their own vehicle to transport stuff as long as the vehiclemodel has the ability to transport that product.
A trucker won't be able to request an Elegy for example at their spawn-location as mission-vehicle, but the Elegy will still be able to transport "Bottled Beer" for example.
So if that trucker buys a house and an Elegy as house-vehicle, he can transport "Bottled Beer" with his Elegy.
This is not recommended though, because the Elegy cannot hold that much beer in his trunk (cargobay).
Your profit will be far less than using an actual trucker vehicle as those will have a larger cargobay so you can transport more at once, making more profit per run.
Same for almost any other class.
Being a pilot doesn't mean you're restricted to helicopters and planes to transport passengers.
You won't be able to select a bus at your spawn-location but you can still buy a bus as house-vehicle.
With a bus as house-vehicle, pilots could also use that bus to transport their passengers because the bus is designed to transport passengers as well.
But your house-vehicle won't refuel for free like mission vehicles do.
So you're better off in the end requesting a mission vehicle to do your jobs instead of using your own house-vehicles.
On the other hand, certain vehiclemodels won't be available as mission-vehicle.
Sportcars don't have any direct use for any class, so they won't appear in the vehicle-menu's at spawn-locations.
But you'll be able to buy and tune them and park them in front of your house and use them for jobs as well.
Since nobody else can use your house-vehicles (these are restricted to be driven by their owner only), truckers will be safe from mafia's when they're doing jobs with their own house-vehicle.
Mafia's need to steal the trucker's vehicle and drive away with it and it's cargo to make a profit. Mafia's also have their own jobs in case too few truckers are online.
Trailers on the other hand aren't safe as they can still be detached and attached to the mafia's truck.
Houses and house-vehicles won't come cheap though (but that's up to the server-owner as he can change the prices). So don't expect newcomers to buy their first house and house-vehicle on day 1 after having completed a few jobs.
Also, not every house will be able to be upgraded to level 10.
Roadtrains will be linked to level 10 houses, so if you buy a house which can only go as high as level 8, you'll never be able to buy that Roadtrain.
Also, besides paying alot of money to buy a house, you also need to pay for your house on a weekly basis to keep it.
This will be part of the auto-evict system.
When a player stops playing, he'll eventually run out of money and the house becomes available again to be bought by other players.
When you lose your house because you ran out of money, all vehicles linked to that house will be gone as well.
And you won't get a refund.
House-vehicles on the other hand are insured automatically (you had to insure your vehicles by hand in V1), so when they're destroyed, you won't lose them.
I may set their health to 50% or so after they're destroyed so you still need to pay for repairs, I'm not sure about this yet.
I'm trying to make every class useable, even when no other player is online.
Assistance in V1 was pretty useless when nobody else was online or nobody needed assistance.
This class will now also get their own jobs so they can be played without the need to wait for hours hoping someone calls for assistance.
I'll soon be in the process to link every vehicle to each class and determine the levels at which they are unlocked per level.
As soon as I have those values setup, I'm starting on the job-system itself, which will be huge and complex.
It has to account for every possibility like explained above.
It also needs to be able to use different cargotypes like flammable goods like alcohol, explosive goods such as gas canisters, deterioration goods like food (they have a limited time to be delivered to the destination or they get wasted and you won't get paid for those) and much more.
20.03.2016, 11:20
Good
20.03.2016, 13:38
Good work
20.03.2016, 17:42
(
Last edited by PowerPC603; 22/03/2016 at 10:14 AM.
)
The first class to have a working job-system is the traindriver class, using a passenger train.
I've uploaded a video onto my youtube channel to show it.
It's basic but functional.
The job itself is fully working but there is no way to end the job yet.
The job loads/unloads passengers at every trainstation.
You get paid and you receive experience when passengers get off your train.
It takes the maximum amount of 150 passengers into account as set in the database.
And it's a never-ending loop as it loops through all locations (trainstations) and goes back to the first location when the last location has been passed.
This is intentional as it's designed to be a traject jobtype.
EDIT:
I've added some extra challenges for traindrivers.
Since trains cannot be damaged by blocking the rails with vehicles and such, and trains don't consume fuel, traindrivers only need to accelerate and decelerate and stop on checkpoints to do their jobs.
Trains cannot derail either.
This would make it too easy for them.
Since trains start to shake at speeds higher than 170kph, I've decided to add some damage to the train.
This damage, unlike other vehicles, won't set a train on fire or blow it up automatically.
So, I've added a few other systems as well.
When you drive faster than 170kph, you're informed about driving too fast and you need to slow down.
Your train also receives some damage.
You can see that damage as damage to the engine.
At 30% health, you get another warning that says your engine is about to fail.
At 25% health, there will be an explosion and your engine will turn off, simulating a blown-up engine.
Your character won't die from that explosion.
But you can't start your engine anymore (the /engine command will give you an error message stating your engine is too badly damaged).
Your train will come to a stop by itself, you can't even brake anymore.
You have only 4 choices:
- either ask for assistance to repair your train
- abandon the job and find another train
- an admin could repair all vehicles for free
- have some repair kit ready in your inventory to repair your vehicle yourself
For the first choice, you need someone playing the assistance class.
For the last choice, this requires the inventory system which isn't written yet.
You'll be able to buy repair kits later on and alot of other handy items.
I've checked out all types of trains: passenger-train, freight train and tram.
They all shake at a speed of 170kph, so I've expanded the system to include all 3 of them.
I've uploaded a video onto my youtube channel to show it.
It's basic but functional.
The job itself is fully working but there is no way to end the job yet.
The job loads/unloads passengers at every trainstation.
You get paid and you receive experience when passengers get off your train.
It takes the maximum amount of 150 passengers into account as set in the database.
And it's a never-ending loop as it loops through all locations (trainstations) and goes back to the first location when the last location has been passed.
This is intentional as it's designed to be a traject jobtype.
EDIT:
I've added some extra challenges for traindrivers.
Since trains cannot be damaged by blocking the rails with vehicles and such, and trains don't consume fuel, traindrivers only need to accelerate and decelerate and stop on checkpoints to do their jobs.
Trains cannot derail either.
This would make it too easy for them.
Since trains start to shake at speeds higher than 170kph, I've decided to add some damage to the train.
This damage, unlike other vehicles, won't set a train on fire or blow it up automatically.
So, I've added a few other systems as well.
When you drive faster than 170kph, you're informed about driving too fast and you need to slow down.
Your train also receives some damage.
You can see that damage as damage to the engine.
At 30% health, you get another warning that says your engine is about to fail.
At 25% health, there will be an explosion and your engine will turn off, simulating a blown-up engine.
Your character won't die from that explosion.
But you can't start your engine anymore (the /engine command will give you an error message stating your engine is too badly damaged).
Your train will come to a stop by itself, you can't even brake anymore.
You have only 4 choices:
- either ask for assistance to repair your train
- abandon the job and find another train
- an admin could repair all vehicles for free
- have some repair kit ready in your inventory to repair your vehicle yourself
For the first choice, you need someone playing the assistance class.
For the last choice, this requires the inventory system which isn't written yet.
You'll be able to buy repair kits later on and alot of other handy items.
I've checked out all types of trains: passenger-train, freight train and tram.
They all shake at a speed of 170kph, so I've expanded the system to include all 3 of them.
22.03.2016, 01:50
vai curintia kkk
24.03.2016, 11:27
I had written a small "/work" command with preset data to test the traindriver code for transporting passengers in a never-ending route.
This command has now been rewritten to actually gather the required data based on class, vehicle and level of the player.
By doing so, the Busdriver class became functional as well because it has the same jobtype: transporting passengers on a never-ending route.
I added some test-data to test it and it works perfectly, without changing anything in the actual job processing code.
The job-code for traindriver was written in a way so it uses actual data and is not class-restricted.
In fact, any class would be able to use that same code, as long as the route is defined as a passenger-traject routetype.
When using the "/work" command, it gathers all cargo types that can be transported in the player's vehicle.
Cargo is restricted to a certain class and level-range and has a certain cargo-category.
Also, every vehicle holds some flags which indicate which cargo-categories that vehicle can transport.
These flags are just bits merged into an integer, so any vehicle can basically be assigned 32 cargo-categories which it can transport.
There won't be that much categories defined though.
By using all that data together, it's easy to create a query to get the cargo-types that are valid for the player.
When there is no cargo found, you're informed about it.
You don't have the proper level, vehicle or class to run a job (traindriver using a taxi for example).
When only 1 cargo type is found, it's selected automatically.
When multiple cargo types are found, you're shown a list of cargo-types and you can choose one.
This list also shows the buying price for the cargo, profit and experience points for each cargo-type.
These values are per unit of that cargo-type.
If your vehicle can hold 100 of those units, you can multiply these values by 100 as well to get the total cost, profit and experience for any route with that cargo.
So it's best to choose a route that's as short as possible because profit isn't based on distance anymore like in V1.
Driving from A to B over a distance of 200 meters will earn you the same profit as transporting the same cargo over a distance of 5000 meters.
This is done because V2 will have route-types where you have to pickup your cargo at several locations and deliver your cargo at several locations and it would be very difficult (if not impossible) to calculate distances between loading point and unloading point.
Upon choosing (or auto-selecting) a cargo-type, a list of routes is created.
When there is no route, then the data isn't properly in place and you're informed to contact an admin about the problem.
When 1 route is found, it's chosen automatically.
When multiple routes are found, you're also shown a list of routes and you can choose one.
For now, only 1 route-type is defined (passenger-traject) so it can only start one type of job.
For passenger-traject routes, you won't get to choose a location and the route is started immediately.
For other route-types (like truckers transporting cargo from A to B), you will be shown a list of pickup and delivery locations as well.
That code isn't ready yet as the route-type hasn't been written yet as well.
But it should also be possible to define a passenger-traject routetype for pilots as well (using large planes) and when the data is inserted into the database, the pilot class could also be functional already.
I have no video about multiple funtional classes yet, since it's only some stupid test-data that's defined.
The video about the traindriver class is valid since that route (stopping at every trainstation) will actually be in the finished V2.
I'll try to define some proper routes later this week and upload new videos showing busdriver and pilot classes working already.
This command has now been rewritten to actually gather the required data based on class, vehicle and level of the player.
By doing so, the Busdriver class became functional as well because it has the same jobtype: transporting passengers on a never-ending route.
I added some test-data to test it and it works perfectly, without changing anything in the actual job processing code.
The job-code for traindriver was written in a way so it uses actual data and is not class-restricted.
In fact, any class would be able to use that same code, as long as the route is defined as a passenger-traject routetype.
When using the "/work" command, it gathers all cargo types that can be transported in the player's vehicle.
Cargo is restricted to a certain class and level-range and has a certain cargo-category.
Also, every vehicle holds some flags which indicate which cargo-categories that vehicle can transport.
These flags are just bits merged into an integer, so any vehicle can basically be assigned 32 cargo-categories which it can transport.
There won't be that much categories defined though.
By using all that data together, it's easy to create a query to get the cargo-types that are valid for the player.
When there is no cargo found, you're informed about it.
You don't have the proper level, vehicle or class to run a job (traindriver using a taxi for example).
When only 1 cargo type is found, it's selected automatically.
When multiple cargo types are found, you're shown a list of cargo-types and you can choose one.
This list also shows the buying price for the cargo, profit and experience points for each cargo-type.
These values are per unit of that cargo-type.
If your vehicle can hold 100 of those units, you can multiply these values by 100 as well to get the total cost, profit and experience for any route with that cargo.
So it's best to choose a route that's as short as possible because profit isn't based on distance anymore like in V1.
Driving from A to B over a distance of 200 meters will earn you the same profit as transporting the same cargo over a distance of 5000 meters.
This is done because V2 will have route-types where you have to pickup your cargo at several locations and deliver your cargo at several locations and it would be very difficult (if not impossible) to calculate distances between loading point and unloading point.
Upon choosing (or auto-selecting) a cargo-type, a list of routes is created.
When there is no route, then the data isn't properly in place and you're informed to contact an admin about the problem.
When 1 route is found, it's chosen automatically.
When multiple routes are found, you're also shown a list of routes and you can choose one.
For now, only 1 route-type is defined (passenger-traject) so it can only start one type of job.
For passenger-traject routes, you won't get to choose a location and the route is started immediately.
For other route-types (like truckers transporting cargo from A to B), you will be shown a list of pickup and delivery locations as well.
That code isn't ready yet as the route-type hasn't been written yet as well.
But it should also be possible to define a passenger-traject routetype for pilots as well (using large planes) and when the data is inserted into the database, the pilot class could also be functional already.
I have no video about multiple funtional classes yet, since it's only some stupid test-data that's defined.
The video about the traindriver class is valid since that route (stopping at every trainstation) will actually be in the finished V2.
I'll try to define some proper routes later this week and upload new videos showing busdriver and pilot classes working already.
31.03.2016, 13:19
HEy add pilot liscence if possible
31.03.2016, 20:31
You won't need licenses anymore.
The license system like in V1 has been scrapped from V2.
The route-types change radically and allow for a high degree of flexibility now.
Some routes will be set to transport cargo from one pickup location to one drop-off location.
For these route-types, you can select your pickup location and drop-off location.
For all other route-types, you won't be able to select any location.
You will only be allowed to select the cargo and the route (if there is more than for your class, vehicle and level).
I'm in the process of redesigning my job-system to make it even more flexible.
I had too many different route-types and most code was going to be near identical, but each route-type had it's own code.
The new system will process almost any jobtype for any class using the same code.
It will also be able to handle normal locations, houses and company-types in the route-data.
Then it will be possible to transport cargo:
- location to location
- location to house
- location to company-type
- house to location
- house to house
- house to company-type
- company-type to location
- company-type to house
- company-type to company-type
Even multiple pickup and multiple drop-off locations are possible using the same code.
It will also allow looping the pickup and/or drop-off locations, for a given loopcount or endlessly.
When no drop-off locations are defined, the pickup-locations will also drop-off the cargo at the same time.
This is usually done for cargo like passengers or mail for endless routes like traindriver, busdriver and pilot.
In V1, only couriers were able to deliver cargo to houses.
Now any class will be able to do that.
In V1, no class was able to transport cargo to businesses.
These businesses will become companies in V2 and every class will be able to transport cargo to such a company.
The license system like in V1 has been scrapped from V2.
The route-types change radically and allow for a high degree of flexibility now.
Some routes will be set to transport cargo from one pickup location to one drop-off location.
For these route-types, you can select your pickup location and drop-off location.
For all other route-types, you won't be able to select any location.
You will only be allowed to select the cargo and the route (if there is more than for your class, vehicle and level).
I'm in the process of redesigning my job-system to make it even more flexible.
I had too many different route-types and most code was going to be near identical, but each route-type had it's own code.
The new system will process almost any jobtype for any class using the same code.
It will also be able to handle normal locations, houses and company-types in the route-data.
Then it will be possible to transport cargo:
- location to location
- location to house
- location to company-type
- house to location
- house to house
- house to company-type
- company-type to location
- company-type to house
- company-type to company-type
Even multiple pickup and multiple drop-off locations are possible using the same code.
It will also allow looping the pickup and/or drop-off locations, for a given loopcount or endlessly.
When no drop-off locations are defined, the pickup-locations will also drop-off the cargo at the same time.
This is usually done for cargo like passengers or mail for endless routes like traindriver, busdriver and pilot.
In V1, only couriers were able to deliver cargo to houses.
Now any class will be able to do that.
In V1, no class was able to transport cargo to businesses.
These businesses will become companies in V2 and every class will be able to transport cargo to such a company.
31.03.2016, 21:53
You gonna release V2 version? If yes, I hope it's a MySQL version!
01.04.2016, 09:32
(
Last edited by PowerPC603; 02/04/2016 at 08:39 PM.
)
Quote:
You gonna release V2 version? If yes, I hope it's a MySQL version!
|
And yes, V2 is fully MySQL.
I've modified cargo-types to have a variable price-profit-experience system.
Previously, to increase the payout for passengers at higher levels for example, it was required to have multiple "Passengers" in the database, each for a few select levels.
I had defined 10 different passengers for one class, each having a different profit and experience value.
There were passengers for levels 1 to 5, then another type of passengers for levels 6-10, and another for levels 11-15 and so on.
While you were working (transporting passengers around), the system couldn't select the new passenger-type when you reached the level where passenger-types were changing.
So leveling up from level 5 to 6 didn't automatically select the higher-level passenger-type.
You had to end the job and restart it to get the effects (higher profit and experience).
The script would select the next level-range of passengers and load the new values when a new job is started.
It was also impossible to program this because each cargo-type can have different routes assigned to it.
It would not only need to check for the exact same cargo-type, but also check if the same route was assigned to it and automatically take over all these new values.
Now each cargo can have a multiplier value for price, profit and experience values.
Now there is only one type of passengers for a certain class, which ranges from level 1 to 50.
This profit-multiplier for example is now set to 0,1 for passengers.
The profit for passengers is set to $5 per passenger getting off your vehicle.
But that value is only valid when you're level 1.
It uses a exponential formula to calculate the profit for each level.
Profit * ((multiplier + 1.0) ^ (playerlevel - minlevel))
This is the formula used.
Profit is the $5 mentioned earlier, this value can be found in the database and is the profit for level 1 players.
The multiplier is the 0,1 also mentioned earlier.
The playerlevel is your own level, while the minlevel is the minimum-level of the cargo (this is 1 for this passenger-type).
So when you're lvl 35 for example, your profit per passenger getting off your vehicle is:
5 * ((0,1 + 1,0) ^ (35 - 1)) = 5 * (1,1 ^ 34) = 5 * 25,5476 = 127,738 (rounded to an integer, this would become $128 per passenger getting off).
At level 50, this would become:
5 * ((0,1 + 1,0) ^ (50 - 1)) = 5 * (1,1 ^ 49) = 5 * 106,719 = 533,595 (rounded to an integer, this would become $534 per passenger getting off).
It is not required to use this multiplier value, because when it's kept at 0, the profit stays the same for all levels.
Let's use the same passenger-type for level 50 when the multiplier would be 0:
5 * ((0,0 + 1,0) ^ (50 - 1)) = 5 * (1,0 ^ 49) = 5 * 1,0 = 5,0.
So it's still possible to define the same cargo-type multiple times, each time with different level-requirements, but preset values for price, profit and experience without using this formula like before.
This multiplier can be used for all cargo-types and all classes, not only passengers or a specific class.
The same formula is used for price and experience values.
Price is the buying price of cargo per unit.
Since you don't have to pay passengers to board your bus, plane or train/tram, or even taxi, this value will be set to 0 for passengers.
Experience is the amount of experience points you get per passenger to level up (maximum level for each class is 50).
Now, when you're working and you drop off some passengers and you level up by doing so, the script will automatically recalculate the profit and experience points for dropping off those passengers at the next location.
The same formula is used while you're unloading cargo so it automatically uses the new values when you reach another level.
You don't need to end your job anymore and restart it to get the new values.
Since all 3 values have their own multiplier value, it's possible to allow cargo to rise it's profit much faster than it's experience and vice versa.
It's up to the player to find out which cargo he needs to transport to earn the most experience or profit, whatever he wishes to increase the most.
A player who wants to level up the fastest, should transport cargo which has the highest experience gain.
For pure profit, you can transport cargo which gives the most profit. Those cargo-types will usually give the lowest experience.
It's also perfectly possible to keep the buying price of cargo at the same price throughout all levels, but make the profit and experience to higher and higher per level.
So you can make it that you can buy wooden boards for $7 each and have a profit of only $2 at level 1, but a profit of $75 at level 50, while the buying price stays at $7 each (even at level 50).
Needless to say, the experience can also be kept the same throughout all levels, or even the profit itself.
Caution should be used when setting those multiplier values.
Using much higher multiplier values is un-wise because it would become too much.
Take a multiplier of 0,4 at level 50 for a cargo-type that starts at level 1 (the same passenger as above):
5 * ((0,4 + 1,0) ^ (50 - 1)) = 5 * (1,4 ^ 49) = 5 * 14463511,5998 = 72317557,999 (rounded to an integer, this would become $72.317.558 per passenger getting off).
For an AT400 carrying 250 passengers, you would earn 250 * 72m = 18 billion dollars when they would all get off your plane at once.
Since the limit for an integer is only around 2,1 billion, you'll get problems very soon.
07.04.2016, 12:56
(
Last edited by PowerPC603; 07/04/2016 at 05:59 PM.
)
Rewriting the job-system to function for almost any class seems to be harder than I thought.
Previously, I just used passengers as cargo and only the player's vehicle without a trailer.
The new system needs to detect a trailer too and decide where the cargo should go.
Suppose you have a RoadTrain and a box trailer attached to it.
The roadtrain doesn't have room for any cargo except passengers, while the box trailer is the other way around (almost any cargo except bulk fluid cargo like oil, and passengers as well).
And I didn't use the size of each cargo-type as well.
A box of matches doesn't use the same space in your vehicle as a computer for example.
Each cargo-type has a different size.
I already have modified the query to gather the proper cargo-types which fit your class, vehicle, trailer and level.
The query also checks if either your vehicle or your trailer (if there is any) can hold at least 1 unit of each cargo.
It's gotten pretty long atm to include all conditions.
And I created some functions as well to handle both your vehicle and trailer cargo for loading/unloading cargo but they aren't used yet in the job-system as it needs a little rewrite to use them.
I need to have cargo onto each vehicle separately.
Just adding the cargospace of your vehicle and trailer together and saving the total cargospace in your jobdata won't be accurate at all.
Suppose your vehicle needs to have 50 cargospace to hold 1 unit of a certain cargo.
But it only has 25 cargospace and 30 cargospace in it's trailer.
Using the sum of both would split your 1 unit in 2 parts: one half in your vehicle and the other half in your trailer, which isn't realistic.
You can't simply load a bench, break it in 2 pieces and store one in your vehicle and the other in your trailer and deliver a whole bench without damage to your destination.
And another reason to have the cargo in each vehicle separately is because mafia's can steal your cargo by stealing the vehicle along with it.
V1 had a similar system but it had to copy the data from the trucker to the mafia.
And there may be some abandoned trailers placed at some random locations with some random cargo onboard.
Attaching such a trailer to your vehicle may trigger the /work command automatically where you need to deliver that trailer to some location to get the worth of the cargo, or it may require you to use the /work command manually, I don't know about this yet.
It may also be some vehicle with some cargo onboard as well so low-level players can try to find such random bonus-missions as well, instead of only the high-levels (which are the only ones that can handle a vehicle that can attach a trailer like a Roadtrain or Linerunner).
Previously, I just used passengers as cargo and only the player's vehicle without a trailer.
The new system needs to detect a trailer too and decide where the cargo should go.
Suppose you have a RoadTrain and a box trailer attached to it.
The roadtrain doesn't have room for any cargo except passengers, while the box trailer is the other way around (almost any cargo except bulk fluid cargo like oil, and passengers as well).
And I didn't use the size of each cargo-type as well.
A box of matches doesn't use the same space in your vehicle as a computer for example.
Each cargo-type has a different size.
I already have modified the query to gather the proper cargo-types which fit your class, vehicle, trailer and level.
The query also checks if either your vehicle or your trailer (if there is any) can hold at least 1 unit of each cargo.
It's gotten pretty long atm to include all conditions.
And I created some functions as well to handle both your vehicle and trailer cargo for loading/unloading cargo but they aren't used yet in the job-system as it needs a little rewrite to use them.
I need to have cargo onto each vehicle separately.
Just adding the cargospace of your vehicle and trailer together and saving the total cargospace in your jobdata won't be accurate at all.
Suppose your vehicle needs to have 50 cargospace to hold 1 unit of a certain cargo.
But it only has 25 cargospace and 30 cargospace in it's trailer.
Using the sum of both would split your 1 unit in 2 parts: one half in your vehicle and the other half in your trailer, which isn't realistic.
You can't simply load a bench, break it in 2 pieces and store one in your vehicle and the other in your trailer and deliver a whole bench without damage to your destination.
And another reason to have the cargo in each vehicle separately is because mafia's can steal your cargo by stealing the vehicle along with it.
V1 had a similar system but it had to copy the data from the trucker to the mafia.
And there may be some abandoned trailers placed at some random locations with some random cargo onboard.
Attaching such a trailer to your vehicle may trigger the /work command automatically where you need to deliver that trailer to some location to get the worth of the cargo, or it may require you to use the /work command manually, I don't know about this yet.
It may also be some vehicle with some cargo onboard as well so low-level players can try to find such random bonus-missions as well, instead of only the high-levels (which are the only ones that can handle a vehicle that can attach a trailer like a Roadtrain or Linerunner).
08.04.2016, 20:27
Quote:
And there may be some abandoned trailers placed at some random locations with some random cargo onboard.
Attaching such a trailer to your vehicle may trigger the /work command automatically where you need to deliver that trailer to some location to get the worth of the cargo, or it may require you to use the /work command manually, I don't know about this yet. It may also be some vehicle with some cargo onboard as well so low-level players can try to find such random bonus-missions as well, instead of only the high-levels (which are the only ones that can handle a vehicle that can attach a trailer like a Roadtrain or Linerunner). |
08.04.2016, 21:09
They still need to be informed that there is some cargo on that vehicle/trailer anyways, otherwise they see it as a free trailer found somewhere and don't know what to do with it.
Each cargo-type has a maximum of 5 drop-off locations linked to it.
Thus it would be perfectly ok to start a job immediately upon attaching it to your vehicle or getting into a vehicle with such a cargo onboard.
This would only work if there is no job started yet.
If the player already has a job, it could just detach the trailer or kick you out of the vehicle with a message to inform you about it.
By starting a job automatically upon entering the vehicle or attaching it to your vehicle (in case of a trailer), the player will know immediately what to do with it as his mission-infobar at the bottom of the screen will update with the required data that informs him about the cargo onboard and where to drop it off.
For these randomly spawned vehicles with cargo onboard, it doesn't even matter if that cargo is linked to your class or not. The cargo won't be any passenger-type, only cargo.
You only need to be able to drive that vehicle and you can deliver the cargo at it's destination and get paid.
Because the cargo would be random as well (a cargo-type that's transportable by that vehicle), you don't know what's inside until you find the vehicle/trailer and use it.
Also the quantity onboard could be randomized from only 1 unit till a fully loaded vehicle.
If you're in bad luck, the cargo could be 1 box of pencils inside an Elegant, earning you only a few dollars.
If you're luck is good, you might find a box-trailer filled with gold bars or diamonds, earning you a few 100K dollars.
But this system isn't implemented yet and will come after the modified job-system is working.
Each cargo-type has a maximum of 5 drop-off locations linked to it.
Thus it would be perfectly ok to start a job immediately upon attaching it to your vehicle or getting into a vehicle with such a cargo onboard.
This would only work if there is no job started yet.
If the player already has a job, it could just detach the trailer or kick you out of the vehicle with a message to inform you about it.
By starting a job automatically upon entering the vehicle or attaching it to your vehicle (in case of a trailer), the player will know immediately what to do with it as his mission-infobar at the bottom of the screen will update with the required data that informs him about the cargo onboard and where to drop it off.
For these randomly spawned vehicles with cargo onboard, it doesn't even matter if that cargo is linked to your class or not. The cargo won't be any passenger-type, only cargo.
You only need to be able to drive that vehicle and you can deliver the cargo at it's destination and get paid.
Because the cargo would be random as well (a cargo-type that's transportable by that vehicle), you don't know what's inside until you find the vehicle/trailer and use it.
Also the quantity onboard could be randomized from only 1 unit till a fully loaded vehicle.
If you're in bad luck, the cargo could be 1 box of pencils inside an Elegant, earning you only a few dollars.
If you're luck is good, you might find a box-trailer filled with gold bars or diamonds, earning you a few 100K dollars.
But this system isn't implemented yet and will come after the modified job-system is working.
« Next Oldest | Next Newest »
Users browsing this thread: 2 Guest(s)