Показать сообщение отдельно
Старый 27.02.2007, 17:08   #4
Xupypr
AnyKey`щик
 
Регистрация: 25.06.2006
Сообщений: 15
Написано 0 полезных сообщений
(для 0 пользователей)
Вопрос Re: База игры в XML

МоКа, base мну главная ветвь, все остальные открываются и закрываются по всем правилам. вот глянь блитцкод:

 
worldnode = xmlNodeFind("base", rootnode) 
;Get the handle of the world node
count = xmlNodeChildCount(worldnode) ;Get the world node's child count
Stop
For i = 1 To count ;Loop through each child node of the world node
entitynode = xmlNodeChild(worldnode, i) ;Get the child node
If xmlNodeNameGet(entitynode) = "entity" Then ;Check if it's an entity
t$ = xmlNodeAttributeValueGet(entitynode, "type")
;Get the entity type
End If
 
If t = "monstr" Then
class = xmlnodefind("class",entitynode)
monstr.monstr = New monstr
monstr\name$ = xmlNodeAttributeValueGet(class, "name")
model = xmlnodefind("model",entitynode)
monstr\model$ = xmlNodeAttributeValueGet(model, "file")
skin = xmlnodefind("skin",entitynode)
...
 
dropitem = xmlnodefind("dropitem",entitynode)
count = xmlNodeAttributeValueGet(dropitem, "count")
 
For j=count To 1 Step -1
monstr\dropitems.dropitem = New dropitem
monstr\dropitems\name$ = xmlNodeAttributeValueGet(dropitem, "item"+Str$(j))
monstr\dropitems\chance = xmlNodeAttributeValueGet(dropitem, "chance"+Str$(j))
Next
 
End If
 
Next
Администраторы, зачем мои сообщения в тему переделали? Я писал в топике LIB, че теперь это делает в 2 д проганье?
(Offline)
 
Ответить с цитированием