Functioneaza perfect, am avut si eu aceeasi problema si am rezolvat cu acel tutorial, refa partea de playersettingmodule si introloading.
Ca sa iti citeasca si race_height faci asa:
# SetRaceHeight
NPC_HEIGHT = {
# horse
20030 : 220.00,
20101 : 220.00,
20102 : 220.00,
20103 : 220.00,
20104 : 220.00,
20105 : 220.00,
20106 : 220.00,
20107 : 220.00,
20108 : 220.00,
20109 : 220.00,
# shop
30000 : 150.00,
# mount
20212 : 0.01, # uff.. the mounts need to have 0.01
# dragon
2493 : 300.00,
}
def __LoadRaceHeight():
Dict = NPC_HEIGHT
for k,v in Dict.items():
chrmgr.SetRaceHeight(k, v)
Sau asa daca vrei sa pui fisierul race_height.txt in root(vrifica sa ai "__builtins__.pack_open = open" in system.py ):
def __LoadRaceHeight():
directory = "race_height.txt"
try:
lines = pack_open(directory,"r").readlines()
except IOError:
return
for line in lines:
try:
tokens = line[:-1].split("\t")
if len(tokens) <= 1 or not tokens[0]:
continue
if tokens[0].find("#") != -1:
continue
if tokens[1].find("#") != -1:
tokens[1] = tokens[1].split("#")[0].replace("\s","")
if tokens[1].find("#") != -1:
continue
vnum = int(tokens[0])
height = float(tokens[1])
chrmgr.SetRaceHeight(vnum, height)
except:
import dbg
dbg.TraceError("I could not read the lines of %s" % directory)
Daca folosesti asta:
# SetRaceHeight
def __LoadRaceHeight():
try:
lines = open("race_height.txt", "r").readlines()
except IOError:
return
for line in lines:
tokens = line[:-1].split("\t")
if len(tokens) == 0 or not tokens[0]:
continue
vnum = int(tokens[0])
height = float(tokens[1])
chrmgr.SetRaceHeight(vnum, height)
Trebuie sa pui fisierul race_height.txt in folderul la metin.