Tutorial to convert tracks from rFactor to rFactor2 with 3dsimed

Discussion in 'Track Modding' started by SPASKIS, Nov 9, 2012.

  1. SPASKIS

    SPASKIS Registered

    Joined:
    Sep 7, 2011
    Messages:
    3,155
    Likes Received:
    1,426
    I am glad you didn't say that you had followed every step in the tutorial in your first post as one did in the past almost indignated because he couldn't get it working. :) it is explained in the tutorial to change the name of track objects to racesurface.

    enviado mediante tapatalk
     
  2. pay2021

    pay2021 Registered

    Joined:
    Jul 7, 2012
    Messages:
    792
    Likes Received:
    4
    Hehe, i miss that part, still i think in modding is obsolete to put mandatory objects names to have special attributes, like lights first, now racetrack, hmmmm.
     
    Last edited by a moderator: Feb 28, 2014
  3. thuro76

    thuro76 Registered

    Joined:
    Sep 5, 2011
    Messages:
    95
    Likes Received:
    0
    Hi guys I have a problem with a conversion.
    I do everything to the letter up to the minute 5:20 but the track DEV-Mode I do not see, why?
     
  4. SPASKIS

    SPASKIS Registered

    Joined:
    Sep 7, 2011
    Messages:
    3,155
    Likes Received:
    1,426
    Can you put some images of the different folders containing tdf and scn files? Did you update the name of the icon within gdb (the script misses to do that)? The more clues you provide the better chances that we can help.

    enviado mediante tapatalk
     
  5. thuro76

    thuro76 Registered

    Joined:
    Sep 5, 2011
    Messages:
    95
    Likes Received:
    0
    View attachment 13144
    View attachment 13145
    View attachment 13146
     
  6. SPASKIS

    SPASKIS Registered

    Joined:
    Sep 7, 2011
    Messages:
    3,155
    Likes Received:
    1,426
    I understand that gmt and dds files are in the corect folder since everything you have shown so far is correct. I understand also that you copied the original scn and embedded it into the one created when executing the scripts. You didn't confirm about the renaming of joesvilleicon.dds within gdb. gdb might be modified from the one that is created with the script. It should not be directly overwritten.
    Since it does not appear within devmode it must be something big.

    enviado mediante tapatalk
     
  7. thuro76

    thuro76 Registered

    Joined:
    Sep 5, 2011
    Messages:
    95
    Likes Received:
    0
    View attachment 13147

    this is the track for rFactor created with BTB I wanted to convert it: http://www.mediafire.com/download/gzml3440zmww5fk/Kartodromo+la+Scaglia.rar
     
  8. SPASKIS

    SPASKIS Registered

    Joined:
    Sep 7, 2011
    Messages:
    3,155
    Likes Received:
    1,426
    Change event names and everyhting to lascaglia. Having duplicated track names might be the issue

    enviado mediante tapatalk
     
  9. thuro76

    thuro76 Registered

    Joined:
    Sep 5, 2011
    Messages:
    95
    Likes Received:
    0
    already tried but it does not work, in my previous post I have included a link to the track if you can help
     
  10. SPASKIS

    SPASKIS Registered

    Joined:
    Sep 7, 2011
    Messages:
    3,155
    Likes Received:
    1,426
    I'll take a look when I can get back to my computer which will be tomorrow. I hope to remember when I get home.

    enviado mediante tapatalk
     
  11. thuro76

    thuro76 Registered

    Joined:
    Sep 5, 2011
    Messages:
    95
    Likes Received:
    0
    ok thanks
    Last thing, I deleted the folder called Joesville in ModDev / Locations me but charging the same even if there is no more
     
  12. SPASKIS

    SPASKIS Registered

    Joined:
    Sep 7, 2011
    Messages:
    3,155
    Likes Received:
    1,426
    Are you sure you have mod dev setup/installed correctly? Look at the last sheet of the launcher and verify that it points to the folder that contains the mod dev folder where you have been working.

    enviado mediante tapatalk
     
  13. thuro76

    thuro76 Registered

    Joined:
    Sep 5, 2011
    Messages:
    95
    Likes Received:
    0
    In fact, what the error was, thanks 1000000000
     
  14. SPASKIS

    SPASKIS Registered

    Joined:
    Sep 7, 2011
    Messages:
    3,155
    Likes Received:
    1,426
    U R welcome

    enviado mediante tapatalk
     
  15. smbrm

    smbrm Registered

    Joined:
    Nov 11, 2010
    Messages:
    440
    Likes Received:
    50
    I have been reading this thread with interest. It appears reasonably straightforward as does the video. I continue to be confused however, buy the reference to the tools used to complete the vbs file conversion, what they are doing and where to find the tools? The links that appear to be related to the tools don't seem to work anymore. Appreciate some clarification.

    Thanks
     
  16. smbrm

    smbrm Registered

    Joined:
    Nov 11, 2010
    Messages:
    440
    Likes Received:
    50
    Finally found the files mentioned. Does a track in rfactor2 have to have functioning real road? Is it possible to have a fixed real road?
     
  17. F1Racer

    F1Racer Registered

    Joined:
    Oct 5, 2010
    Messages:
    42
    Likes Received:
    0
    Does anyone have a copy of the converttrack.vbs file they could send me ? None of the dropbox links work any more.
     
  18. Hazi

    Hazi Registered

    Joined:
    Jan 15, 2012
    Messages:
    917
    Likes Received:
    146
    Hope it´s ok to post that: just save as converttrack.vbs


    'script should be in the 'rFactor 2\Data\ModDev\Locations' folder
    '________________________________________________________________

    root = ".\"

    JoesvilleFolder = root + "Joesville"
    CheckFolderNotExists JoesvilleFolder

    enteredTrackName = InputBox("Enter new track name (you can use spaces as they will be automatically replaced with underscores)")
    CheckTrackName enteredTrackName

    TrackName = Replace(enteredTrackName, " ", "_")
    TrackFolder = root + TrackName
    CheckFolderExists TrackFolder


    CopyFolder JoesvilleFolder, TrackFolder

    RenameFolder TrackFolder + "\JoesVille_Speedway", TrackFolder + "\" + TrackName

    RenameFile TrackFolder + "\Joesville_Speedway.tdf", TrackFolder + "\" + TrackName + ".tdf"
    RenameFile TrackFolder + "\" + TrackName + "\Joesville_Speedway.gdb", TrackFolder + "\" + TrackName + "\" + TrackName + ".gdb"
    RenameFile TrackFolder + "\" + TrackName + "\Joesville_Speedway.scn", TrackFolder + "\" + TrackName + "\" + TrackName + ".scn"
    RenameFile TrackFolder + "\" + TrackName + "\Joesville_Speedwayicon.tga", TrackFolder + "\" + TrackName + "\" + TrackName + "icon.tga"
    RenameFile TrackFolder + "\" + TrackName + "\Joesville_SpeedwaySMicon.dds", TrackFolder + "\" + TrackName + "\" + TrackName + "SMicon.dds"
    RenameFile TrackFolder + "\" + TrackName + "\Joesville_Speedway_loading.jpg", TrackFolder + "\" + TrackName + "\" + TrackName + "_loading.jpg"
    RenameFile TrackFolder + "\" + TrackName + "\Joesville_SpeedwayThmb.tga", TrackFolder + "\" + TrackName + "\" + TrackName + "Thmb.tga"
    RenameFile TrackFolder + "\JoesvilleIcon.dds", TrackFolder + "\" + TrackName + "Icon.dds"

    DeleteFilesExceptExtensions TrackFolder + "\" + TrackName, "GDB;SCN;DDS;TGA;JPG"

    DeleteFiles TrackFolder + "\Assets\GMT"

    DeleteFiles TrackFolder + "\Assets\Maps"


    gdbContentOld = ReadFile(TrackFolder + "\" + TrackName + "\" + TrackName + ".gdb")
    gdbContentNew = ChangeGdbContent(gdbContentOld, TrackName, enteredTrackName)
    WriteFile TrackFolder + "\" + TrackName + "\" + TrackName + ".gdb", gdbContentNew

    scnContentOld = ReadFile(TrackFolder + "\" + TrackName + "\" + TrackName + ".scn")
    scnContentNew = ChangeScnContent(scnContentOld, TrackName)
    WriteFile TrackFolder + "\" + TrackName + "\" + TrackName + ".scn", scnContentNew


    msgbox "DONE"



    Function CheckTrackName(enteredTrackName)
    If enteredTrackName = "" Then
    msgbox "You did not enter track name or you pressed cancel, aborting script!"
    Wscript.Quit
    End If
    End Function

    Function CheckFolderNotExists(source)
    set filesys = CreateObject("Scripting.FileSystemObject")
    If NOT filesys.FolderExists(source) Then
    msgbox "This script is NOT in the right folder. Copy it in the 'rFactor 2\Data\ModDev\Locations' folder, aborting script!"
    Wscript.Quit
    End If
    End Function

    Function CheckFolderExists(source)
    set filesys = CreateObject("Scripting.FileSystemObject")
    If filesys.FolderExists(source) Then
    msgbox "The entered folder '" + source + "' already exists, aborting script!"
    Wscript.Quit
    End If
    End Function

    Function CopyFolder(source, target)
    set filesys = CreateObject("Scripting.FileSystemObject")
    If filesys.FolderExists(source) Then
    filesys.CopyFolder source, target
    End If
    End Function

    Function RenameFile(source, target)
    set filesys = CreateObject("Scripting.FileSystemObject")
    If filesys.FileExists(source) Then
    filesys.MoveFile source, target
    End If
    End Function

    Function RenameFolder(source, target)
    set filesys = CreateObject("Scripting.FileSystemObject")
    If filesys.FolderExists(source) Then
    filesys.MoveFolder source, target
    End If
    End Function

    Function DeleteFilesExceptExtensions(Folder, Exceptions)
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFldr = objFSO.GetFolder(Folder)
    For Each objFile In objFldr.Files
    sTemp = Split(objFile.Name, ".")(1)
    If NOT InStrRev(LCase(Exceptions), LCase(sTemp)) > 0 Then
    objFSO.DeleteFile objFile.Path
    End If
    Next
    End Function

    Function DeleteFilesExceptFiles(Folder, Exceptions)
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFldr = objFSO.GetFolder(Folder)
    For Each objFile In objFldr.Files
    sTemp = objFile.Name
    If NOT InStrRev(LCase(Exceptions), LCase(sTemp)) > 0 Then
    objFSO.DeleteFile objFile.Path
    End If
    Next
    End Function

    Function DeleteFile(target)
    set filesys = CreateObject("Scripting.FileSystemObject")
    If filesys.FileExists(target) Then
    filesys.DeleteFile target
    End If
    End Function

    Function DeleteFiles(Folder)
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFldr = objFSO.GetFolder(Folder)
    For Each objFile In objFldr.Files
    objFSO.DeleteFile objFile.Path
    Next
    End Function

    Function ReadFile(sFile)
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set oTS = objFSO.OpenTextFile(sFile, 1)
    sText = oTS.ReadAll
    oTS.close

    ReadFile = sText
    End Function

    Function WriteFile(sFile, content)
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    set objFile = objFSO.OpenTextFile(sFile, 2)
    objFile.Write content
    objFile.Close
    End Function

    Function ChangeGdbContent(gdbContentOld, TrackName, enteredTrackName)
    newContent = gdbContentOld

    newContent = Replace(newContent, "JoesVille_Speedway", TrackName)
    newContent = Replace(newContent, "Joesville Speedway", enteredTrackName)

    ChangeGdbContent = newContent
    End Function

    Function ChangeScnContent(scnContentOld, TrackName)
    newContent = scnContentOld

    newContent = Left(newContent, InStr(newContent, "Instance=lpole01") - 1)

    lightStart = InStr(newContent, "Light=")
    lightEnd = InStr( InStrRev(newContent, "Light="), newContent, "}")
    newContent = Replace(newContent, Mid(newContent, lightStart, lightEnd - lightStart + 1), "")

    newContent = Replace(newContent, "//MASFile=Joesville_Maps.mas" + vbCrLf, "")
    newContent = Replace(newContent, "//MASFile=Joesville_Anims.mas" + vbCrLf, "")
    newContent = Replace(newContent, "//MASFile=Joesville_SponsorMaps.mas" + vbCrLf, "")
    newContent = Replace(newContent, "//MASFile=Joesville_GMTs.mas" + vbCrLf, "")

    newContent = Replace(newContent, "SearchPath=JOESVILLE\ASSETS\MAPS", "SearchPath=JOESVILLE\ASSETS\MAPS" + vbCrLf + "SearchPath=JOESVILLE\ASSETS\JOESVILLE_MAPS")
    newContent = Replace(newContent, "SearchPath=JOESVILLE", "SearchPath=" + UCase(TrackName))

    ChangescnContent = newContent
    End Function


    'script by Abriel Nei. Modified by Spaskis for converting tracks from rf1 to rf2.
     
  19. sti228

    sti228 Registered

    Joined:
    Sep 28, 2012
    Messages:
    30
    Likes Received:
    0
    I have the same problem and download JoesVille from here: RF2 JoesVille

    Now i get this error: http://www.picz.ge/img/s3/1507/22/3/39c17dcddba4.jpg

    Someone have another JoesVille road ? Maybe i have wrong version :(
     
    Last edited by a moderator: Jul 22, 2015
  20. Kristoff Rand

    Kristoff Rand Registered

    Joined:
    Dec 23, 2011
    Messages:
    1,055
    Likes Received:
    10
    Is this tutorial still up to date?
     

Share This Page