Das anpassen bzw. erweitern schaff ich nur hatte ich bisher das Grundsystem nicht verstanden

@Stargate
....merkt doch keiner

und falls doch ist noch die Frage ob sie dich wirklich verklagen....
Gruß
Scarabol
ja, kannst Du:Scarabol hat geschrieben:mal angenommen die Anzahl der Faces ist vorher nicht angegeben kann ich dann trotzdem alle Faces ermitteln, die zwischen <submesh> und </submesh> angegeben wurden?
Code: Alles auswählen
Structure s_Face
v1.l
v2.l
v3.l
EndStructure
oXML = LoadXML(#PB_Any, "D:\Ogre.xml")
If oXML
NewList Face.s_Face()
FaceCounter = 0
Repeat
oNode = XMLNodeFromPath(RootXMLNode(oXML), "mesh/submeshes/submesh/faces/face[" + Str(FaceCounter) + "]")
If oNode = 0 : Break : EndIf
AddElement(Face())
If ExamineXMLAttributes(oNode)
While NextXMLAttribute(oNode)
Select XMLAttributeName(oNode)
Case "v1" : Face()\v1 = Val(XMLAttributeValue(oNode))
Case "v2" : Face()\v2 = Val(XMLAttributeValue(oNode))
Case "v3" : Face()\v3 = Val(XMLAttributeValue(oNode))
EndSelect
Wend
EndIf
FaceCounter + 1
ForEver
Debug "Anzahl Faces: " + Str(CountList(Face()))
FreeXML(oXML)
EndIf
Code: Alles auswählen
LoadXML(1, "data\map.txt")
main = MainXMLNode(1)
Debug XMLChildCount(main)
Code: Alles auswählen
<map width="11" height="11" playerx="7" playery="8">
<!-- Grasfläche erstellen -->
<area startx="1" starty="1" stopx="10" stopy="10" boden="1" state="1"></area>
<area startx="1" starty="7" stopx="4" stopy="10" boden="-70" state="0"></area>
<!-- Haus einfügen -->
<field x="7" y="4" house="60" state="0"></field>
<field x="8" y="4" house="61" state="0"></field>
<field x="9" y="4" house="62" state="0"></field>
<field x="7" y="5" house="63" state="0"></field>
<field x="8" y="5" house="64" state="0"></field>
<field x="9" y="5" house="65" state="0"></field>
<field x="7" y="6" house="66" state="0"></field>
<field x="8" y="6" house="67" state="0"></field>
<field x="9" y="6" house="68" state="0"></field>
<area startx="6" starty="3" stopx="10" stopy="3" boden="59" state="0"></area>
<area startx="6" starty="7" stopx="10" stopy="7" boden="59" state="0"></area>
<area startx="6" starty="4" stopx="6" stopy="7" boden="59" state="0"></area>
<area startx="10" starty="4" stopx="10" stopy="7" boden="59" state="0"></area>
<field x="8" y="7" house="0" state="1"></field>
</map>
Code: Alles auswählen
<field x="8" y="7" house="0" state="1"/>
mh, ich musste auch knobeln. Des Rätsels Lösung:Scarabol hat geschrieben:kann mir noch einer sagen, was ich da oben falsch gemacht hab?
Childcount gibt immer 0
Code: Alles auswählen
<!-- Grasfläche erstellen -->
[...]
<!-- Haus einfügen -->
Code: Alles auswählen
<!-- Grasflaeche erstellen -->
[...]
<!-- Haus einfuegen -->
Code: Alles auswählen
LoadXML(1, "d:\map.xml")
RootNode = RootXMLNode(1)
ChildNode = ChildXMLNode(RootNode)
Debug GetXMLNodeName(ChildNode) ; -> map
Debug XMLChildCount(ChildNode) ; -> 18