Welcome, Please Register or Login

Forums \ Street Legal Racing \ F.A.Q / Help Section \ Scripted Races for add-on tracks

12>>>

Author Message
#1\2017-06-20 22:31

Members
2
Offline

Posts: 30

rome`
mt Malta

Does anyone of you have a java script for an addon track which has 1st 2nd 3rd winning criteria?
#2\2017-06-20 22:44

Content Admin
6
Offline

Posts: 1282

W3ST
gb United Kingdom

Probably, Why?
#3\2017-06-21 02:53

Members
2
Offline

Posts: 30

rome`
mt Malta

Well i'm trying to make some tracks which have script that give you money if you end up first (win the race) that is. But i'm no programmer so I need them complete.
#4\2017-06-21 03:16

Members
2
Offline

Posts: 1575


ee Estonia

well you just cant add the java to the track, you still need to change the java so it is compatible with the track
Roleplay stuff:
Roleplay money: 102,500GC


#5\2017-06-21 06:24

Members
2
Offline

Posts: 30

rome`
mt Malta

2017-06-21 08:16#284062 StreetKeningston : well you just cant add the java to the track, you still need to change the java so it is compatible with the track

I know how it works and how to add the bots and how to add the race lines and positions.

What I don't know is how to add a script that takes care of whos in what positions, who's leading the race and which car finishes the laps first takes the prize in money.

Right now is is what im using, its more of an endurance race then an actual race.

{
if( Laps == 3 ) //0 counts too, so this makes 3 laps
{
setMessage( "You win 20000$" );
player.money+=20000;
GameLogic.autoSaveQuiet(); // Save Game
checkStart = -1;//prevent permanent GO! message
TestStatus = -2;
current_time_text.changeText(null);
//check_text.changeText(null);
laps_text.changeText(null);
GameLogic.changeActiveSection( GameLogic.garage );
}
}
}
#6\2017-06-21 13:48

Members
2
Offline

Posts: 528


00

I suggest looking through the Valo Javas like I did. I didn't find any reuseable script, but some could be manipulated to work on tracks.
#7\2017-06-21 13:56

Forum Moderator
5
Offline

Posts: 1227


pt Portugal

Jfernando1 if you use valo based script it won't work correctly because valo races are about drag/sprint races with 2 cars so if one crosses the line with a smaller time than the other it's easy to say who won, but in a circuit race is completely different of a drag/sprint race with 2 racers. It need to be a more complex thing, like having laps, time, sectors all associated to make it possible! This is just a theory but I may be almost what I'm saying.
#8\2017-06-21 14:07

Members
2
Offline

Posts: 131


us United States

If you have access to 2.3.1 there are circuit events that could have the type of SRC you're looking for. I can double check where they'd be but wouldn't be able to provide them.
#9\2017-06-21 14:34

Members
2
Offline

Posts: 528


00

Gorgoil, couldn't you just do bot1.car.getpos (or similar) within a certain range of a position, then make as set of lines to count laps.
#10\2017-06-21 14:34

Forum Moderator
5
Offline

Posts: 1227


pt Portugal

But probably won't work because I'm sure RAX have done a lot of changes on main game basis to support those kind of races, so it may be a bit useful. But I don't know.

Added 1 minutes later:

2017-06-21 19:34#284072 Jfernando1 : Gorgoil, couldn't you just do bot1.car.getpos (or similar) within a certain range of a position, then make as set of lines to count laps.

HELL NO man, it would be a big mess xD

12>>>