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 


"Set value to:" Issue

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
DarkDolphin
Newbie cheater
Reputation: 1

Joined: 30 Jan 2014
Posts: 22

PostPosted: Thu Oct 20, 2016 7:55 am    Post subject: "Set value to:" Issue Reply with quote

When I assign a hotkey, using "Set value to:" with a registered symbol like (address); it works if the (address) is a 4-bytes, but not with float?

--------------------------------------------------------------------------

I have these symbols registered:


Code:

[ENABLE]
aobscan(Base,4C CE ?? ?? ?? ?? ?? 04 ?? ?? ?? 04 ?? ?? ?? 04)

label(_Base)
registersymbol(_Base)

label(CPos1)
registersymbol(CPos1)

label(CPos2)
registersymbol(CPos2)

label(RPos1)
registersymbol(RPos1)

label(RPos2)
registersymbol(RPos2)

label(Health)
registersymbol(Health)

label(Life)
registersymbol(Life)

Base:
_Base:

Base+200:
Health:

Base+1FC:
Life:

Base+32C:
CPos1:

Base+330:
CPos2:

Base+344:
RPos1:

Base+348:
RPos2:


[DISABLE]
unregistersymbol(_Base)
unregistersymbol(Health)
unregistersymbol(Life)
unregistersymbol(CPos1)
unregistersymbol(CPos2)
unregistersymbol(RPos1)
unregistersymbol(RPos2)



These addresses are 4-bytes: Health, Life
These addresses are float: CPos1, CPos2, RPos1, RPos2

*What I would like to do is to press a hotkey and have the value stored on RPos1 change to CPos1 (changing the re-spawning position (RPos1) to the current position (CPos1)).

So I go to RPos1 value --> set/change hotkey and

Code:

set value to: (CPos1)


When I press the hotkey, nothing happened. I tested changing from (Cpos1) to another registered symbol, (Health), and the value changed once the hotkey is pressed. After further testings, I figured out that it works with all the 4-bytes values, but not with the float ones. I also tested double-clicking on the value and manually entering (CPos1) there. It says "The value (CPos1) could not be parsed", where as (Health) worked properly.


This function does not work with a float address? Are there ways to make it work?

----------------------------------------------------------------------------------

What else I have tried:

I read on the forums and someone mentioned using readFloat / writeFloat and I am not sure how to properly use it.


Code:

[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
{$lua}
writeFloat(RPos1, readFloat(CPos1))
writeFloat(RPos2, readFloat(CPos2))
 
[DISABLE]
{$asm}
//code from here till the end of the code will be used to disable the cheat


This doesn't seem to work. I probably need to attach it to a code that is being executed in the game using $newmem or something like that right?
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

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

PostPosted: Thu Oct 20, 2016 9:32 am    Post subject: Re: "Set value to:" Issue Reply with quote

If memory record with description "CPos1 desc" exists, you can use this:
(be sure your MR description do not have space at the end)


Also you can use this:







As for your second approach, you're missing quote chars. Fixed:
Code:
[ENABLE]
{$lua}
writeFloat('RPos1', readFloat('CPos1'))
writeFloat('RPos2', readFloat('CPos2'))
{$asm}
[DISABLE]



demo for DarkDolphin.CT
 Description:

Download
 Filename:  demo for DarkDolphin.CT
 Filesize:  1.56 KB
 Downloaded:  625 Time(s)


_________________
Back to top
View user's profile Send private message MSN Messenger
DarkDolphin
Newbie cheater
Reputation: 1

Joined: 30 Jan 2014
Posts: 22

PostPosted: Fri Oct 21, 2016 12:50 am    Post subject: Reply with quote

I've tested all the methods and they all worked very well.

1. I just realized that (Cpos1) within the "set value to:" refers to the description name of a memory record, not the registered symbol itself.

2. Never realized you can put [readFloat('CPos1')] on the "set value to:". This is really awesome!

3. Thanks for showing how the lua code works!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking 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