Acest tutorial iti arata cum sa faci codul din PlayerSettingModule.py mult mai clar si mai usor de inteles, folosind constante cu nume explicite in loc de cifre puse direct in RegisterEffect. Este un mic upgrade de organizare foarte util pentru sursele Metin2, mai ales daca lucrezi cu efecte pentru arme, armuri si Lycan.
Avantajul principal este ca vei sti imediat ce efect apartine fiecarei arme sau armuri, fara sa mai stai sa cauti ce inseamna fiecare numar din PlayerSettingModule.
*Poze / Video:
*Link download / Code:
Deschide PythonCharacterManagerModule.cpp si cauta finalul fisierului sau zona unde se adauga constantele in python:
Code:
PyModule_AddIntConstant(poModule, "EFFECT_REFINED", CInstanceBase::EFFECT_REFINED);
Deschide PlayerSettingModule.py si cauta:
Code:
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+1, "PART_WEAPON", "D:/ymir work/pc/common/effect/sword/sword_7.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+2, "PART_WEAPON", "D:/ymir work/pc/common/effect/sword/sword_8.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+3, "PART_WEAPON", "D:/ymir work/pc/common/effect/sword/sword_9.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+4, "PART_WEAPON_LEFT", "D:/ymir work/pc/common/effect/sword/sword_7_b.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+5, "PART_WEAPON_LEFT", "D:/ymir work/pc/common/effect/sword/sword_8_b.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+6, "PART_WEAPON_LEFT", "D:/ymir work/pc/common/effect/sword/sword_9_b.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+7, "PART_WEAPON", "D:/ymir work/pc/common/effect/sword/sword_7_f.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+8, "PART_WEAPON", "D:/ymir work/pc/common/effect/sword/sword_8_f.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+9, "PART_WEAPON", "D:/ymir work/pc/common/effect/sword/sword_9_f.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+10, "PART_WEAPON", "D:/ymir work/pc/common/effect/sword/sword_7_s.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+11, "PART_WEAPON", "D:/ymir work/pc/common/effect/sword/sword_8_s.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+12, "PART_WEAPON", "D:/ymir work/pc/common/effect/sword/sword_9_s.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+13, "PART_WEAPON_LEFT", "D:/ymir work/pc/common/effect/sword/sword_7_s.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+14, "PART_WEAPON_LEFT", "D:/ymir work/pc/common/effect/sword/sword_8_s.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+15, "PART_WEAPON_LEFT", "D:/ymir work/pc/common/effect/sword/sword_9_s.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+16, "Bip01", "D:/ymir work/pc/common/effect/armor/armor_7.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+17, "Bip01", "D:/ymir work/pc/common/effect/armor/armor_8.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+18, "Bip01", "D:/ymir work/pc/common/effect/armor/armor_9.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+19, "Bip01", "D:/ymir work/pc/common/effect/armor/armor-4-2-1.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+20, "Bip01", "D:/ymir work/pc/common/effect/armor/armor-4-2-2.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+21, "Bip01", "D:/ymir work/pc/common/effect/armor/armor-5-1.mse")
if app.ENABLE_WOLFMAN:
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+22, "PART_WEAPON", "D:/ymir work/pc/common/effect/sword/sword_7_f.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+23, "PART_WEAPON", "D:/ymir work/pc/common/effect/sword/sword_8_f.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+24, "PART_WEAPON", "D:/ymir work/pc/common/effect/sword/sword_9_f.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+25, "PART_WEAPON_LEFT", "D:/ymir work/pc/common/effect/sword/sword_7_f.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+26, "PART_WEAPON_LEFT", "D:/ymir work/pc/common/effect/sword/sword_8_f.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+27, "PART_WEAPON_LEFT", "D:/ymir work/pc/common/effect/sword/sword_9_f.mse")
Observatie:
Daca nu ai sistemul ENABLE_WOLFMAN in sursa ta, poti scoate fara probleme partea cu #ifdef ENABLE_WOLFMAN si blocul if app.ENABLE_WOLFMAN:.


la acest mesaj și conținutul se va afișa automat.


