The online racing simulator
[Solved] acceleration.lpr - can it be condensed in arrays?
Hi

I use a little marshall on my servers that shows various messages.

Some of these give you (tongue in cheek) messages regarding about how well you can accelerate your car (whatever type).

All quite simple button/label stuff - if in this car and accelerate so fast then this message. Lots of IF - ENDIF statements.

You can see them in action at Sin'rs and Sin'rs too (S2)

Quite a simple little thing, but about a thousand lines of code!

I'm quite sure if any coder had done it they would have just used arrays and condensed the code way down.

However, apart from a very simple array, I've no idea how arrays work.

Anyone willing to put in a lot of effort and turn my code into proper array code? Schwitz

Because I know how my code works, and what it does, I've more chance of 'reverse-engineering' someone else's code.

Cheeky of me I know Razz

Thanks.


PS - I've put it in .lpr format to make it easier to include as add-on for testing
#2 - Krayy
Try this as a starting point. You may want to move the definitions into a global var, and maybe consolidate the time bands into one array, and the car names into another to streamline it a bit more.

Nice addon though...you okay for me to use it?
Attached files
acceleration_krayy.txt - 6.8 KB - 363 views
I'm seriously impressed!

Both by the compactness and especially the speed.

Many thanks for the quick reply - much appreciated.

No problem with anyone using the marshall - that's why I made it public - you may want to remove the (c) Sin'rs first though. Change the clogo and manlogo buttons.

I use the marshall and board for other messages too - mainly warning messages - like swearing, entering/leaving pits, etc.

Forgot to add following in the Language file

main_yellowflag1 = "^3|";

This is what gives the yellow hi-vis jacket effect.
-------------------------------------------------------------------

PS

Saw your reply to other post regarding someone wanting to have repeat messages every couple of minutes or so - maybe I could change my marshall to a man carrying advertising hoardings! Think of how much money I'd be owed!
Attached images
advertise.PNG
#4 - Krayy
I'll do some modifications to my version later on as I wouldn't want it to do a DISMAL if someone is leaving the pits and it takes them ~20 secs to get up to speed, so I'll just drop the first test (longest time), then maybe cut the number of speed bands to 3 for AMAZING, GREAT and PEDESTRIAN.
Quote from Krayy :I'll do some modifications to my version later on as I wouldn't want it to do a DISMAL if someone is leaving the pits and it takes them ~20 secs to get up to speed, so I'll just drop the first test (longest time), then maybe cut the number of speed bands to 3 for AMAZING, GREAT and PEDESTRIAN.

Saw it on the NZ server (just being nosy!), but the "bib" was actually the id missing message scrunched up.

You need to have

main_yellowflag1 = "^3|";

in your Language file
Como pongo para que desaparesca en mas tiempo?
Quote from sinanju :Hi

I use a little marshall on my servers that shows various messages.

Some of these give you (tongue in cheek) messages regarding about how well you can accelerate your car (whatever type).

All quite simple button/label stuff - if in this car and accelerate so fast then this message. Lots of IF - ENDIF statements.

You can see them in action at Sin'rs and Sin'rs too (S2)

Quite a simple little thing, but about a thousand lines of code!

I'm quite sure if any coder had done it they would have just used arrays and condensed the code way down.

However, apart from a very simple array, I've no idea how arrays work.

Anyone willing to put in a lot of effort and turn my code into proper array code? Schwitz

Because I know how my code works, and what it does, I've more chance of 'reverse-engineering' someone else's code.

Cheeky of me I know Razz

Thanks.


PS - I've put it in .lpr format to make it easier to include as add-on for testing

help me!
What do you want help with?
It's also good to realise, that the code included in the ZIP file, is made for Lapper version 5.x
If you want to use it with Lapper 6.x it needs a total re-write.
This thread is closed

FGED GREDG RDFGDR GSFDG