Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Trainer Maker Workaround For Activation?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Mon Feb 24, 2014 6:53 pm    Post subject: Trainer Maker Workaround For Activation? Reply with quote

I've noticed some oddball bugs relating to the Trainer Maker, but can usually implement a workaround. However, now some of my cheat entries are no longer beeping or turning red on activate. The cheats are working, but not all of them are changing on enable. I tried toggling the color back and regenerating the trainer etc. to no avail.

Is there any workaround for this?

Thanks.

Looking at the CE generated script, there appears to be some problems:

Code:
memrec7_hotkey0=memoryrecord_getHotkeyByID(memrec7,0)
memrec7_hotkey1=memoryrecord_getHotkeyByID(memrec7,1)
memrec7_hotkey2=memoryrecord_getHotkeyByID(memrec7,2)
memrec47_hotkey0=memoryrecord_getHotkeyByID(memrec47,0)
memrec46_hotkey0=memoryrecord_getHotkeyByID(memrec46,0)
memrec45_hotkey0=memoryrecord_getHotkeyByID(memrec45,0)
memrec44_hotkey0=memoryrecord_getHotkeyByID(memrec44,0)
memrec21_hotkey0=memoryrecord_getHotkeyByID(memrec21,0)
memrec43_hotkey0=memoryrecord_getHotkeyByID(memrec43,0)
memrec48_hotkey0=memoryrecord_getHotkeyByID(memrec48,0)
memrec42_hotkey0=memoryrecord_getHotkeyByID(memrec42,0)
memrec19_hotkey0=memoryrecord_getHotkeyByID(memrec19,0)
memrec41_hotkey0=memoryrecord_getHotkeyByID(memrec41,0)
memrec15_hotkey0=memoryrecord_getHotkeyByID(memrec15,0)
memrec39_hotkey0=memoryrecord_getHotkeyByID(memrec39,0)
memrec18_hotkey0=memoryrecord_getHotkeyByID(memrec18,0)
memrec38_hotkey0=memoryrecord_getHotkeyByID(memrec38,0)
memrec37_hotkey0=memoryrecord_getHotkeyByID(memrec37,0)
memrec36_hotkey0=memoryrecord_getHotkeyByID(memrec36,0)
memrec35_hotkey0=memoryrecord_getHotkeyByID(memrec35,0)
memrec20_hotkey0=memoryrecord_getHotkeyByID(memrec20,0)
memrec22_hotkey0=memoryrecord_getHotkeyByID(memrec22,0)
memrec12_hotkey0=memoryrecord_getHotkeyByID(memrec12,0)
memrec34_hotkey0=memoryrecord_getHotkeyByID(memrec34,0)
memrec33_hotkey0=memoryrecord_getHotkeyByID(memrec33,0)
memrec32_hotkey0=memoryrecord_getHotkeyByID(memrec32,0)
memrec30_hotkey0=memoryrecord_getHotkeyByID(memrec30,0)
memrec29_hotkey0=memoryrecord_getHotkeyByID(memrec29,0)
memrec25_hotkey0=memoryrecord_getHotkeyByID(memrec25,0)
memrec13_hotkey0=memoryrecord_getHotkeyByID(memrec13,0)
memrec14_hotkey0=memoryrecord_getHotkeyByID(memrec14,0)
memrec10_hotkey0=memoryrecord_getHotkeyByID(memrec10,0)
memrec23_hotkey0=memoryrecord_getHotkeyByID(memrec23,0)
memrec16_hotkey0=memoryrecord_getHotkeyByID(memrec16,0)
memrec9_hotkey0=memoryrecord_getHotkeyByID(memrec9,0)
memrec17_hotkey0=memoryrecord_getHotkeyByID(memrec17,0)
memrec40_hotkey0=memoryrecord_getHotkeyByID(memrec40,0)
memrec11_hotkey0=memoryrecord_getHotkeyByID(memrec11,0)
memrec31_hotkey0=memoryrecord_getHotkeyByID(memrec31,0)
memrec8_hotkey0=memoryrecord_getHotkeyByID(memrec8,0)
memrec28_hotkey0=memoryrecord_getHotkeyByID(memrec28,0)
memrec26_hotkey0=memoryrecord_getHotkeyByID(memrec26,0)
memrec27_hotkey0=memoryrecord_getHotkeyByID(memrec27,0)
memrec70_hotkey0=memoryrecord_getHotkeyByID(memrec70,0)
memrec70_hotkey1=memoryrecord_getHotkeyByID(memrec70,1)
memrec70_hotkey2=memoryrecord_getHotkeyByID(memrec70,2)
memrec59_hotkey0=memoryrecord_getHotkeyByID(memrec59,0)
memrec5169_hotkey0=memoryrecord_getHotkeyByID(memrec5169,0)
memrec5169_hotkey1=memoryrecord_getHotkeyByID(memrec5169,1)
memrec5169_hotkey2=memoryrecord_getHotkeyByID(memrec5169,2)
memrec5170_hotkey0=memoryrecord_getHotkeyByID(memrec5170,0)
memrec5170_hotkey1=memoryrecord_getHotkeyByID(memrec5170,1)
memrec77_hotkey0=memoryrecord_getHotkeyByID(memrec77,0)
memrec77_hotkey1=memoryrecord_getHotkeyByID(memrec77,1)
memrec77_hotkey2=memoryrecord_getHotkeyByID(memrec77,2)

function onHotkey12(Hotkey)
  --Executed before the hotkey is handled
  cheatcomponent_setActive(CETrainer_1_1_CHEAT12, true, 1500)              /////////////Not Working (Hotkey: F4)
  if gBeepOnAction then
    beep()
  end
end

memoryrecordhotkey_onHotkey(memrec41_hotkey0,onHotkey12)
function onHotkey6(Hotkey)
  --Executed before the hotkey is handled
  cheatcomponent_setActive(CETrainer_1_1_CHEAT6, true, 1500)              /////////////Not Working (Hotkey: F3)
  if gBeepOnAction then
    beep()
  end
end

memoryrecordhotkey_onHotkey(memrec44_hotkey0,onHotkey6)
function onHotkey3(Hotkey)
  --Executed before the hotkey is handled
  cheatcomponent_setActive(CETrainer_1_1_CHEAT3, true, 1500)              /////////////Not Working (Hotkey: F2)
  if gBeepOnAction then
    beep()
  end
end

memoryrecordhotkey_onHotkey(memrec47_hotkey0,onHotkey3) 
function onPostHotkey0(Hotkey)
  --Executed after the "toggle*" cheat got executed
  local memrec=memoryrecordhotkey_getOwner(Hotkey)
  local isActive=memoryrecord_isActive(memrec) --get the state after the hotkey got triggered
  cheatcomponent_setActive(CETrainer_1_1_CHEAT0, isActive)                 /////////////Working (Hotkey: F1)
  if gBeepOnAction then
    beep()
  end
end

memoryrecordhotkey_onPostHotkey(memrec7_hotkey0,onPostHotkey0)

function onHotkey14(Hotkey)
  --Executed before the hotkey is handled
  cheatcomponent_setActive(CETrainer_1_1_CHEAT14, true, 1500)              /////////////Not Working (Hotkey: End)
  if gBeepOnAction then
    beep()
  end
end

memoryrecordhotkey_onHotkey(memrec39_hotkey0,onHotkey14)
function onHotkey13(Hotkey)
  --Executed before the hotkey is handled
  cheatcomponent_setActive(CETrainer_1_1_CHEAT13, true, 1500)              /////////////Not Working (Hotkey: Home)
  if gBeepOnAction then
    beep()
  end
end

memoryrecordhotkey_onHotkey(memrec15_hotkey0,onHotkey13)



I've tried altering the bottom half of the above portion to match Cheat0, but it doesn't work.

Thanks.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Mon Feb 24, 2014 7:45 pm    Post subject: Reply with quote

Every memory record have ID

If you removed some memory-records, replaced them, I'm sure their ID changed. (changing position doesn't change ID, only "position")

Auto-generated Lua script rely on those ID's. You have to fix them by hand or generate trainer from the scratch.

If you have a lot of memoryrecords, well, Sisyphean work.



For example,

you have

RESOURCES with ID 7
TEMPERATURE with ID 70
GAME SPEED with ID 5169
INSTANT BUILD with ID 54
ALWAYS SUNNY with ID 77

your generated code will look like this (part of it)

memrec7=addresslist_getMemoryRecordByID(addresslist,7)
memrec70=addresslist_getMemoryRecordByID(addresslist,70)
memrec5169=addresslist_getMemoryRecordByID(addresslist,5169)
memrec54=addresslist_getMemoryRecordByID(addresslist,54)
memrec77=addresslist_getMemoryRecordByID(addresslist,77)


Now, you removed INSTANT BUILD script, and added it again, CE will assign new ID number (currently highest ID + 1 )

RESOURCES with ID 7
TEMPERATURE with ID 70
GAME SPEED with ID 5169
ALWAYS SUNNY with ID 77
INSTANT BUILD with ID 6123 (just an example)




then you have to manually fix this line

memrec54=addresslist_getMemoryRecordByID(addresslist,54)

to this

memrec54=addresslist_getMemoryRecordByID(addresslist,6123)

_________________
Back to top
View user's profile Send private message MSN Messenger
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25796
Location: The netherlands

PostPosted: Mon Feb 24, 2014 8:13 pm    Post subject: Reply with quote

You just need to call memoryrecordhotkey_onHotkey for every hotkey to a unique function

Or do not use the auto-generated code and use your own.
I really do not recommend messing with the auto generated code, it's a waste of time most of the time

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Mon Feb 24, 2014 8:25 pm    Post subject: Reply with quote

Thank you both.

Since I do not know any coding, I just decided to scrap the color/sound on activation. Maybe some day I will learn it, but for now, I will have to rely on auto-generated CE script.

Thanks, again.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25796
Location: The netherlands

PostPosted: Mon Feb 24, 2014 8:32 pm    Post subject: Reply with quote

the color and sound on activation code is generated when you generate the trainer script based on the hotkeys.
With the trainerscript generator you have to start all over when you add new ones, so be sure all hotkeys are defined properly before using the trainerscript generator

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Mon Feb 24, 2014 8:45 pm    Post subject: Reply with quote

I understand what you are saying. Unfortunately, I had to make changes to the trainer after it was already finished. Without editing the code manually, it seems there is nothing else that can be done without starting over.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites