AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Change boolean value on entity? (https://forums.alliedmods.net/showthread.php?t=335322)

Mandrew 11-24-2021 17:42

Change boolean value on entity?
 
Hello. I am rather amateurish with sourcemod. However, I am able to change an antlions health using:
Code:

SetEntProp(ent, Prop_Data, "m_iHealth", 500);
But, I cannot do this with a certain bool value named "IsAllied". (Check link below)

https://github.com/ValveSoftware/sou...lion.cpp#L3814

Is there a way to force the value to be 1 despite it checking for globals?

eyal282 11-25-2021 14:33

Re: Change boolean value on entity?
 
Quote:

Originally Posted by Mandrew (Post 2764258)
Hello. I am rather amateurish with sourcemod. However, I am able to change an antlions health using:
Code:

SetEntProp(ent, Prop_Data, "m_iHealth", 500);
But, I cannot do this with a certain bool value named "IsAllied". (Check link below)

https://github.com/ValveSoftware/sou...lion.cpp#L3814

Is there a way to force the value to be 1 despite it checking for globals?

I find it hard to believe both m_iHealth and "IsAllied" are meant to be Prop_Data. Can you try Prop_Send?

Mandrew 11-26-2021 00:00

Re: Change boolean value on entity?
 
Quote:

Originally Posted by eyal282 (Post 2764318)
I find it hard to believe both m_iHealth and "IsAllied" are meant to be Prop_Data. Can you try Prop_Send?

That doesn't work. Also, m_iHealth works.

eyal282 11-26-2021 03:16

Re: Change boolean value on entity?
 
Quote:

Originally Posted by Mandrew (Post 2764357)
That doesn't work. Also, m_iHealth works.

Alright:

sm_dump_datamaps datamaps.txt
sm_dump_netprops netprops.txt

Then send me both files.

Bacardi 11-27-2021 00:05

Re: Change boolean value on entity?
 
...is this HL2 single player game ?

And IsAllied() is function. You Maybe need look signature of it and use DHooks or else.

Mandrew 11-27-2021 03:55

Re: Change boolean value on entity?
 
Quote:

Originally Posted by Bacardi (Post 2764425)
...is this HL2 single player game ?

And IsAllied() is function. You Maybe need look signature of it and use DHooks or else.

It's for hl2dm, but I'll look into DHooks.

Bacardi 11-27-2021 10:26

Re: Change boolean value on entity?
 
1 Attachment(s)
This is what I have found (hl2mp). I'm not 100% sure do these work.
I guess Linux have this one signature ?
But on windows, it get complex some reason :/
Code:

Linux
_ZN12CNPC_Antlion8IsAlliedEv

windows
56 8B F1 83 BE 24 09 00 00 04
55 8B EC 53 57 68 ? ? ? ?
55 8B EC 53 8B D9 56 8B 75 08 57 8B BB A4 0F 00 00

...on windows, I can't get signatures of these.
Code:

error to get signature

.text:102DEE70                              sub_102DEE70    proc near              ; DATA XREF: .rdata:105142C8↓o
.text:102DEE70 57                                            push    edi
.text:102DEE71 68 28 57 51 10                                push    offset aAntlionAllied ; "antlion_allied"
.text:102DEE76 8B F9                                        mov    edi, ecx
.text:102DEE78 E8 03 12 EB FF                                call    GlobalEntity_GetIndex_sub_10190080
.text:102DEE7D 50                                            push    eax
.text:102DEE7E E8 ED 12 EB FF                                call    GlobalEntity_GetState_sub_10190170
.text:102DEE83 83 C4 08                                      add    esp, 8
.text:102DEE86 83 F8 01                                      cmp    eax, 1
.text:102DEE89 75 35                                        jnz    short loc_102DEEC0
.text:102DEE8B 56                                            push    esi
.text:102DEE8C 8B F0                                        mov    esi, eax
.text:102DEE8E A1 50 D1 64 10                                mov    eax, dword_1064D150
.text:102DEE93 39 70 14                                      cmp    [eax+14h], esi
.text:102DEE96 7C 27                                        jl      short loc_102DEEBF
.text:102DEE98


.text:102E76B0                              sub_102E76B0    proc near              ; CODE XREF: sub_102DFDA0+9↑p
.text:102E76B0 56                                            push    esi
.text:102E76B1 68 28 57 51 10                                push    offset aAntlionAllied ; "antlion_allied"
.text:102E76B6 8B F1                                        mov    esi, ecx
.text:102E76B8 E8 C3 89 EA FF                                call    GlobalEntity_GetIndex_sub_10190080
.text:102E76BD 50                                            push    eax
.text:102E76BE E8 AD 8A EA FF                                call    GlobalEntity_GetState_sub_10190170
.text:102E76C3 83 C4 08                                      add    esp, 8
.text:102E76C6 83 F8 01                                      cmp    eax, 1
.text:102E76C9 75 7D                                        jnz    short loc_102E7748
.text:102E76CB 39 86 34 0F 00 00                            cmp    [esi+0F34h], eax
.text:102E76D1 74 75                                        jz      short loc_102E7748
.text:102E76D3 8B 96 A4 0F 00 00                            mov    edx, [esi+0FA4h]
.text:102E76D9 83 FA FF                                      cmp    edx, 0FFFFFFFFh
.text:102E76DC 74 6A                                        jz      short loc_102E7748
.text:102E76DE A1 C0 47 5C 10                                mov    eax, off_105C47C0
.text:102E76E3 8B CA                                        mov    ecx, edx
.text:102E76E5 81 E1 FF 0F 00 00                            and    ecx, 0FFFh
.text:102E76EB 83 C0 04                                      add    eax, 4
.text:102E76EE C1 E1 04                                      shl    ecx, 4
.text:102E76F1 03 C1                                        add    eax, ecx
.text:102E76F3 74 53                                        jz      short loc_102E7748
.text:102E76F5 C1 EA 0C                                      shr    edx, 0Ch
.text:102E76F8 39 50 04                                      cmp    [eax+4], edx
.text:102E76FB 75 4B                                        jnz    short loc_102E7748
.text:102E76FD 83 38 00                                      cmp    dword ptr [eax], 0
.text:102E7700 74 46                                        jz      short loc_102E7748
.text:102E7702 A1 50 D1 64 10                                mov    eax, dword_1064D150
.text:102E7707 F3 0F 10 86 88 0F 00 00                      movss  xmm0, dword ptr [esi+0F88h]
.text:102E770F 0F 2F 40 0C                                  comiss  xmm0, dword ptr [eax+0Ch]
.text:102E7713 77 33                                        ja      short loc_102E7748
.text:102E7715 8B 06                                        mov    eax, [esi]
.text:102E7717 8B CE                                        mov    ecx, esi
.text:102E7719 FF 90 80 01 00 00                            call    dword ptr [eax+180h]
.text:102E771F 85 C0                                        test    eax, eax
.text:102E7721 74 29                                        jz      short loc_102E774C
.text:102E7723 8B 0D 48 D1 64 10                            mov    ecx, dword_1064D148
.text:102E7729 6A 0A                                        push    0Ah
.text:102E772B 6A 05                                        push    5
.text:102E772D 8B 01                                        mov    eax, [ecx]
.text:102E772F FF 50 08                                      call    dword ptr [eax+8]
.text:102E7732 F3 0F 2A C0                                  cvtsi2ss xmm0, eax
.text:102E7736 A1 50 D1 64 10                                mov    eax, dword_1064D150
.text:102E773B F3 0F 58 40 0C                                addss  xmm0, dword ptr [eax+0Ch]
.text:102E7740 F3 0F 11 86 88 0F 00 00                      movss  dword ptr [esi+0F88h], xmm0
.text:102E7748


*edit
I added Netprops and Datamaps dumps into this post as well. If you like look those.
These are again offsets things. I did not find "IsAllied" from there.


All times are GMT -4. The time now is 22:33.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.