Miguel Preguisa 443 Posted September 2, 2018 (edited) I will join the competition this time Because, I have to say, the 0.10 exceeded my expectations. I never really understood the Editor. But with the new visual scripting, it feels more like a colorful LEGO I tried to do a fully functionating race circuit. I've already had my modular Narrow Roads assets so now it needed some game logic! And I may have failed to do so a little bit But I still did a lot of work and going through the Editor scripts so let me present my work. What can it do? It counts your laps. There are three laps. It shows them to you. It's cheater-proof. You have to ride through both of the checkpoints in order to count the lap in. If you miss any of the checkpoints, it will tell you. It will also tell you when you finish the race. It can be played more than just once (reset after finish) What it can't do? It doesn't count you your time I spent the whole day trying to get it to work, but I didn't succeed. Any help or tutorial on Time Trigger will be appreciated! I wanted to let the player select the number of laps, but again, I didn't manage to teach myself to use the Ask Player or Dialogue game logic. Demonstrative race. Look at the top right on the counting. And sorry for my terrible driving. Narrow Roads doesn't forgive a single mistake Here's the demonstration of my checkpoints. Don't even try to bypass them. And how it's done? I will start with the easy things moving to the harder ones. Just a player role named Rider. Equipped with Tuxedo and Creator Cube - just in case. UI panel for counting the laps. I think most of it is self-explanatory. I used Anchor to set the position of the text. Checked off Visible to new players so newly spawned players don't see lap counting even though they didn't start. Set the Background color to transparent by setting the Alpha to 00. The text "0/0" is for debugging, players shouldn't ever see this. It's changed by scripts in the last images. Similar UI panel but for a message "Race finished!" when the player completes all three laps with all the checkpoints. Now, moving to actual visual scripting, the checkpoints. There are two of them on the racetrack and they are made of Trigger Zones same as start/finish line. Next one I should mention is the Global Storage. I used it to define the variables and transfer them to different game logic. loop_count for counting the laps. Start with 0 because the player started 0 laps at the start. reached_cp1 and reached_cp2 set to TRUE. These are the variables checking for the checkpoints. One for first, and one for the second. They are set to TRUE so the first time you pass the start/finish line, the game lets you start a new lap (the first one) without first going through both checkpoints. total_time shouldn't be there I forgot to delete it after giving up on my dream of a fully functional racetrack. Now the fun begins. This is the main thing I created. The first image is without any further info. The second has the parts of code explained. And the third one is for those similar to me, who would get lost in the image above if they saw it for the first time Woah, that was more text than I thought I will write today Hope you liked my tutorial and that you learned something new! I sure did when creating this. And shout out to @MyPa553ng3r who created the nice car I used when testing the race circuit. Edited September 2, 2018 by Miguel Preguisa 3 Share this post Link to post Share on other sites
Miguel Preguisa 443 Posted September 2, 2018 And just to clarify, I don't know how to code. This was probably the biggest thing I've ever coded and it isn't anyhow long. I managed to get this working just by going through different visual scripting components and without any tutorial. The new visual scripting feels very intuitive! Share this post Link to post Share on other sites
Indomitus 388 Posted September 2, 2018 (edited) This is very well done. To get a lap time, you could use a time trigger, set it to a very high time that won't run out. When they finish the lap, there is a GET ELAPSED TIME command (Under Game Logics: Time Trigger) to find out how much time since the Time Trigger started. Then you can either let it keep going for the next lap or reset it and get each lap time separately. You could even let them know their time at each checkpoint. I have not tried this, so I don't know how precise it would be, but it is a place to start. Edited September 2, 2018 by Indomitus 1 Share this post Link to post Share on other sites