[solved by: Cake-san] Failing to get a DEFINE to be used at global level

Anything Cheat Engine related, bugs, suggestions, helping others, etc..
Post Reply
User avatar
Messy6666
Table Makers
Table Makers
Posts: 724
Joined: Fri Sep 25, 2020 5:45 pm
Reputation: 742

[solved by: Cake-san] Failing to get a DEFINE to be used at global level

Post by Messy6666 »

erm soz bout the empty post, pressed "submit" accidentally

Plz, what am i doing wrong here ( using Cheat Engine 7.2) ?
In the "Enable" script which activates before all others
i define PLAYER_MAX_LEVEL and then make it globally by using the registerSymbol(PLAYER_MAX_LEVEL)

Code: Select all

[ENABLE]
// Globals
define(PLAYER_MAX_LEVEL,#100)       // Max supported player lvl
registerSymbol(PLAYER_MAX_LEVEL)  // make it global ?
{$LUA}
if syntaxcheck then return end
if process and readInteger(process) ~= 0 then
...  bla bla bla ....
Now with this turned on i still can't refer to this constant in another script
for example:

Code: Select all

   db PLAYER_MAX_LEVEL
will give the error: this instruction can't be compiled.

if i do a local define tho it's working
but... the value of PLAYER_MAX_LEVEL is to be used in other scripts also

Code: Select all

define(PLAYER_MAX_LEVEL,#100)
    db PLAYER_MAX_LEVEL
works fine

tia
left is enable button/script, right is a child of that
Image
Last edited by Messy6666 on Sat Nov 07, 2020 2:39 pm, edited 7 times in total.

User avatar
Cake-san
Table Makers
Table Makers
Posts: 425
Joined: Sun Mar 26, 2017 4:32 pm
Reputation: 772

Re: Failing to get a DEFINE to be used at global level

Post by Cake-san »

use Lua global variable eg:

Code: Select all

{$lua}
PLAYER_MAX_LEVEL=100
{$asm}

User avatar
Messy6666
Table Makers
Table Makers
Posts: 724
Joined: Fri Sep 25, 2020 5:45 pm
Reputation: 742

Re: Failing to get a DEFINE to be used at global level

Post by Messy6666 »

ow tyvm gonna try that thanks! ( LUA noob here )
Last edited by Messy6666 on Sat Nov 07, 2020 2:19 pm, edited 1 time in total.

User avatar
Messy6666
Table Makers
Table Makers
Posts: 724
Joined: Fri Sep 25, 2020 5:45 pm
Reputation: 742

Re: Failing to get a DEFINE to be used at global level

Post by Messy6666 »

Cake-san wrote:
Sat Nov 07, 2020 1:29 pm
use Lua global variable eg:

Code: Select all

{$lua}
PLAYER_MAX_LEVEL=100
{$asm}
That solved it! thanks a lot

Post Reply

Who is online

Users browsing this forum: No registered users