Такое ощущение как будто он защит в exe.В этом ты прав:
Можно отключить рендер определенной модели в определенном радиусе
Ой, я совсем забыл про этот опкод:Код: TextОн вроде вместе с col-файлом заменяет. По крайней мере, гаитянский наркозавод вроде и коллизию менял после дебоша Томми(сам лично еще не юзал этот опкод, поэтому 100% не скажу).
03B6: replace_model_at 117.991 -362.461 10.179 radius 80.0 from #BLDNGST2MESH to #BLDNGST2MESHDAM
Я почти уверен, что это именно то, что нужно было Saint и daniel_360. Остается только найти объекты-пустышки, на которые нужно заменить удаляемые объекты. Для тех, кто не знает - имена объектов, типа "#BLDNGST2MESH" можно просто заменить на их id(это и делает компилятор при компиляции).
Но в случае daniel_360 может помочь и простая замена объектов в ipl, т.к. в его ситуации вроде не обязательно заменять объекты "на лету", если я правильно всё помню.
const SCRIPT_COMMAND replace_model = { 0x036B, "ffffii" }; // 6
// 03B6: replace_model_at 117.991 -362.461 10.179 radius 80.0 from -127 (BLDNGST2MESH) to -126 (BLDNGST2MESHDAM) // строка из main.scm
ScriptCommand(&request_model, 3964);
ScriptCommand(&load_requested_models);
ScriptCommand(&replace_model, 117.991, -362.461, 10.179, 80.0, 3908, 3964); // стройка // test
ScriptCommand(&release_model, 3908);
-127 и -126 - это прописанные референсы в начале main.scm. Попробуй вместо них сразу юзать id из ide
последние 2 параметра это и есть сразу idОй, я слепой - не туда смотрел.
{$CLEO .cs}
//-------------MAIN---------------
0000:
:BuildingReplace
wait 0
Player.Defined($PLAYER_CHAR)
jf @BuildingReplace
0ADC: test_cheat "STROYKA"
jf @BuildingReplace
Model.Load(3964)
:BuildingReplace2
if
not Model.Available(3964)
jf @BuildingReplace3
wait 0
jump @BuildingReplace2
:BuildingReplace3
03B6: replace_model_at 117.991 -362.461 10.179 radius 80.0 from 3908 to 3964
Model.Destroy(3964)
0ACE: show_formatted_text_box "tpax tubugox"
jump @BuildingReplace
{$CLEO .cs}
//-------------MAIN---------------
0000:
:BuildingReplace
wait 0
Player.Defined($PLAYER_CHAR)
jf @BuildingReplace
0ADC: test_cheat "STROYKA"
jf @BuildingReplace
Model.Load(3820) //starwaterfrnt11, originally 3964
:BuildingReplace2
if
not Model.Available(3820)
jf @BuildingReplace3
wait 0
jump @BuildingReplace2
:BuildingReplace3
03B6: replace_model_at 117.991 -362.461 10.179 radius 80.0 from 3908 to 3820
Model.Destroy(3820)
0ACE: show_formatted_text_box "tpax tubugox"
jump @BuildingReplace
const SCRIPT_COMMAND replace_model = { 0x036B, "ffffii" }; // 6
const SCRIPT_COMMAND replace_model = { 0x03B6, "ffffii" }; // 6
Ну, остается только ковырять устройство этого опкода.
А "не совсем то что нужно" - это из-за ограниченного количества заменяемых объектов? Мб проще взломать этот лимит(понятное дело, что речь не о сейвах, но просто для стабильной работы игры)?
.text:00459E19 ; ---------------------------------------------------------------------------
.text:00459E19
.text:00459E19 loc_459E19: ; CODE XREF: CRunningScript::ProcessCommands900To999(int)+22j
.text:00459E19 ; DATA XREF: .data:0068A020o
.text:00459E19 8D 45 10 lea eax, [ebp+10h] ; jumptable 00458EE2 case 50
.text:00459E1C 89 E9 mov ecx, ebp
.text:00459E1E 6A 06 push 6
.text:00459E20 50 push eax
.text:00459E21 E8 EA 71 FF FF call CRunningScript::CollectParameters(uint *,short)
.text:00459E26 D9 05 38 74 7D 00 fld ds:scm_params_1
.text:00459E2C D9 5C 24 7C fstp [esp+218h+var_19C]
.text:00459E30 D9 05 3C 74 7D 00 fld ds:scm_params_2
.text:00459E36 D9 9C 24 94 00 00 00 fstp [esp+218h+var_184]
.text:00459E3D D9 05 40 74 7D 00 fld ds:scm_params_3
.text:00459E43 D9 9C 24 AC 00 00 00 fstp [esp+218h+var_16C]
.text:00459E4A D9 84 24 AC 00 00 00 fld [esp+218h+var_16C]
.text:00459E51 D8 1D D4 9C 68 00 fcomp flt_689CD4
.text:00459E57 DF E0 fnstsw ax
.text:00459E59 F6 C4 04 test ah, 4
.text:00459E5C 75 24 jnz short loc_459E82
.text:00459E5E 80 E4 45 and ah, 45h
.text:00459E61 F6 C4 41 test ah, 41h
.text:00459E64 74 1C jz short loc_459E82
.text:00459E66 FF B4 24 94 00 00 00 push [esp+218h+var_184]
.text:00459E6D FF B4 24 80 00 00 00 push [esp+21Ch+var_19C]
.text:00459E74 E8 C7 B6 07 00 call CWorld::FindGroundZForCoord(float,float)
.text:00459E79 D9 9C 24 B4 00 00 00 fstp [esp+220h+var_16C]
.text:00459E80 59 pop ecx
.text:00459E81 59 pop ecx
.text:00459E82
.text:00459E82 loc_459E82: ; CODE XREF: CRunningScript::ProcessCommands900To999(int)+F9Cj
.text:00459E82 ; CRunningScript::ProcessCommands900To999(int)+FA4j
.text:00459E82 D9 05 44 74 7D 00 fld ds:scm_params_4
.text:00459E88 D9 5C 24 3C fstp [esp+218h+var_1DC]
.text:00459E8C D9 05 E4 9C 68 00 fld flt_689CE4
.text:00459E92 D8 4C 24 3C fmul [esp+218h+var_1DC]
.text:00459E96 8B 3D 48 74 7D 00 mov edi, ds:scm_params_5
.text:00459E9C 31 ED xor ebp, ebp
.text:00459E9E 85 FF test edi, edi
.text:00459EA0 D9 5C 24 38 fstp [esp+218h+var_1E0]
.text:00459EA4 7D 12 jge short loc_459EB8
.text:00459EA6 F7 DF neg edi
.text:00459EA8 8D 04 FD 00 00 00 00 lea eax, ds:0[edi*8]
.text:00459EAF 29 F8 sub eax, edi
.text:00459EB1 8B 3C 85 E0 1D 7D 00 mov edi, ds:dword_7D1DE0[eax*4]
.text:00459EB8
.text:00459EB8 loc_459EB8: ; CODE XREF: CRunningScript::ProcessCommands900To999(int)+FE4j
.text:00459EB8 8B 35 4C 74 7D 00 mov esi, ds:scm_params_6
.text:00459EBE 85 F6 test esi, esi
.text:00459EC0 7D 12 jge short loc_459ED4
.text:00459EC2 F7 DE neg esi
.text:00459EC4 8D 04 F5 00 00 00 00 lea eax, ds:0[esi*8]
.text:00459ECB 29 F0 sub eax, esi
.text:00459ECD 8B 34 85 E0 1D 7D 00 mov esi, ds:dword_7D1DE0[eax*4]
.text:00459ED4
.text:00459ED4 loc_459ED4: ; CODE XREF: CRunningScript::ProcessCommands900To999(int)+1000j
.text:00459ED4 8B 44 24 7C mov eax, [esp+218h+var_19C]
.text:00459ED8 89 FB mov ebx, edi
.text:00459EDA 89 84 24 B4 01 00 00 mov [esp+218h+var_64], eax
.text:00459EE1 8B 84 24 AC 00 00 00 mov eax, [esp+218h+var_16C]
.text:00459EE8 89 84 24 BC 01 00 00 mov [esp+218h+var_5C], eax
.text:00459EEF 8D 84 24 18 01 00 00 lea eax, [esp+218h+var_102+2]
.text:00459EF6 6A 00 push 0 ; char
.text:00459EF8 6A 00 push 0 ; char
.text:00459EFA 6A 00 push 0 ; char
.text:00459EFC 6A 00 push 0 ; char
.text:00459EFE 6A 01 push 1 ; char
.text:00459F00 50 push eax ; int
.text:00459F01 8D 84 24 2E 01 00 00 lea eax, [esp+230h+var_102]
.text:00459F08 6A 10 push 10h ; __int16
.text:00459F0A 50 push eax ; int
.text:00459F0B 8D 84 24 D4 01 00 00 lea eax, [esp+238h+var_64]
.text:00459F12 8B 8C 24 B4 00 00 00 mov ecx, [esp+238h+var_184]
.text:00459F19 6A 01 push 1 ; int
.text:00459F1B FF 74 24 60 push [esp+23Ch+var_1DC] ; float
.text:00459F1F 50 push eax ; int
.text:00459F20 53 push ebx ; int
.text:00459F21 89 8C 24 E8 01 00 00 mov [esp+248h+var_60], ecx
.text:00459F28 E8 43 C8 07 00 call CWorld::FindObjectsOfTypeInRange(uint,CVector const&,float,bool,short *,short,CEntity **,bool,bool,bool,bool,bool)
.text:00459F2D 83 C4 30 add esp, 30h
.text:00459F30 66 83 BC 24 16 01 00 00+ cmp [esp+218h+var_102], 0
.text:00459F39 75 55 jnz short loc_459F90
.text:00459F3B 8B 44 24 7C mov eax, [esp+218h+var_19C]
.text:00459F3F 8D 8C 24 18 01 00 00 lea ecx, [esp+218h+var_102+2]
.text:00459F46 89 84 24 C0 01 00 00 mov [esp+218h+var_58], eax
.text:00459F4D 8B 84 24 AC 00 00 00 mov eax, [esp+218h+var_16C]
.text:00459F54 89 84 24 C8 01 00 00 mov [esp+218h+var_50], eax
.text:00459F5B 8D 84 24 16 01 00 00 lea eax, [esp+218h+var_102]
.text:00459F62 51 push ecx ; int
.text:00459F63 8B 94 24 98 00 00 00 mov edx, [esp+21Ch+var_184]
.text:00459F6A 6A 10 push 10h ; __int16
.text:00459F6C 50 push eax ; int
.text:00459F6D 8D 84 24 CC 01 00 00 lea eax, [esp+224h+var_58]
.text:00459F74 6A 01 push 1 ; char
.text:00459F76 FF 74 24 4C push [esp+228h+var_1DC] ; float
.text:00459F7A 50 push eax ; int
.text:00459F7B 89 94 24 DC 01 00 00 mov [esp+230h+var_54], edx
.text:00459F82 68 FC 85 97 00 push offset dword_9785FC ; int
.text:00459F87 53 push ebx ; int
.text:00459F88 E8 13 C7 07 00 call CWorld::FindObjectsOfTypeInRangeSectorList(uint,CPtrList &,CVector const&,float,bool,short *,short,CEntity **)
.text:00459F8D 83 C4 20 add esp, 20h
.text:00459F90
.text:00459F90 loc_459F90: ; CODE XREF: CRunningScript::ProcessCommands900To999(int)+1079j
.text:00459F90 66 83 BC 24 16 01 00 00+ cmp [esp+218h+var_102], 0
.text:00459F99 0F 85 98 00 00 00 jnz loc_45A037
.text:00459F9F 8B 44 24 7C mov eax, [esp+218h+var_19C]
.text:00459FA3 8B 8C 24 94 00 00 00 mov ecx, [esp+218h+var_184]
.text:00459FAA 89 84 24 58 01 00 00 mov [esp+218h+var_C0], eax
.text:00459FB1 8B 84 24 AC 00 00 00 mov eax, [esp+218h+var_16C]
.text:00459FB8 89 84 24 60 01 00 00 mov [esp+218h+var_B8], eax
.text:00459FBF 8D 84 24 58 01 00 00 lea eax, [esp+218h+var_C0]
.text:00459FC6 50 push eax
.text:00459FC7 89 8C 24 60 01 00 00 mov [esp+21Ch+var_BC], ecx
.text:00459FCE E8 2D 33 08 00 call CTheZones::GetLevelFromPosition(CVector const*)
.text:00459FD3 0F BF C0 movsx eax, ax
.text:00459FD6 8B 94 24 80 00 00 00 mov edx, [esp+21Ch+var_19C]
.text:00459FDD 59 pop ecx
.text:00459FDE 8B 8C 24 94 00 00 00 mov ecx, [esp+218h+var_184]
.text:00459FE5 89 94 24 CC 01 00 00 mov [esp+218h+var_4C], edx
.text:00459FEC 8B 94 24 AC 00 00 00 mov edx, [esp+218h+var_16C]
.text:00459FF3 89 8C 24 D0 01 00 00 mov [esp+218h+var_48], ecx
.text:00459FFA 8D 8C 24 18 01 00 00 lea ecx, [esp+218h+var_102+2]
.text:0045A001 89 94 24 D4 01 00 00 mov [esp+218h+var_44], edx
.text:0045A008 8D 04 85 00 00 00 00 lea eax, ds:0[eax*4]
.text:0045A00F 51 push ecx ; int
.text:0045A010 05 FC 85 97 00 add eax, offset dword_9785FC
.text:0045A015 8D 94 24 1A 01 00 00 lea edx, [esp+21Ch+var_102]
.text:0045A01C 8D 8C 24 D0 01 00 00 lea ecx, [esp+21Ch+var_4C]
.text:0045A023 6A 10 push 10h ; __int16
.text:0045A025 52 push edx ; int
.text:0045A026 6A 01 push 1 ; char
.text:0045A028 FF 74 24 4C push [esp+228h+var_1DC] ; float
.text:0045A02C 51 push ecx ; int
.text:0045A02D 50 push eax ; int
.text:0045A02E 53 push ebx ; int
.text:0045A02F E8 6C C6 07 00 call CWorld::FindObjectsOfTypeInRangeSectorList(uint,CPtrList &,CVector const&,float,bool,short *,short,CEntity **)
.text:0045A034 83 C4 20 add esp, 20h
.text:0045A037
.text:0045A037 loc_45A037: ; CODE XREF: CRunningScript::ProcessCommands900To999(int)+10D9j
.text:0045A037 31 D2 xor edx, edx
.text:0045A039 D9 EE fldz
.text:0045A03B D9 EE fldz
.text:0045A03D D9 EE fldz
.text:0045A03F EB 6D jmp short loc_45A0AE
.text:0045A041 ; ---------------------------------------------------------------------------
.text:0045A041
.text:0045A041 loc_45A041: ; CODE XREF: CRunningScript::ProcessCommands900To999(int)+11FBj
.text:0045A041 0F B7 DA movzx ebx, dx
.text:0045A044 8B 84 9C 18 01 00 00 mov eax, dword ptr [esp+ebx*4+218h+var_102+2]
.text:0045A04B 83 C0 34 add eax, 34h
.text:0045A04E D9 40 08 fld dword ptr [eax+8]
.text:0045A051 D8 A4 24 AC 00 00 00 fsub [esp+218h+var_16C]
.text:0045A058 DD D9 fstp st(1)
.text:0045A05A D9 40 04 fld dword ptr [eax+4]
.text:0045A05D D8 A4 24 94 00 00 00 fsub [esp+218h+var_184]
.text:0045A064 DD DA fstp st(2)
.text:0045A066 D9 00 fld dword ptr [eax]
.text:0045A068 D8 64 24 7C fsub [esp+218h+var_19C]
.text:0045A06C DD DB fstp st(3)
.text:0045A06E D9 C1 fld st(1)
.text:0045A070 D8 C8 fmul st, st
.text:0045A072 D9 C3 fld st(3)
.text:0045A074 D8 C8 fmul st, st
.text:0045A076 DE C1 faddp st(1), st
.text:0045A078 D9 C1 fld st(1)
.text:0045A07A D8 C8 fmul st, st
.text:0045A07C DE C1 faddp st(1), st
.text:0045A07E D9 FA fsqrt
.text:0045A080 D9 9C 24 B8 00 00 00 fstp [esp+218h+var_160]
.text:0045A087 D9 84 24 B8 00 00 00 fld [esp+218h+var_160]
.text:0045A08E DD DB fstp st(3)
.text:0045A090 D9 C2 fld st(2)
.text:0045A092 D8 5C 24 38 fcomp [esp+218h+var_1E0]
.text:0045A096 DF E0 fnstsw ax
.text:0045A098 80 E4 05 and ah, 5
.text:0045A09B 80 FC 01 cmp ah, 1
.text:0045A09E 75 0D jnz short loc_45A0AD
.text:0045A0A0 D9 C2 fld st(2)
.text:0045A0A2 D9 5C 24 38 fstp [esp+218h+var_1E0]
.text:0045A0A6 8B AC 9C 18 01 00 00 mov ebp, dword ptr [esp+ebx*4+218h+var_102+2]
.text:0045A0AD
.text:0045A0AD loc_45A0AD: ; CODE XREF: CRunningScript::ProcessCommands900To999(int)+11DEj
.text:0045A0AD 42 inc edx
.text:0045A0AE
.text:0045A0AE loc_45A0AE: ; CODE XREF: CRunningScript::ProcessCommands900To999(int)+117Fj
.text:0045A0AE 0F BF 8C 24 16 01 00 00 movsx ecx, [esp+218h+var_102]
.text:0045A0B6 0F B7 C2 movzx eax, dx
.text:0045A0B9 39 C8 cmp eax, ecx
.text:0045A0BB 7C 84 jl short loc_45A041
.text:0045A0BD 85 ED test ebp, ebp
.text:0045A0BF 74 1F jz short loc_45A0E0
.text:0045A0C1 DE D9 fcompp
.text:0045A0C3 89 E9 mov ecx, ebp
.text:0045A0C5 56 push esi
.text:0045A0C6 DD D8 fstp st
.text:0045A0C8 E8 E3 DC FA FF call CBuilding::ReplaceWithNewModel(int)
.text:0045A0CD 56 push esi
.text:0045A0CE 57 push edi
.text:0045A0CF 55 push ebp
.text:0045A0D0 E8 BB EC FF FF call CTheScripts::AddToBuildingSwapArray(CBuilding *,int,int)
.text:0045A0D5 83 C4 0C add esp, 0Ch
.text:0045A0D8 EB 15 jmp short loc_45A0EF
.text:0045A0D8 ; ---------------------------------------------------------------------------
.text:0045A0DA 8D 80 00 00 00 00 align 10h
.text:0045A0E0
.text:0045A0E0 loc_45A0E0: ; CODE XREF: CRunningScript::ProcessCommands900To999(int)+11FFj
.text:0045A0E0 DE D9 fcompp
.text:0045A0E2 68 E8 9C 68 00 push offset aFailedToFindBu ; "Failed to find building\n"
.text:0045A0E7 DD D8 fstp st
.text:0045A0E9 E8 12 6F FA FF call _dbgprint
.text:0045A0EE 59 pop ecx
.text:0045A0EF
.text:0045A0EF loc_45A0EF: ; CODE XREF: CRunningScript::ProcessCommands900To999(int)+1218j
.text:0045A0EF 30 C0 xor al, al
.text:0045A0F1 81 C4 08 02 00 00 add esp, 208h
.text:0045A0F7 5D pop ebp
.text:0045A0F8 5F pop edi
.text:0045A0F9 5E pop esi
.text:0045A0FA 5B pop ebx
.text:0045A0FB C2 04 00 retn 4
.text:0045A0FE ; ---------------------------------------------------------------------------
ещё бы знать где он...По-моему, он в той функции, которая вызывается на 0x45A0D0.
Видимо кишки опкода не дают тебе заменять столбы и шлагбаумы, поэтому весь код тебе не нужен, а только функция CEntity::ReplaceWithNewModel(). Во вложении пример замены столбов на светофоры при их первом появлении. Кстати кроме объекта ты можешь там же поменять и его координаты. Заметил, что свойства нового объекта остаются теми же, что были у старого. А как удалять объект полностью с карты, я не знаю.