
Help debug scripts
Actually I wanted to - I've warmed up with with LS11 and 13 - really create a MOD with LS 15. However, since the documentation is rather well arranged, I have ME to write a script to print complete variables with their fields so I can know what I can do.
Furthermore, I've given a stack trace function thereby log messages can be assigned better. So for example, the line number in the log appears.
The whole I put in here, because maybe it might help someone. You can change it, expand it, entirely. It's the same thought. I've written in the form in the first respect for ME because I find very tedious modding (and the associated programming) without detailed documentation and remote debugger.
PS: If anyone in the search for documentation and especially can help a remote Debbuger I would be super happy. It can not be but that I have to restart the game completely for each code change. (I know the GDN, the LUA documentation also, but how can I when the running game see variable values, or how I can a mod just so reload)
Comments7
You must be logged in to comment.
Ein Tip von einem User: Wenn man die DebugExtension aufrufen will, ohne sie mit in die Sourcefiles zu packen, muss man den Dateinamen der Zip-Datei noch voranstellen. Also beispielsweise DebugScript.DebugExtension:printScriptSplash(g_currentModDirectory, "--Test--"); wenn dein Script in der Datei DebugScript.zip im Modordner liegt. Danke an Olaf
Wenn ich DebugExtension:printScriptSplash(g_currentModDirectory, "--Test--");; im Script stehen habe bekommme ich die Meldung: C:/..../HUD.lua:91: attempt to index global 'DebugExtension' (a nil value) obwohl vorher die Compass.lua auf DebugExtension zugreift und die ausgabe im Log erscheint. Was mach ich falsch?
Ich finde den Compass schonmal super hat mir schon gefehlt :) meine frage wäre kann man die position und schriftfarbe ändern ? habs versucht aber danach hatte ich keine anzeige mehr. Super Sache, weiter so :D
Position: (Compass.lua Zeile 42) Compass.position = {x=0.002, y=0.984}; wobei 0/0 links unten und 1/1 rechts oben ist Schrift kenn ich micht nicht so gut aus. Die Ausgabe ist in Cmpass.lua Zeile 48 bis 56. dort kann man z.b. setTextBold(true); in Zeile 50 machen Ich will das nicht hier machen, weil der Kompass "unauffällig" sein soll, da er ja immer an ist
Vielen Dank - nichts für den normalen Spieler, aber für Modder sehr hilfreich :)
Also das Script ist wirklich nur eine Voralge, in dem man selber auch ändern soll/kann. Also entzippen und los... Wichitg ist z.b. den DebugLevel umzustellen, so dass man alles sieht (In DebugExtension.lua am Anfang) Wenn man egiene Tabellen/Variablen ausgeben will: Mein MOd in den Mod Ordner rein. Dann sollte in deinem Script folgende Aufruf die Tabelle ausgeben DebugExtension:tableToString(g_currentMission.missionStats);