Nunca mexi com SAMP Funcs, possivelmente o @Nex' entende dele.
Mas um comentário à parte, já estou prevendo que o SAMP Funcs (e todos os mods criados pra ele) será incompatível com CLEO 5... E já estou prevendo que pessoas usando mods que usam SAMP Funcs irão ficar pegando no meu pé pra eu não criar mods em CLEO 5 pois é incompatível com SAMP Funcs... Já é 2017 e o pessoal ainda não aprendeu a se preocupar com compatibilidades.
Mas um comentário à parte, já estou prevendo que o SAMP Funcs (e todos os mods criados pra ele) será incompatível com CLEO 5... E já estou prevendo que pessoas usando mods que usam SAMP Funcs irão ficar pegando no meu pé pra eu não criar mods em CLEO 5 pois é incompatível com SAMP Funcs... Já é 2017 e o pessoal ainda não aprendeu a se preocupar com compatibilidades.
- NexScripter CLEO - Intermediário
- Mensagens : 1240
Reputação : 99
Desde : 04/03/2013
Idade : 20
Nunca usei o SAMPFuncs só dei uma olhada na lista de opcodes .
Sobre a compatibilidade, não sei se pode ter problemas com a chegada da CLEO 5. De qualquer modo, os desenvolvedores criaram um LUA loader com todas as funções da CLEO 4 + SAMPFuncs.
Sobre a compatibilidade, não sei se pode ter problemas com a chegada da CLEO 5. De qualquer modo, os desenvolvedores criaram um LUA loader com todas as funções da CLEO 4 + SAMPFuncs.
- Leonel51Mensagens Nível 1
- Mensagens : 3
Reputação : 0
Desde : 08/05/2017
Nex' escreveu:Nunca usei o SAMPFuncs só dei uma olhada na lista de opcodes .
Sobre a compatibilidade, não sei se pode ter problemas com a chegada da CLEO 5. De qualquer modo, os desenvolvedores criaram um LUA loader com todas as funções da CLEO 4 + SAMPFuncs.
Esse site é muito bom, porém está em Russo, mas nada que um Google Tradutor não resolva.
Obrigado Junior_Djjr e Nex' por tentarem ajudar. Mas acho que tem um outro jeito de fazer, usando Panels, que pra mim considero mais fácil de fazer.
Queria saber porque alguns mods que usam Panels fica bugados no SAMP. Por exemplo:
Como é:
- Spoiler:
Como fica:
- Spoiler:
- ConvidadoConvidado
"Originalmente o SA-MP sobrescreve uma parte do código do jogo onde a Livraria CLEO faria o carregamento dos textos por arquivos .fxt."
- Leonel51Mensagens Nível 1
- Mensagens : 3
Reputação : 0
Desde : 08/05/2017
Caracas, obrigado.Adson Gabryel escreveu:"Originalmente o SA-MP sobrescreve uma parte do código do jogo onde a Livraria CLEO faria o carregamento dos textos por arquivos .fxt."
Agora vai dar para fazer o que eu queria

Nossa, o problema era esse? Nunca passaria pela minha cabeça que a solução fosse tão óbvia.
- DeadstrokeScripter CLEO - Intermediário
- Mensagens : 529
Reputação : 42
Desde : 08/02/2016
Localização : São Paulo
Nex' escreveu:Nunca usei o SAMPFuncs só dei uma olhada na lista de opcodes .
Sobre a compatibilidade, não sei se pode ter problemas com a chegada da CLEO 5. De qualquer modo, os desenvolvedores criaram um LUA loader com todas as funções da CLEO 4 + SAMPFuncs.
Fala onde encontrar isso ae?
E tem o Plugin SDK do DK que auxilia para fazer mods .asi . (Com linguagem C++ acredito).
Agora eu pergunto, já que é o tópico certo para isso: qual é a melhor ferramenta para se fazer mods?
a) CLEO (vide tanto Sanny Builder ou SCM, ou GTA3Script);
b) LUA Loader (esse que eu ouvi falar uma vez ou outra, mas nunca vi um mod feito nele);
c) Plugin SDK do DK.
Acho que pergunto isso quanto ao critério de possibilidades de criação primeiramente e segundamente a facilidade de se fazer.
Por aqui o pessoal só sabe mais cleo até por causa dos tutoriais, mas seria interessante pelo menos ter uma abordagem desses recursos mais avançados.
- NexScripter CLEO - Intermediário
- Mensagens : 1240
Reputação : 99
Desde : 04/03/2013
Idade : 20
http://blast.hk/wiki/moonloader:start@Deadstroke escreveu:Nex' escreveu:Nunca usei o SAMPFuncs só dei uma olhada na lista de opcodes .
Sobre a compatibilidade, não sei se pode ter problemas com a chegada da CLEO 5. De qualquer modo, os desenvolvedores criaram um LUA loader com todas as funções da CLEO 4 + SAMPFuncs.
Fala onde encontrar isso ae?
Nunca testei também...
(Traduzido com o Google Tradutor)blast.hk escreveu:Ele introduz a capacidade de baixar Lua-scripts no jogo e já tem todas as funcionalidades de jogos opcodes, CLEO, bem como plug- SAMPFUNCS .
Até à data, o estágio alpha plug-in, e a maioria das funções não são testados, mas, apesar disso, ele já estava trabalhando muito firmemente.
Você se acha foda em criar mods cleos, daí vê scripts de caras realmente bons, como o Wesser:
(sim, grande part do início é Assembly, mas mesmo o resto. Saporra é super técnica)
edit: A chave do mod é que ele trocou a lista de dummies/nodes dos veículos de tipo "trem" para aceitarem extras (assim como outros dummies de carros), literalmente hackeou o .exe.
- Código:
// Author: Wesser
// Version: v1.0
// Release date: 06/06/2017
// CAVEAT: Enable GTA:SA SCR mode to compile.
{$CLEO}
const
HEAD_BYTES = 0x90909090 // 0 for data (16-byte alignment)
end
// enum eDefaultModel
const
MODEL_TRAM = 449
end
// enum eCompRule
const
COMPRULE_RARE = 0
COMPRULE_CONVERTIBLE = 1
COMPRULE_STRONG = 2
COMPRULE_REQUIRE = 3
COMPRULE_ALL = 4
COMPRULE_RANGE = 5 // Brand new, unofficial rule.
end
const
_CGeneral__GetRandomNumberInRange = 0x00407180 // static int CGeneral::GetRandomNumberInRange(int min, int max)
_CFileMgr__OpenFile = 0x00538900 // static int CFileMgr::OpenFile(const char *pFilename, const char *pAccessMode)
_CFileMgr__ReadLine = 0x005389B0 // static bool CFileMgr::ReadLine(int fileStream, char *pBuffer, int numBytes)
_CFileMgr__CloseFile = 0x005389D0 // static void CFileMgr::CloseFile(int fileStream)
_CVisibilityPlugins__GetFrameHierarchyId = 0x00732A20 // static int CVisibilityPlugins::GetFrameHierarchyId(RwFrame *pFrame)
end
const
_CFileLoader__ms_line = 0x00B71848 // static char CFileLoader::ms_line[512]
end
const
_asc_r = 0x0085A53C // "r"
_asc__x = 0x0086A94C // "%x"
end
goto @script_start
hex
FF
end
:asm_start
/*
RwFrame *CClumpModelInfo::FillFrameArrayWithoutChassisCB(RwFrame *pFrameNode, void *pFrameArray)
{
int hierarchyId = CVisibilityPlugins::GetFrameHierarchyId(pFrameNode) - 1;
if(hierarchyId > 0)
reinterpret_cast<RwFrame **>(pFrameArray)[hierarchyId] = pFrameNode;
RwFrameForAllChildren(pFrameNode, CClumpModelInfo::FillFrameArrayWithoutChassisCB, pFrameArray);
return pFrameNode;
}
*/
:_CClumpModelInfo__FillFrameArrayWithoutChassisCB
hex
56 // 00000000 push esi
8B7424 08 // 00000001 mov esi, [esp+4+pFrameNode]
56 // 00000005 push esi
E8 00000000 // 00000006 call CVisibilityPlugins::GetFrameHierarchyId
83C4 04 // 0000000B add esp, 4
8B4C24 0C // 0000000E mov ecx, [esp+4+pFrameArray]
48 // 00000012 dec eax
85C0 // 00000013 test eax, eax
7E 03 // 00000015 jle for_all_children
893481 // 00000017 mov [ecx+eax*4], esi
// 0000001A for_all_children:
51 // 0000001A push ecx
68 00000000 // 0000001B push offset CClumpModelInfo::FillFrameArrayWithoutChassisCB
56 // 00000020 push esi
E8 00000000 // 00000021 call RwFrameForAllChildren
83C4 0C // 00000026 add esp, 0Ch
8BC6 // 00000029 mov eax, esi
5E // 0000002B pop esi
C3 // 0000002C ret
end
hex
90 90 90
end
/*
void CClumpModelInfo::FillFrameArrayWithoutChassis(RpClump *pClump, RwFrame **pFrameArray)
{
RwFrameForAllChildren(pClump->object.parent, CClumpModelInfo::FillFrameArrayWithoutChassisCB, (void *)pFrameArray);
}
*/
:_CClumpModelInfo__FillFrameArrayWithoutChassis
hex
8B4424 08 // 00000000 mov eax, [esp+pFrameArray]
50 // 00000004 push eax
68 00000000 // 00000005 push offset CClumpModelInfo::FillFrameArrayWithoutChassisCB
8B4C24 0C // 0000000A mov ecx, [esp+8+pClump]
8B51 04 // 0000000E mov edx, [ecx+RpClump.object.parent]
52 // 00000011 push edx
E8 00000000 // 00000012 call RwFrameForAllChildren
83C4 0C // 00000017 add esp, 0Ch
C3 // 0000001A ret
end
hex
90 90 90 90 90
end
/*
int CGeneral::GetSerialNumberInRange(int min, int max)
{
if(gSerialNumber >= min && gSerialNumber < max - 1)
return ++gSerialNumber;
return gSerialNumber = min;
}
*//*
:_CGeneral__GetSerialNumberInRange
hex
A1 00000000 // 00000000 mov eax, gSerialNumber
8B4C24 04 // 00000005 mov ecx, [esp+min]
3BC1 // 00000009 cmp eax, ecx
7C 0D // 0000000B jl reinit_sn
40 // 0000000D inc eax
394424 08 // 0000000E cmp [esp+max], eax
7E 06 // 00000012 jle reinit_sn
A3 00000000 // 00000014 mov gSerialNumber, eax
C3 // 00000019 ret
// 0000001A reinit_sn:
890D 00000000 // 0000001A mov gSerialNumber, ecx
8BC1 // 00000020 mov eax, ecx
C3 // 00000022 ret
end
hex
90 90 90 90 90 90 90 90 90 90 90 90 90
end*/
/*
if(Rule != COMPRULE_RANGE)
goto exclude_three_comps;
if((unsigned char)Comps == 0xFF)
{
int rangeStart = Comps & 0x0F;
int rangeEnd = (Comps >> 4) & 0x0F;
if(rangeStart == 0x0F) rangeStart = 0;
if(rangeEnd == 0x0F) rangeEnd = 0;
if(rangeStart != rangeEnd)
{
int rangeStep = (rangeStart < rangeEnd) * 2 - 1;
do
pComponentList[rangeStart] = 0x0F;
while(rangeStart += rangeStep, rangeStart != rangeEnd);
}
pComponentList[rangeEnd] = 0x0F;
}
goto comprule_check_end;
*/
:_HOOK_4C7EC4_GetListOfComponentsNotUsedByRules
hex
83F9 04 // 00000000 cmp ecx, COMPRULE_ALL
0F84 00000000 // 00000003 je GetListOfComponentsNotUsedByRules+79h
83F9 05 // 00000009 cmp ecx, COMPRULE_RANGE
0F85 00000000 // 0000000C jne GetListOfComponentsNotUsedByRules+83h
80FA FF // 00000012 cmp dl, 0FFh
0F84 00000000 // 00000015 je GetListOfComponentsNotUsedByRules+0ADh
8BF2 // 0000001B mov esi, edx
23F5 // 0000001D and esi, ebp
0FB6CA // 0000001F movzx ecx, dl
C1E9 04 // 00000022 shr ecx, 4
3BF5 // 00000025 cmp esi, ebp
0F44F0 // 00000027 cmove esi, eax
3BCD // 0000002A cmp ecx, ebp
0F44C8 // 0000002C cmove ecx, eax
3BF1 // 0000002F cmp esi, ecx
74 19 // 00000031 je exclude_last_comp
83D0 00 // 00000033 adc eax, 0
8D0445 FFFFFFFF // 00000036 lea eax, [eax*2-1]
0F 1F 00 // 0000003D align 16
// 00000040 exclude_nth_comp:
896CB4 10 // 00000040 mov [esp+esi*4+28h-18h], ebp
03F0 // 00000044 add esi, eax
3BF1 // 00000046 cmp esi, ecx
75 F6 // 00000048 jne exclude_nth_comp
33C0 // 0000004A xor eax, eax
// 0000004C exclude_last_comp:
896C8C 10 // 0000004C mov [esp+ecx*4+28h-18h], ebp
E9 00000000 // 00000050 jmp GetListOfComponentsNotUsedByRules+0ADh
end
hex
90 90 90 90 90 90 90 90 90 90 90
end
:_HOOK_4C7F23_GetListOfComponentsNotUsedByRules
hex
83F9 05 // 00000000 cmp ecx, COMPRULE_RANGE
75 4E // 00000003 jne exclude_three_comps
C1EA 10 // 00000005 shr edx, 16
80FA FF // 00000008 cmp dl, 0FFh
0F84 00000000 // 0000000B je GetListOfComponentsNotUsedByRules+0FEh
8BF2 // 00000011 mov esi, edx
23F5 // 00000013 and esi, ebp
0FB6CA // 00000015 movzx ecx, dl
C1E9 04 // 00000018 shr ecx, 4
3BF5 // 0000001B cmp esi, ebp
0F44F0 // 0000001D cmove esi, eax
3BCD // 00000020 cmp ecx, ebp
0F44C8 // 00000022 cmove ecx, eax
3BF1 // 00000025 cmp esi, ecx
74 21 // 00000027 je exclude_last_comp
33D2 // 00000029 xor edx, edx
0F9CC2 // 0000002B setl dl
8D1455 FFFFFFFF // 0000002E lea edx, [edx*2-1]
66 66 66 // 00000035 align 16
0F 1F 84 00 // 00000038 ...
00 00 00 00 // 0000003C ...
// 00000040 exclude_nth_comp:
896CB4 10 // 00000040 mov [esp+esi*4+28h-18h], ebp
03F2 // 00000044 add esi, edx
3BF1 // 00000046 cmp esi, ecx
75 F6 // 00000048 jne exclude_nth_comp
// 0000004A exclude_last_comp:
896C8C 10 // 0000004A mov [esp+ecx*4+28h-18h], ebp
E9 00000000 // 0000004E jmp GetListOfComponentsNotUsedByRules+0FEh
// 00000053 exclude_three_comps:
8BCA // 00000053 mov ecx, edx
C1E9 10 // 00000055 shr ecx, 16
E9 00000000 // 00000058 jmp GetListOfComponentsNotUsedByRules+0D8h
end
hex
90 90 90
end
// Comprules field (Tram): 5003
/*
case COMPRULE_RANGE:
if((unsigned char)Comps == 0xFF)
return -1;
int rangeStart = Comps & 0x0F;
int rangeEnd = (Comps >> 4) & 0x0F;
if(rangeStart == 0x0F)
return CGeneral::GetRandomNumberInRange(-1, rangeEnd + 1);
if(rangeEnd == 0x0F)
return CGeneral::GetRandomNumberInRange(-1, rangeStart + 1);
int rangeMin = min(rangeStart, rangeEnd);
int rangeMax = max(rangeStart, rangeEnd) + 1;
if(((Comps >> 8) & 0x0F) == 0x0F)
{
int chosenIndex = CGeneral::GetRandomNumberInRange(-1, rangeMax - rangeMin);
return chosenIndex >= 0 ? rangeMin + chosenIndex : chosenIndex;
}
return CGeneral::GetRandomNumberInRange(rangeMin, rangeMax);
*/
:_HOOK_4C802C_ChooseComponent_case_5
hex
8B4C24 0C // 00000000 mov ecx, [esp+4+Comps]
80F9 FF // 00000004 cmp cl, 0FFh
0F84 00000000 // 00000007 je ChooseComponent+75h
8BC1 // 0000000D mov eax, ecx
83E0 0F // 0000000F and eax, 0Fh
0FB6D1 // 00000012 movzx edx, cl
C1EA 04 // 00000015 shr edx, 4
83F8 0F // 00000018 cmp eax, 0Fh
75 13 // 0000001B jne check_range_end
42 // 0000001D inc edx
5E // 0000001E pop esi
895424 08 // 0000001F mov [esp+8], edx
C74424 04 FFFFFFFF // 00000023 mov dword ptr [esp+4], -1
E9 00000000 // 0000002B jmp CGeneral::GetRandomNumberInRange
// 00000030 check_range_end:
83FA 0F // 00000030 cmp edx, 0Fh
75 13 // 00000033 jne choose_in_range
40 // 00000035 inc eax
5E // 00000036 pop esi
894424 08 // 00000037 mov [esp+8], eax
C74424 04 FFFFFFFF // 0000003B mov dword ptr [esp+4], -1
E9 00000000 // 00000043 jmp CGeneral::GetRandomNumberInRange
// 00000048 choose_in_range:
8BF0 // 00000048 mov esi, eax
3BD0 // 0000004A cmp edx, eax
0F47C2 // 0000004C cmova eax, edx
0F42F2 // 0000004F cmovb esi, edx
40 // 00000052 inc eax
80E5 0F // 00000053 and ch, 0Fh
80FD 0F // 00000056 cmp ch, 0Fh
75 15 // 00000059 jne choose_from_zero
2BC6 // 0000005B sub eax, esi
50 // 0000005D push eax
6A FF // 0000005E push -1
E8 00000000 // 00000060 call CGeneral::GetRandomNumberInRange
83C4 08 // 00000065 add esp, 8
85C0 // 00000068 test eax, eax
78 0E // 0000006A js epilogue
03C6 // 0000006C add eax, esi
5E // 0000006E pop esi
C3 // 0000006F ret
// 00000070 choose_from_zero:
50 // 00000070 push eax
56 // 00000071 push esi
E8 00000000 // 00000072 call CGeneral::GetRandomNumberInRange
83C4 08 // 00000077 add esp, 8
// 0000007A epilogue:
5E // 0000007A pop esi
C3 // 0000007B ret
end
hex
90 90 90 90
end
:_HOOK_4C96A6_CVehicleModelInfo__CreateInstance
hex
83F8 06 // 00000000 cmp eax, VEHICLE_TRAIN
0F84 00000000 // 00000003 je CVehicleModelInfo::CreateInstance+35h
83F8 09 // 00000009 cmp eax, VEHICLE_BIKE
0F84 00000000 // 0000000C je CVehicleModelInfo::CreateInstance+35h
E9 00000000 // 00000012 jmp CVehicleModelInfo::CreateInstance+2Bh
end
hex
90 90 90 90 90 90 90 90 90
end
:_HOOK_4C969D_CVehicleModelInfo__CreateInstance
hex
66C705 58648A00 FEFE // 00000000 mov word ptr CVehicleModelInfo::ms_compsToUse, 0FEFEh
66C705 78E4B400 FFFF // 00000009 mov word ptr CVehicleModelInfo::ms_compsUsed, 0FFFFh
E9 00000000 // 00000012 jmp CVehicleModelInfo::CreateInstance+13Fh
end
hex
90 90 90 90 90 90 90 90 90
end
:_HOOK_6F762D_CTrain__CreateMissionTrain
hex
8B0E // 00000000 mov ecx, [esi]
85FF // 00000002 test edi, edi
74 1C // 00000004 jz create_carriage
81F9 C1010000 // 00000006 cmp ecx, MODEL_TRAM
75 14 // 0000000C jne create_carriage
66394F 22 // 0000000E cmp [edi+CTrain.m_modelIndex], cx
75 0E // 00000012 jne create_carriage
668BB7 38040000 // 00000014 mov si, word ptr [edi+CTrain.m_compsInUse]
668935 58648A00 // 0000001B mov word ptr CVehicleModelInfo::ms_compsToUse, si
// 00000022 create_carriage:
6A 04 // 00000022 push PERMANENT_VEHICLE
51 // 00000024 push ecx
E9 00000000 // 00000025 jmp CTrain::CreateMissionTrain+0E2h
end
hex
90 90 90 90 90 90
end
/*
RwObjectNameIdAssocation CVehicleModelInfo::ms_vehicleDescs_Train[] =
{
{ "chassis", 1, 0 },
{ "door_lf_dummy", 2, 0x22 },
{ "door_rf_dummy", 3, 0x42 },
{ "wheel_rf1_dummy", 4, 0x00010040 },
{ "wheel_rf2_dummy", 5, 0x44 },
{ "wheel_rf3_dummy", 6, 0x44 },
{ "wheel_rb1_dummy", 7, 0x44 },
{ "wheel_rb2_dummy", 8, 0x44 },
{ "wheel_rb3_dummy", 9, 0x44 },
{ "wheel_lf1_dummy", 10, 0x24 },
{ "wheel_lf2_dummy", 11, 0x24 },
{ "wheel_lf3_dummy", 12, 0x24 },
{ "wheel_lb1_dummy", 13, 0x24 },
{ "wheel_lb2_dummy", 14, 0x24 },
{ "wheel_lb3_dummy", 15, 0x24 },
{ "bogie_front", 16, 0x00100000 },
{ "bogie_rear", 17, 0x00200000 },
{ "ped_frontseat", 4, 9 },
{ "ped_backseat", 5, 9 },
{ "headlights", 0, 9 },
{ "taillights", 1, 9 },
{ "headlights2", 2, 9 },
{ "taillights2", 3, 9 },
{ "exhaust", 6, 9 },
{ "engine", 7, 9 },
{ "ped_left_entry", 9, 0x19 },
{ "ped_mid_entry", 10, 0x19 },
{ "ped_right_entry", 11, 0x19 },
{ "extra1", 0, 0x0601 },
{ "extra2", 0, 0x0601 },
{ "extra3", 0, 0x0601 },
{ "extra4", 0, 0x0601 },
{ "extra5", 0, 0x0601 },
{ "extra6", 0, 0x0601 },
{ "\0", 0, 0 }
};
*/
:_CVehicleModelInfo__ms_vehicleDescs_Train
hex
ACC58500 01000000 00000000 // chassis
1CC58500 02000000 22000000 // door_lf_dummy
3CC58500 03000000 42000000 // door_rf_dummy
88C08500 04000000 40000100 // wheel_rf1_dummy
78C08500 05000000 44000000 // wheel_rf2_dummy
68C08500 06000000 44000000 // wheel_rf3_dummy
58C08500 07000000 44000000 // wheel_rb1_dummy
48C08500 08000000 44000000 // wheel_rb2_dummy
38C08500 09000000 44000000 // wheel_rb3_dummy
28C08500 0A000000 24000000 // wheel_lf1_dummy
18C08500 0B000000 24000000 // wheel_lf2_dummy
08C08500 0C000000 24000000 // wheel_lf3_dummy
F8BF8500 0D000000 24000000 // wheel_lb1_dummy
E8BF8500 0E000000 24000000 // wheel_lb2_dummy
D8BF8500 0F000000 24000000 // wheel_lb3_dummy
CCBF8500 10000000 00001000 // bogie_front
C0BF8500 11000000 00002000 // bogie_rear
54C48500 04000000 09000000 // ped_frontseat
44C48500 05000000 09000000 // ped_backseat
38C48500 00000000 09000000 // headlights
2CC48500 01000000 09000000 // taillights
20C48500 02000000 09000000 // headlights2
14C48500 03000000 09000000 // taillights2
0CC48500 06000000 09000000 // exhaust
04C48500 07000000 09000000 // engine
B0BF8500 09000000 19000000 // ped_left_entry
A0BF8500 0A000000 19000000 // ped_mid_entry
90BF8500 0B000000 19000000 // ped_right_entry
B0C38500 00000000 01060000 // extra1 (Tram sign: Calton Heights)
A8C38500 00000000 01060000 // extra2 (Tram sign: Chinatown)
A0C38500 00000000 01060000 // extra3 (Tram sign: Downtown)
98C38500 00000000 01060000 // extra4 (Tram sign: Garcia)
90C38500 00000000 01060000 // extra5
88C38500 00000000 01060000 // extra6
00000000 00000000 00000000
end
/*
int gSerialNumber;
*//*
:_gSerialNumber
hex
00000000
end*/
:asm_end
hex
00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00
end
:_asc_cleo_tramxtra_dat
hex
"cleo\\tramxtra.dat" 00 00 00
end
:script_start
// Guarantee a 16-byte alignment of assembly code.
0A9F: get_this_script_struct 0@
0A8E: 8@ = 0@ + 0x10 // CRunningScript.m_pStartAddress
0A8D: read_process_memory 8@ size 4 vp FALSE store_to 1@
0A8E: 9@ = 1@ + 7
0A8D: read_process_memory 9@ size 1 vp FALSE store_to 2@
if
2@ >= 16
then
0A8F: 3@ = 1@ - @asm_start
0A91: 2@ = 3@ / 16
2@ *= 16
0A8F: 2@ = 3@ - 2@
if
2@ <> 0
then
0A8F: 2@ = 16 - 2@
0A8D: read_process_memory 0x004F2F41 size 4 vp TRUE store_to 6@
6@ += 0x004F2F45 // memmove
0A8E: 4@ = 3@ + 2@
0A8F: 5@ = 1@ - @asm_end
0062: 5@ -= 3@
0AA5: call_function 6@ push 3 pop 3 count 5@ src 3@ dest 4@
0A8D: read_process_memory 0x0072F46B size 4 vp TRUE store_to 6@
6@ += 0x0072F4DD // 0x0072F46F + 0x6E
0A8D: read_process_memory 6@ size 4 vp TRUE store_to 7@
6@ += 4
005A: 7@ += 6@ // memset
0AA5: call_function 7@ push 3 pop 3 count 2@ c HEAD_BYTES dest 3@
end
0A8C: write_process_memory 9@ size 1 value 2@ vp FALSE
end
const
_RwFrameForAllChildren = 6@ // 007F0DC0 RwFrame *RwFrameForAllChildren(RwFrame *frame, RwFrameCallBack callBack, void *data)
_sscanf = 7@ // 008220AD int sscanf(const char *s, const char *format, ...)
end
const
_CClumpModelInfo__FillFrameArrayWithoutChassisCB = 8@ // static RwFrame *CClumpModelInfo::FillFrameArrayWithoutChassisCB(RwFrame *pFrameNode, void *pFrameArray)
_CClumpModelInfo__FillFrameArrayWithoutChassis = 9@ // static void CClumpModelInfo::FillFrameArrayWithoutChassis(RpClump *pClump, RwFrame **pFrameArray)
// _CGeneral__GetSerialNumberInRange = 10@ // static int CGeneral::GetSerialNumberInRange(int min, int max)
end
const
_CVehicleModelInfo__ms_vehicleDescs_Train = 11@ // static RwObjectNameIdAssocation CVehicleModelInfo::ms_vehicleDescs_Train[35]
// _gSerialNumber = 12@ // int gSerialNumber
end
const
_HOOK_4C7EC4_GetListOfComponentsNotUsedByRules = 13@
_HOOK_4C7F23_GetListOfComponentsNotUsedByRules = 14@
_HOOK_4C802C_ChooseComponent_case_5 = 15@
_HOOK_4C96A6_CVehicleModelInfo__CreateInstance = 16@
_HOOK_4C969D_CVehicleModelInfo__CreateInstance = 17@
_HOOK_6F762D_CTrain__CreateMissionTrain = 18@
end
const
_asc_cleo_tramxtra_dat = 19@
end
0A8E: 3@ = 1@ + 2@
0A8D: read_process_memory 0x004C53B1 size 4 vp TRUE store_to _RwFrameForAllChildren
_RwFrameForAllChildren += 0x004C53B5
0A8D: read_process_memory 0x005BE3E0 size 4 vp TRUE store_to _sscanf
_sscanf += 0x005BE3E4
0A8F: _CClumpModelInfo__FillFrameArrayWithoutChassisCB = 3@ - @_CClumpModelInfo__FillFrameArrayWithoutChassisCB
0A8F: _CClumpModelInfo__FillFrameArrayWithoutChassis = 3@ - @_CClumpModelInfo__FillFrameArrayWithoutChassis
//0A8F: _CGeneral__GetSerialNumberInRange = 3@ - @_CGeneral__GetSerialNumberInRange
0A8F: _CVehicleModelInfo__ms_vehicleDescs_Train = 3@ - @_CVehicleModelInfo__ms_vehicleDescs_Train
//0A8F: _gSerialNumber = 3@ - @_gSerialNumber
0A8F: _HOOK_4C7EC4_GetListOfComponentsNotUsedByRules = 3@ - @_HOOK_4C7EC4_GetListOfComponentsNotUsedByRules
0A8F: _HOOK_4C7F23_GetListOfComponentsNotUsedByRules = 3@ - @_HOOK_4C7F23_GetListOfComponentsNotUsedByRules
0A8F: _HOOK_4C802C_ChooseComponent_case_5 = 3@ - @_HOOK_4C802C_ChooseComponent_case_5
0A8F: _HOOK_4C96A6_CVehicleModelInfo__CreateInstance = 3@ - @_HOOK_4C96A6_CVehicleModelInfo__CreateInstance
0A8F: _HOOK_4C969D_CVehicleModelInfo__CreateInstance = 3@ - @_HOOK_4C969D_CVehicleModelInfo__CreateInstance
0A8F: _HOOK_6F762D_CTrain__CreateMissionTrain = 3@ - @_HOOK_6F762D_CTrain__CreateMissionTrain
0A8F: _asc_cleo_tramxtra_dat = 3@ - @_asc_cleo_tramxtra_dat
0A8F: 20@ = _RwFrameForAllChildren - 4
0A8F: 21@ = _CGeneral__GetRandomNumberInRange - 4
//0A8F: 21@ = _CGeneral__GetSerialNumberInRange - 4
//0A8C: write_process_memory 0x006F7984 size 2 value 0x9066 vp TRUE
//0A8C: write_process_memory _gSerialNumber size 4 value -2 vp FALSE
0A8E: 4@ = _CClumpModelInfo__FillFrameArrayWithoutChassisCB + 7
0A8E: 5@ = 4@ + 4
0A8F: 6@ = _CVisibilityPlugins__GetFrameHierarchyId - 5@
0A8C: write_process_memory 4@ size 4 value 6@ vp FALSE
0A8E: 4@ = _CClumpModelInfo__FillFrameArrayWithoutChassisCB + 0x1C
0A8C: write_process_memory 4@ size 4 value _CClumpModelInfo__FillFrameArrayWithoutChassisCB vp FALSE
0A8E: 4@ = _CClumpModelInfo__FillFrameArrayWithoutChassisCB + 0x22
0A8F: 5@ = 20@ - 4@
0A8C: write_process_memory 4@ size 4 value 5@ vp FALSE
0A8F: 4@ = _CClumpModelInfo__FillFrameArrayWithoutChassis - 0x006F5559
0A8C: write_process_memory 0x006F5555 size 4 value 4@ vp TRUE
0A8F: 4@ = _CClumpModelInfo__FillFrameArrayWithoutChassis - 0x006F60D6
0A8C: write_process_memory 0x006F60D2 size 4 value 4@ vp TRUE
0A8E: 4@ = _CClumpModelInfo__FillFrameArrayWithoutChassis + 6
0A8C: write_process_memory 4@ size 4 value _CClumpModelInfo__FillFrameArrayWithoutChassisCB vp FALSE
0A8E: 4@ = _CClumpModelInfo__FillFrameArrayWithoutChassis + 0x13
0A8F: 5@ = 20@ - 4@
0A8C: write_process_memory 4@ size 4 value 5@ vp FALSE
/*
0A8E: 4@ = _CGeneral__GetSerialNumberInRange + 1
0A8C: write_process_memory 4@ size 4 value _gSerialNumber vp FALSE
0A8E: 4@ = _CGeneral__GetSerialNumberInRange + 0x15
0A8C: write_process_memory 4@ size 4 value _gSerialNumber vp FALSE
0A8E: 4@ = _CGeneral__GetSerialNumberInRange + 0x1C
0A8C: write_process_memory 4@ size 4 value _gSerialNumber vp FALSE
*/
0A8C: write_process_memory 0x004C7EA5 size 4 value 0xF9839066 vp TRUE
0A8F: 4@ = _HOOK_4C7EC4_GetListOfComponentsNotUsedByRules - 0x004C7EC9
0A8C: write_process_memory 0x004C7EC4 size 1 value 0xE9 vp TRUE
0A8C: write_process_memory 0x004C7EC5 size 4 value 4@ vp TRUE
0A8E: 4@ = _HOOK_4C7EC4_GetListOfComponentsNotUsedByRules + 5
0A8F: 5@ = 0x004C7EC5 - 4@
0A8C: write_process_memory 4@ size 4 value 5@ vp FALSE
0A8E: 4@ = _HOOK_4C7EC4_GetListOfComponentsNotUsedByRules + 0x0E
0A8F: 5@ = 0x004C7ECF - 4@
0A8C: write_process_memory 4@ size 4 value 5@ vp FALSE
0A8E: 4@ = _HOOK_4C7EC4_GetListOfComponentsNotUsedByRules + 0x17
0A8F: 5@ = 0x004C7EF9 - 4@
0A8C: write_process_memory 4@ size 4 value 5@ vp FALSE
0A8E: 4@ = _HOOK_4C7EC4_GetListOfComponentsNotUsedByRules + 0x51
0A8F: 5@ = 0x004C7EF9 - 4@
0A8C: write_process_memory 4@ size 4 value 5@ vp FALSE
0A8C: write_process_memory 0x004C7F07 size 1 value 0xF9 vp TRUE
0A8F: 4@ = _HOOK_4C7F23_GetListOfComponentsNotUsedByRules - 0x004C7F28
0A8C: write_process_memory 0x004C7F23 size 1 value 0xE9 vp TRUE
0A8C: write_process_memory 0x004C7F24 size 4 value 4@ vp TRUE
0A8E: 4@ = _HOOK_4C7F23_GetListOfComponentsNotUsedByRules + 0x0D
0A8F: 5@ = 0x004C7F4A - 4@
0A8C: write_process_memory 4@ size 4 value 5@ vp FALSE
0A8E: 4@ = _HOOK_4C7F23_GetListOfComponentsNotUsedByRules + 0x4F
0A8F: 5@ = 0x004C7F4A - 4@
0A8C: write_process_memory 4@ size 4 value 5@ vp FALSE
0A8E: 4@ = _HOOK_4C7F23_GetListOfComponentsNotUsedByRules + 0x59
0A8F: 5@ = 0x004C7F24 - 4@
0A8C: write_process_memory 4@ size 4 value 5@ vp FALSE
0A8C: write_process_memory 0x004C7FB7 size 1 value 4 vp TRUE
0A8C: write_process_memory 0x004C8014 size 4 value 6 vp TRUE
0A8C: write_process_memory 0x004C803C size 4 value _HOOK_4C802C_ChooseComponent_case_5 vp TRUE
0A8E: 4@ = _HOOK_4C802C_ChooseComponent_case_5 + 9
0A8F: 5@ = 0x004C8021 - 4@
0A8C: write_process_memory 4@ size 4 value 5@ vp FALSE
0A8E: 4@ = _HOOK_4C802C_ChooseComponent_case_5 + 0x2C
0A8F: 5@ = 21@ - 4@
0A8C: write_process_memory 4@ size 4 value 5@ vp FALSE
0A8E: 4@ = _HOOK_4C802C_ChooseComponent_case_5 + 0x44
0A8F: 5@ = 21@ - 4@
0A8C: write_process_memory 4@ size 4 value 5@ vp FALSE
0A8E: 4@ = _HOOK_4C802C_ChooseComponent_case_5 + 0x61
0A8F: 5@ = 21@ - 4@
0A8C: write_process_memory 4@ size 4 value 5@ vp FALSE
0A8E: 4@ = _HOOK_4C802C_ChooseComponent_case_5 + 0x73
0A8F: 5@ = 21@ - 4@
0A8C: write_process_memory 4@ size 4 value 5@ vp FALSE
0A8F: 4@ = _HOOK_4C96A6_CVehicleModelInfo__CreateInstance - 0x004C96AB
0A8C: write_process_memory 0x004C96A6 size 1 value 0xE9 vp TRUE
0A8C: write_process_memory 0x004C96A7 size 4 value 4@ vp TRUE
0A8E: 4@ = _HOOK_4C96A6_CVehicleModelInfo__CreateInstance + 5
0A8F: 5@ = 0x004C96B1 - 4@
0A8C: write_process_memory 4@ size 4 value 5@ vp FALSE
0A8E: 4@ = _HOOK_4C96A6_CVehicleModelInfo__CreateInstance + 0x0E
0A8F: 5@ = 0x004C96B1 - 4@
0A8C: write_process_memory 4@ size 4 value 5@ vp FALSE
0A8E: 4@ = _HOOK_4C96A6_CVehicleModelInfo__CreateInstance + 0x13
0A8F: 5@ = 0x004C96A7 - 4@
0A8C: write_process_memory 4@ size 4 value 5@ vp FALSE
0A8F: 4@ = _HOOK_4C969D_CVehicleModelInfo__CreateInstance - 0x004C96A3
0A8C: write_process_memory 0x004C969F size 4 value 4@ vp TRUE
0A8E: 4@ = _HOOK_4C969D_CVehicleModelInfo__CreateInstance + 0x13
0A8F: 5@ = 0x004C97BB - 4@
0A8C: write_process_memory 4@ size 4 value 5@ vp FALSE
0A8F: 4@ = _HOOK_6F762D_CTrain__CreateMissionTrain - 0x006F7632
0A8C: write_process_memory 0x006F762D size 1 value 0xE9 vp TRUE
0A8C: write_process_memory 0x006F762E size 4 value 4@ vp TRUE
0A8E: 4@ = _HOOK_6F762D_CTrain__CreateMissionTrain + 0x26
0A8F: 5@ = 0x006F762E - 4@
0A8C: write_process_memory 4@ size 4 value 5@ vp FALSE
0A8C: write_process_memory 0x008A7758 size 4 value _CVehicleModelInfo__ms_vehicleDescs_Train vp FALSE
0A99: set_current_directory 0
0AA7: call_function_ret _CFileMgr__OpenFile push 2 pop 2 pAccessMode _asc_r pFilename _asc_cleo_tramxtra_dat fileStream 22@
if
22@ <> 0
then
0AA5: call_function _CFileMgr__ReadLine push 3 pop 3 numBytes 9 pBuffer _CFileLoader__ms_line fileStream 22@
0A8E: 23@ = _CFileLoader__ms_line + 8
0A8C: write_process_memory 23@ size 1 value 0 vp FALSE
0A8E: 24@ = 0@ + 0xA4 // CRunningScript.m_aLocalVars[26]
0AA7: call_function_ret _sscanf push 3 pop 3 va_args 24@ format _asc__x s _CFileLoader__ms_line count 25@
if
25@ == 1
then
0A8C: write_process_memory 0x00B28B30 size 4 value 26@ vp FALSE // CModelInfo::ms_vehicleModels.m_modelInfos[MODEL_TRAM - 400].m_comprules
end
0AA5: call_function _CFileMgr__CloseFile push 1 pop 1 fileStream 22@
end
0A93: terminate_this_custom_script
(sim, grande part do início é Assembly, mas mesmo o resto. Saporra é super técnica)
edit: A chave do mod é que ele trocou a lista de dummies/nodes dos veículos de tipo "trem" para aceitarem extras (assim como outros dummies de carros), literalmente hackeou o .exe.
Dica para aprender umas coisas fodas:
https://sannybuilder.com/forums/search.php?action=show_user_posts&user_id=1624

edit: o fórum do Sanny Builder é o paraíso.
Pra quem quiser fazer uns mods mais avançados pro GTA III (quem?):
https://translate.googleusercontent.com/translate_c?depth=1&hl=pt-BR&ie=UTF8&prev=_t&rurl=translate.google.com&sl=auto&sp=nmt4&tl=en&u=https://sannybuilder.com/forums/viewtopic.php%3Fpid%3D27225&usg=ALkJrhg45MPki8_OG075K_VETAIRFTbpkQ#p27225
https://sannybuilder.com/forums/search.php?action=show_user_posts&user_id=1624

edit: o fórum do Sanny Builder é o paraíso.
Pra quem quiser fazer uns mods mais avançados pro GTA III (quem?):
https://translate.googleusercontent.com/translate_c?depth=1&hl=pt-BR&ie=UTF8&prev=_t&rurl=translate.google.com&sl=auto&sp=nmt4&tl=en&u=https://sannybuilder.com/forums/viewtopic.php%3Fpid%3D27225&usg=ALkJrhg45MPki8_OG075K_VETAIRFTbpkQ#p27225
- Matheus RivaldoScripter CLEO - Básico
- Mensagens : 981
Reputação : 36
Desde : 13/08/2015
Idade : 16
Localização : Passo de Torres - SC
- ThelostProgramador - Avançado
- Mensagens : 10180
Reputação : 265
Desde : 08/11/2012
Odeio russo. Eu devia aprender.
Abrindo mods dos outros para aprender.@Matheus Rivaldo escreveu:Eu não sei da onde as pessoas tiram essas ideias.
Um erro leva ao outro... que leva ao ponto... virou um vírus de desinformação que contamina os mais fracos.
Eu também já fui um desses caras. Na minha época não existia tutorial de CLEO em português (bem, tinha o do EdUaRdO :) ), e basicamente o único que existia era do Zaz, que é absurdamente escroto, não recomendo pra ninguém (ele ensina em low level!!!!). Até hoje os gringos aprendem com ele ou com os vídeos da Dutchy...
Preciso muito traduzir meus tutorias para o inglês.
Sem querer caí no tópico onde se iniciou a CLEO 4
https://sannybuilder.com/forums/viewtopic.php?id=679
Hoje fazer a mesma coisa se tornou uma coisa tão absurdamente fácil (veja só o plugin-sdk, você faz uma CLEO 5 facinho) que se você fizer isso hoje e postar lá, mesmo que de modo MUITO melhor, vão te ignorar como um noobão.
https://sannybuilder.com/forums/viewtopic.php?id=679
Hoje fazer a mesma coisa se tornou uma coisa tão absurdamente fácil (veja só o plugin-sdk, você faz uma CLEO 5 facinho) que se você fizer isso hoje e postar lá, mesmo que de modo MUITO melhor, vão te ignorar como um noobão.
Permissão deste fórum:
Você não pode responder aos tópicos neste fórum
|
|