View previous topic :: View next topic |
Author |
Message |
gibberishh Cheater
Reputation: 1
Joined: 30 Aug 2021 Posts: 45
|
Posted: Wed Jun 15, 2022 3:36 am Post subject: Looking for 'starter' forms |
|
|
I'm about to start programming a form (eventually an exe) to modify a config file of a game. The game (The Hell 2) has no UI way to modify settings so I want to create an independent exe that will do this.
This will be my first form design/programming in CE/Lua ever. I've only ever worked with Visual Studio before and don't have that anymore.
Before I jump into it, I wanted to ask if anyone has already done such a thing -- read and write a formatted text file using forms -- and is willing to share their forms/file with me. It will be nice to begin with a 'starter' pack rather than from scratch.
Additionally, can anyone tell me if it is possible to easily include a tab interface on a form? Or do I have to 'simulate' tabs with buttons and panels?
Thanks!
_________________
It's not cheating. It's playing by my rules. |
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4697
|
Posted: Wed Jun 15, 2022 11:16 am Post subject: |
|
|
Open the form designer (Table -> Create Form) and play around with it. Look at the object inspector for available properties and events.
See celua.txt for information on some of the properties you can access through Lua.
Use Lua's IO library for reading/writing files. Parsing the config is another issue entirely- maybe try to find a library for whatever config format it is.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
gibberishh Cheater
Reputation: 1
Joined: 30 Aug 2021 Posts: 45
|
Posted: Thu Jun 16, 2022 8:17 am Post subject: |
|
|
ParkourPenguin wrote: | Open the form designer (Table -> Create Form) and play around with it. Look at the object inspector for available properties and events.
See celua.txt for information on some of the properties you can access through Lua.
Use Lua's IO library for reading/writing files. Parsing the config is another issue entirely- maybe try to find a library for whatever config format it is. |
Okay, I've created a form and tested it. So far, I have all the fields I require, my Lua script is reading the ini text file and parsing it, and is populating the fields with proper values.
I will write code to output a file later.
However, when I saved this into an exe, it is not able to find/open the ini file. I am assuming this is happening because some io library has not been 'included' in the code. Is this assumption correct? If so, how do I include required libraries in the code so that the exe is compiled with all required resources?
I don't know the exact exception that is raised. My code just checks whether the file/contents were loaded successfully or not and displays an error message if not. Since there is no error raised in the table, I don't know what error the exe is coming up against.
Thanks!
_________________
It's not cheating. It's playing by my rules. |
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4697
|
|
Back to top |
|
 |
gibberishh Cheater
Reputation: 1
Joined: 30 Aug 2021 Posts: 45
|
|
Back to top |
|
 |
gibberishh Cheater
Reputation: 1
Joined: 30 Aug 2021 Posts: 45
|
Posted: Sat Jun 18, 2022 5:48 am Post subject: |
|
|
Follow-up questions (should I have created a new post?)
When I create an exe, it ends up being approx. 5.61 MB. The way I do it is File > Save As > exe. Gigantic, Target 32-bit, selecting a small icon file, Compression = Max. No extra files added.
Obviously it must be including a lot of dependencies, probably the entire cheat engine and/or Lua engine itself -- so that it can run on machines without CE.
Question 1: When I create an exe using the Tiny option, the exe that gets created throws an error: You must have CE 6.3 installed. I have 7.2 installed and the exe was created with it. What can I do to fix this?
Question 2: Can I somehow pick and choose what dependencies get included in the exe so maybe I can reduce the overall file size? While 5.6 MB isn't huge, it seems like overkill for a simple configuration UI. Similar tools (which take advantage of Windows Forms components and DLLs) are no larger than a couple of hundred KB.
My form connects to no process, does no aobscans, does not meddle with memory, etc. It's only a form that reads and writes to a text file (form components + Lua engine including Lua file io).
Thanks again!
_________________
It's not cheating. It's playing by my rules. |
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4697
|
Posted: Sat Jun 18, 2022 11:04 am Post subject: |
|
|
Q1: I'm not sure. That might be an error in 7.2, or maybe it's not an error and it really does require 6.3 to be installed. Does it happen on the latest version? (7.4 right now)
Q2: Not really. The gigantic option does bundle an entire copy of CE into that exe. Most components of CE are so connected to each other that it's not feasible to separate them. The few features that can be separated and that most people don't need aren't included by default (e.g. dbk / dbvm stuff IIRC).
gibberishh wrote: | My form connects to no process, does no aobscans, does not meddle with memory, etc. It's only a form that reads and writes to a text file (form components + Lua engine including Lua file io). | That really doesn't sound like something you should be using CE for.
I'd make a CLI tool, but if you need a GUI, maybe try C# or something. I hear Rust is nice too.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
gibberishh Cheater
Reputation: 1
Joined: 30 Aug 2021 Posts: 45
|
Posted: Sat Jun 18, 2022 3:01 pm Post subject: |
|
|
ParkourPenguin wrote: | Does it happen on the latest version? (7.4 right now) |
I'll check it a little later. Without testing and tracing, it seems like a legacy error from an old artefact. But that's just an assumption and when I assume I make an ass-of-u-n-me.
If you wish to look, the ct file is at https://fearlessrevolution.com/viewtopic.php?p=255353#p255353 (hope I'm allowed to post this external link!). To 'use' the form you'll need a valid config file, but that requirement won't interfere with the exe creation bit.
Please don't crucify me for the highly procedural code. I'm usually a very clean programmer but this was meant to be a one-time thingee. The game keeps updating every week so this tool will be obsolete within a couple of months.
ParkourPenguin wrote: | That really doesn't sound like something you should be using CE for. I'd make a CLI tool, but if you need a GUI, maybe try C# or something. I hear Rust is nice too. |
True. Several years ago I'd have used Visual Basic and a few years ago I'd have used C#. However, as noted in the first post, I don't have access to Visual Studio any more. I have CE installed and therefore ready access to a Lua devenv + compiler.
Moreover, 'need' is a little strong I don't need this GUI. This was more of a personal project to learn CE forms, especially since it didn't involve external processes and memory manipulation. I did learn a lot and some people will benefit off it, so it's a win-win at the moment. Next step is to learn the interfacing of MemoryRecords and scripts in forms. Wish me luck!
_________________
It's not cheating. It's playing by my rules. |
|
Back to top |
|
 |
|