Advertisement
biu

t3d patch maker

biu
Jul 1st, 2013
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.37 KB | None | 0 0
  1. BuildVersion = "2.0.0.1"
  2. Desc = "t3d scriptpatch maker"
  3.  StatusDlg.SetTitle("T3d  additive script patch builder...");
  4. StatusDlg.SetStatusText("proccessing t3d");
  5. function  plugininit()
  6.   ListBox.AddItem("ListBox1", "t3d scriptpatch maker -bugfix on pathnames!");
  7. end
  8.  
  9. function  plugindoshit()
  10.  StatusDlg.SetTitle("T3d  additive script patch builder...");
  11. StatusDlg.SetStatusText("proccessing t3d");
  12. filea = Dialog.FileBrowse(true, "Locate t3d File", _DesktopFolder, "All Files (*.t3d)|*.t3d|", "", "t3d", false, false);
  13. vresult = Dialog.Input("string", "patch actor:", "Begin Actor Class=MyPathNode Name=MyPathNode", MB_ICONQUESTION);
  14. xresult = Dialog.Input("class", "actor to patch with:", "pnpack.mypathnode", MB_ICONQUESTION);
  15.  
  16.  
  17.  
  18. cacheini_contents = TextFile.ReadToTable(filea[1]);
  19. cache_entry_cnt = Table.Count(cacheini_contents);
  20. a = 1
  21.  StatusDlg.Show(MB_ICONNONE, false);
  22.  StatusDlg.SetMeterRange(0, cache_entry_cnt);
  23.  StatusDlg.SetTitle("T3d  additive script patch builder...");
  24.  
  25.  
  26.  for cnt = a ,cache_entry_cnt do
  27.   testa = String.Find(cacheini_contents[cnt], "Title=", 1, false);
  28.   if testa ~= -1 then
  29.   titty = cacheini_contents[cnt]
  30.   titty = String.Replace(titty, "\"", "", false);  
  31.     titty = String.Replace(titty, "  ", "", false); --fault
  32.   titty = String.Replace(titty, "Title=", "", false);  
  33.   TextFile.WriteFromString(resultapppath.."out.txt", "if(Level.Title ==\""..titty.."\")".."\r\n", true);   
  34.   ListBox.AddItem("ListBox1", "if(Level.Title ==\""..titty.."\")", "");
  35.   TextFile.WriteFromString(resultapppath.."out.txt", "{".."\r\n", true);   
  36.   TextFile.WriteFromString(resultapppath.."out.txt", "actNewClass = class<actor>( DynamicLoadObject(\""..xresult.."\", class'Class' ) );".."\r\n", true);  
  37.   ListBox.AddItem("ListBox1", "actNewClass = class<actor>( DynamicLoadObject(\""..xresult.."\", class'Class' ) );", "");
  38.  
  39.  
  40.  
  41. cnt =cache_entry_cnt;
  42.   end
  43.  
  44.  end
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  for cnt = a ,cache_entry_cnt do
  51.  StatusDlg.SetMeterPos(cnt);
  52.   --"Title=Csejte1 Cachtice Route"
  53.  
  54.  
  55.   test = String.Find(cacheini_contents[cnt], vresult, 1, false);
  56.    if test ~= -1 then
  57. StatusDlg.SetStatusText("proccessing t3d");  
  58.    temploc = cnt + 6
  59.    --   12345678910111213
  60.    -- Location= ( X = 6803.550293,Y=-13222.853516,Z=-9255.950195)
  61.    --ListBox.AddItem("ListBox1", cacheini_contents[cnt], "");
  62.   -- ListBox.AddItem("ListBox1", cacheini_contents[temploc], "");
  63.   xxx= cacheini_contents[temploc];
  64.    
  65.    
  66. start1 = String.Find(xxx, "x=", 1, false);
  67. end1 = String.Find(xxx, ",y", start1, false);
  68. out1 = String.Mid(xxx, start1+2, (end1 -2) - start1);
  69. Input.SetText("Input2", out1);
  70.  
  71.    vert1 = out1
  72.    
  73.  
  74. start1 = String.Find(xxx, "y=", 1, false);
  75. end1 = String.Find(xxx, ",z", start1, false);
  76. out2 = String.Mid(xxx, start1+2, (end1 -2) - start1);
  77. vert2 = out2
  78.    
  79.  
  80. start1 = String.Find(xxx, "z=", 1, false);
  81. end1 = String.Find(xxx, ")", start1, false);
  82. --out3 = String.Mid(input, start1+2, end1 - (start1 - 1));
  83. out3 = String.Mid(xxx, start1+2, (end1 -2) - start1);
  84. vert3 = out3
  85.  TextFile.WriteFromString(resultapppath.."out.txt", "actthing=Spawn(actNewClass,,,vect("..vert1.."\,"..vert2.."\,"..vert3.."));".."\r\n", true);   
  86.    ListBox.AddItem("ListBox1", "actthing=Spawn(actNewClass,,,vect("..vert1.."\,"..vert2.."\,"..vert3.."));", "");  
  87.  
  88.    end
  89.  end
  90.  TextFile.WriteFromString(resultapppath.."out.txt", "};".."\r\n", true);   
  91.  StatusDlg.Hide();
  92. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement