| View previous topic :: View next topic |
| Author |
Message |
LykanthricAura Advanced Cheater
Reputation: 0
Joined: 17 May 2010 Posts: 58 Location: India
|
Posted: Tue Nov 29, 2011 12:43 am Post subject: Still can't work out the Registered symbol thing... |
|
|
Ok. Here's the original instruction...
| Code: | | mov edx,[esi+0000008C] |
Where...
esi = 3240094 (the address of the Unit's structure)
edx = E6 (230 ...the value Im working on)
So... If I did..
| Code: | push edx
mov edx,[esi]
mov [pHero],edx
pop edx |
That shud give me 3240094 in pHero right? or...Is that not how it works?
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25829 Location: The netherlands
|
Posted: Tue Nov 29, 2011 2:56 am Post subject: |
|
|
no, this writes the first 4 byte value from the unit's structure into pHero (vtable)
Instead of
| Code: |
push edx
mov edx,[esi]
mov [pHero],edx
pop edx
|
you just do:
Note that pHero must be an allocated block of memory (at least 4 bytes) that has it's name registered.
So in a previous script (or the same one)
| Code: |
alloc(pHero,4)
registersymbol(pHero)
|
_________________
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 |
|
 |
LykanthricAura Advanced Cheater
Reputation: 0
Joined: 17 May 2010 Posts: 58 Location: India
|
Posted: Wed Nov 30, 2011 12:20 am Post subject: |
|
|
If I do
alloc(pHero,4)
I cannot do label(pHero) ??? (made the script un-toggle-able)
I suppose we can't. I know...But why?
Allocated memory can't be a label?
|
|
| Back to top |
|
 |
Geri Moderator
Reputation: 111
Joined: 05 Feb 2010 Posts: 5627
|
Posted: Wed Nov 30, 2011 1:04 am Post subject: |
|
|
| LykanthricAura wrote: | If I do
alloc(pHero,4)
I cannot do label(pHero) ??? (made the script un-toggle-able)
I suppose we can't. I know...But why?
Allocated memory can't be a label? |
If you want to do that, use globalalloc.
globalalloc(pHero,4)
It will allocate the space + register it as a symbol.
_________________
|
|
| Back to top |
|
 |
|