View previous topic :: View next topic |
Author |
Message |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Sat Feb 22, 2014 4:10 pm Post subject: Need Help With Trainer |
|
|
I'm trying to put a trainer together based on this Banished Table. I will have other options that the table does not currently have, but that doesn't matter. What I'd like to do is something like this:
I have no coding knowledge, including LUA, so I'm having a tough go at it. I've been scouring the forum to find an answer that fits my specific situation.
The script, once enabled, generates all of the addresses so that they can be manipulated. Once the script is enabled, all of the values default to 0, but that's okay, because I wrote the script to not do anything if that was the case. However, if you change the value to anything other than 0, the script will lock that item at that value. Because of this, there are no hotkeys associated with each resource item, and I'd like to keep it that way. So, what I'd like to do is have a text field, that, when a value is entered (and maybe a button pressed afterwords?), the value is locked...so that it all functions similarly to the CE table.
Is this possible? If so, how do I do it?
Thanks.
|
|
Back to top |
|
 |
Geri Moderator
Reputation: 111
Joined: 05 Feb 2010 Posts: 5636
|
Posted: Sat Feb 22, 2014 10:29 pm Post subject: |
|
|
Add the generated addresses to your trainer as an option.
When you add the address, use "Set value to" option, but do not give any value (or the edit box will be ignored).
Now when you design the interface, set "HasEditBox" from False to True, for every cheat entry where you want an edit box.
When the user will put a value in the edit box and activate the option, the value should change to the one that was given by the user.
_________________
|
|
Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Sat Feb 22, 2014 10:54 pm Post subject: |
|
|
Thanks, Geri. I've been trying to get this to work without success, based on what I've been reading on this forum.
Currently, I am following this short tutorial that was posted by DB.
Unfortunately, I end up with this while trying to execute script:
And this while trying to run the table.exe, regardless of which compatibility mode I select:
I assume that the tutorial is based on an older release of CE, because I followed it as best I could.
That being said, I am going to give your method a go right now and see if I can't do it your way. By the way...
Code: | Add the generated addresses to your trainer as an option.
When you add the address, use "Set value to" option, but do not give any value (or the edit box will be ignored). |
...what do you mean by 'setting it as an option'? How do I do that? Also, when you say 'set value to', are you referring to setting up a hotkey for the address?
I really appreciate the help. Thanks.
|
|
Back to top |
|
 |
Geri Moderator
Reputation: 111
Joined: 05 Feb 2010 Posts: 5636
|
Posted: Sat Feb 22, 2014 11:02 pm Post subject: |
|
|
Every script or address that you add to the trainer is a "cheat entry". What I meant is add the addresses as cheat entries.
And when you set the hotkey, choose "Set value to". There will be a box below it where you can enter the value, but ignore it, just leave it empty. If you put a value in it, your defined value will always overwrite the value that was given by the user in the edit box.
Btw no idea about that tutorial. I have used the method that I have posted and that method worked in my trainers.
_________________
|
|
Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sat Feb 22, 2014 11:04 pm Post subject: |
|
|
This Lua code will automatically create GUI. Edit controls will have the same order as memory records in address list. Mouse wheel will scroll controls. I don't know how to add scrollbar object to "panel".
You can edit form: change caption and add icon.
I tested it with newer CE version. It won't work under CE6.2
( don't know about CE6.3, maybe it needs some adjustments)
Don't have the game.
Description: |
|
 Download |
Filename: |
Banished Table.CT |
Filesize: |
35.3 KB |
Downloaded: |
706 Time(s) |
_________________
|
|
Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Sat Feb 22, 2014 11:23 pm Post subject: |
|
|
Geri-
Thanks. Using your method, it seems I must create a separate hotkey for each sub-value, which I was hoping to avoid. Instead of using a hotkey, I'd like to have the value set by either hitting a button next to the text box, or, when the value changes as people type (i.e. instantly). Would this be possible by following similar steps? Thanks.
mgr.inz.Player-
Thanks. Unfortunately, I can not open that. I am prompted by a message notifying me that a newer version of CE is available and recommended. After clicking 'okay', and saying 'yes' to execute, I receive an error stating that the table is not a valid cheat table (same as first picture posted above).
I've never compiled anything, so I don't know how to compile the newer beta versions of CE.
Thanks again for the help, guys.
EDIT:
Could the LUA error following DB's tutorial be caused by the address usage?:
Tutorial example:
Quote: | function bt1Click(sender)
writeInteger("[[[[[game.exe+00C2463]+1]+2]+3]+4]+5", getProperty(MyForm_edt1,"Text"))
end |
My code:
Quote: | function bt1Click(sender)
writeInteger("firewood_value", getProperty(MyForm_edt1,"Text"))
end |
|
|
Back to top |
|
 |
Geri Moderator
Reputation: 111
Joined: 05 Feb 2010 Posts: 5636
|
Posted: Sat Feb 22, 2014 11:39 pm Post subject: |
|
|
I am not sure that the value can be changed on the fly. It's not working that way in CE either.
As for a "button" instead of a hotkey, you can also add a checkbox to your cheat entry. You can enable it right next to the edit box. User types in the value, click on checkbox, value changed in memory.
_________________
|
|
Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Sat Feb 22, 2014 11:46 pm Post subject: |
|
|
Regarding the 'update value on change', I saw something in the trainer maker about it, but I really don't know what it does. What you're saying makes sense. Regarding the check box, my hope was to give users more control while also minimizing unneeded interaction. If I use a check box, what will happen if the user decides to change the value again? Will they have to untoggle the check box and retoggle it after the value is changed? For that matter, if the check box works in that fashion, how difficult would it be to substitute a button feature?
Sorry for being problematic.
|
|
Back to top |
|
 |
Geri Moderator
Reputation: 111
Joined: 05 Feb 2010 Posts: 5636
|
Posted: Sat Feb 22, 2014 11:48 pm Post subject: |
|
|
The cheat entry will deactivate itself when it's not an on/off switch. If the checkbox is working correctly in CE, it should be also deactivated automatically after a few seconds max.
_________________
|
|
Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Sat Feb 22, 2014 11:51 pm Post subject: |
|
|
But these are sub-values generated by the script that have user-defined addresses; I don't actually use 'toggle cheat' for them. The only thing that gets toggled is the script. Will that make a difference?
Thanks.
|
|
Back to top |
|
 |
Geri Moderator
Reputation: 111
Joined: 05 Feb 2010 Posts: 5636
|
Posted: Sat Feb 22, 2014 11:56 pm Post subject: |
|
|
You have to add 2 entries. 1 for the script itself and another for the user-defined address. The script is an on/off switch. The address however is using "Set value to", which is not an on/off switch so after the value is changed to the defined value, the cheat entry is deactivated automatically.
_________________
|
|
Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Sun Feb 23, 2014 12:12 am Post subject: |
|
|
I see what you're saying.
No worries though...I got it working following DB's tutorial. I don't know what happened the first time, but it seems to be working now.
+rep to you all for helping (when wait time is over).
Thanks.
|
|
Back to top |
|
 |
Geri Moderator
Reputation: 111
Joined: 05 Feb 2010 Posts: 5636
|
Posted: Sun Feb 23, 2014 12:38 am Post subject: |
|
|
I didn't try his tutorial, so I couldn't really say anything about that. I have made very few customizable trainers and some of them were with very old CE versions, before the new 6.0 interface. I don't really bother with these things too often.
Don't bother with rep. It doesn't matter to me. We guys have more than enough rep already.
_________________
|
|
Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Sun Feb 23, 2014 1:39 am Post subject: |
|
|
Same here. These days, I don't bother with these kind of options because there is just no need to do that in the trainers that I make...that, and it takes a long time. I was curious about how to do it with the new versions of CE though, and I thought it would be good to try on this Banished game.
I appreciate the help and I still learned something new from your post. Anyway, I like to give +rep to people that try to help me. I've already set a bookmark as a reminder.
|
|
Back to top |
|
 |
Geri Moderator
Reputation: 111
Joined: 05 Feb 2010 Posts: 5636
|
Posted: Sun Feb 23, 2014 4:06 am Post subject: |
|
|
Customizable cheat tables and trainers are good, but it's extra work and most people just get confused about what is what, why are there scripts and addresses etc. And if someone is really interested in it, he can just open the scripts in the CT file and modify the value. So I don't do it, even if it would raise the quality of the cheat.
_________________
|
|
Back to top |
|
 |
|