|
-
mhh also hab nun bisschen rumprobiert.. aber was brauchbares ist nicht rausgekommen
also laut anleitung sollte es so aussehen
Code:
void POS_SetRotMat(var object o , var float mat[3][3] )
ich hab nun das objekt und die matrix(aus dem 3d programm auslesen lassen)
Code:
obj1
(matrix3 [0.456693,0.873043,0.170958] [0.825351,-0.487518,0.284819] [-0.332004,-0.0110254,0.943213])
nun hab ich es versucht zusammen zu stecken und diesen code niedergeschrieben
Code:
POS_SetRotMat("obj1", mat[0.456693,0.873043,0.170958] [0.825351,-0.487518,0.284819] [-0.332004,-0.0110254,0.943213] [9020.57,-877.526,-847.286]);
leider folgt immer eine fehlermeldung
Code:
00:01 Fault: Expecting "]" while parsing <nested identifier>, while parsing <simple expression>, while parsing <parameter list>, while parsing <statement>, while parsing <statement-block>, while parsing <function declaration>
00:01 Warn: POS_SetRotMat(obj1, (mat[0.456693
00:01 Fault: ,0.873043,0.170958] [0.825351,-0.487518,0.284819] [-0.332004,-0.0110254,0.943213]));
00:01 Fault: There have been parsing errors.
hab nun auch versucht den code mal bisschen anzupassen.. zb mat[3][3] aber es half alles nichts.
Geändert von Ska-Ara (31.07.2016 um 14:32 Uhr)
-
Mit [] gibt man den Index an (also welche Stelle der Matrix/des Arrays). Wenn du ein Array/eine Matrix erstellen möchtest, sollte das z.B. so gehen (bin mir aber nicht sicher, ob man {} verschachteln kann für mehrdimensionale Arrays):
Code:
POS_SetRotMat("obj1", {{0.456693,0.873043,0.170958}, {0.825351,-0.487518,0.284819}, {-0.332004,-0.0110254,0.943213}});
Die letzten drei Werte scheinen die Position zu sein (Werte sind nicht alle zwischen -1 bis 1), die haben in der Rotationsmatrix nichts zu suchen. Evtl. ist die Reihenfolge jetzt falsch (stell dir vor, die Matrix wäre um 90° gedreht), dann müsstest du die Werte noch umsortieren.
-
Geändert von Ska-Ara (01.08.2016 um 15:49 Uhr)
Grund: Lösung gefunden
-
Ich glaube, langsam geht es zu Ende mit mir...
Folgendes einfaches Script:
Code:
#include<stdlib.zsl>
func void main()
{
WLD_Load("MAHLENDURASCII.ZEN");
var selection s;
s = WLD_GetVobsOfClass("oCItem");
foreach vob in s
{
if (vob.itemInstance == "ITPL_BEET")
{
var float pos[3] = vob.pos;
WLD_Delete(vob);
WLD_NewItem("ITPL_UNKNOWN", pos);
}
}
WLD_Save("MAHLENDUR_GETAUSCHT.zen");
}
Rein von der Theorie her, müsste das Script alle oCItem-Vobs mit der Instanz ITPL_BEET löschen und an deren Position ein neues Item mit der Instanz ITPL_UNKNOWN erstellen, richtig?
Das Löschen funktioniert auch noch. Nur leider wird kein neues Item erstellt, bzw. nicht gespeichert.
Weiß vielleicht jemand, was ich übersehen habe?
-
Wie hast du getestet, ob das Einfügen funktioniert?
Hast du dir einmal die Variable "pos" ausgeben lassen (in zSpy), um sicherzugehen, dass sie tatsächlich die richtigen Werte hat?
-
Ich weiß nicht, wofür du das machst, aber das sieht so aus, als würde es sowieso nicht das gewünschte Ergebnis bringen. Es braucht mehr als 3 Koordinaten, um die Drehung eines Objektes zu speichern, alle deine Pflanzen sind also später falsch ausgerichtet. Könnte unschön aussehen, je nachdem, wo sie gepflanzt worden sind.
-
Diesmal nehme ich einen anderen Standardspruch, Bäume, Wald, ihr kennt das...
Folgende Problemstellung war zu lösen: Alle Pflanzen (außer Unkraut) sollen durch eine neue Pflanze ("unbekannte Pflanze") ersetzt werden. Um nicht mehrere Wochen meiner kostbaren Ausbildungszeit () auf Spacer-Sessions zu verwenden, um entsprechende Pflanzen durch entsprechende Pflanze zu ersetzen, dachte ich mir: Hey, es gibt doch zSlang.
Und jetzt der Trick-Trick. Wieso denn das Item löschen und ein neues erstellen, wenn ich doch nur das Item austauschen möchte? Da das Visual und der Vobname sowieso durch die Scripte bestimmt werden, reicht es doch die Instanz zu ändern.
Code:
vob.itemInstance = "ITPL_UNKNOWN";
...does the magic!
@Milky: Ganz einfach, ich habe die Zen im Spacer geöffnet. Ergebnis: Alte Pflanze weg, neue Pflanze nicht da, ergo: Löschen tut's, einfügen nicht (vollständig).
So rein aus Neugier, wie kann ich denn mit zSlang etwas ausgeben? Ein Print-Befehl scheint nicht zu existieren, zumindest habe ich auf meiner Suche durch die Scripte keinen entdeckt...
@Lehona: Heißt also, wenn ich es so machen wollen würde, wie ich es angefangen habe, müsste ich mit einer vollständigen [3][3][3] Rotationsmatrix arbeiten?
Wie gesagt, der einfache Ansatz tut's auch, aber man lernt ja nie aus
-
Ja, zSlang sollte aber auch die TrafoMatrix kennen, das ist also kaum Mehraufwand.
Etwas ausgeben kannst du z.B. per Warn() (gibt es auch Info()?), falls du Strings in eine Datei exportieren möchtest, könntest du meine "Erweiterung" benutzen: http://forum.worldofplayers.de/forum...1#post24468780
-
Okay, danke dir. Damit werde ich wohl mal etwas rumspielen.
-
Hi all! How can textures be managed by zSlang?
As you know when you give a TGA visual to a vob, more options appears like alpha, 2sided, etc..
How can I edit the values of these via zSlang?
For example:
Code:
myobject.decal2Sided = true;
Does not exist. Neither do this:
Code:
myobject.visual.decal2Sided = true;
I tried this last one because it is under visual. Did someone succeed?
EDIT: I also tried to change the zCVob.zen without success:
Code:
ZenGin Archive
ver 1
zCArchiverGeneric
ASCII
saveGame 0
date 23.7.2011 18:40:31
user Sekti
END
objects 3
END
[% oCWorld:zCWorld 36865 0]
[VobTree % 0 0]
childs0=int:1
[% zCVob 52224 1]
pack=int:0
presetName=string:
bbox3DWS=rawFloat:0 0 0 0 0 0
trafoOSToWSRot=raw:0000803f0000008000000000000000000000803f0000000000000080000000800000803f
trafoOSToWSPos=vec3:0 0 0
vobName=string:
visual=string:
showVisual=bool:1
visualCamAlign=enum:0
visualAniMode=enum:0
visualAniModeStrength=float:0
vobFarClipZScale=float:1
cdStatic=bool:0
cdDyn=bool:0
staticVob=bool:0
dynShadow=enum:0
zbias=int:1
isAmbient=bool:0
[visual zCDecal 64513 2]
name=string:
decalDim=rawFloat:0 0
decalOffset=rawFloat:0 0
decal2Sided=bool:0
decalAlphaFunc=enum:0
decalTexAniFPS=float:0
decalAlphaWeight=int:255
ignoreDayLight=bool:0
[]
[ai % 0 0]
[]
[]
childs1=int:0
[]
[EndMarker % 0 0]
[]
[]
Geändert von Frank-95 (19.02.2017 um 13:35 Uhr)
-
Did you try a foreach-loop to detect properties which are hard to know about, otherwise?
-
Foreach loop on what? How can I loop between properties?
-
Sorry, I didn't know you cannot iterate over the properties with foreach, only selections and arrays (of objects).
EDIT:
As it seems, your desired properties are not accessible via zSlang.
Geändert von Mutton (20.02.2017 um 16:31 Uhr)
-
And this cannot be solved anyway?
This tool was simply perfect
-
Sektenspinner thought ahead and published the source code of his application as well (see first post). You could extend it when it comes to the properties you are missing (or persuade someone else to do it). zSlang is a nice tool but it was not developed with every single application in mind.
-
Zitat von Mutton
Sektenspinner thought ahead and published the source code of his application as well (see first post). You could extend it when it comes to the properties you are missing (or persuade someone else to do it). zSlang is a nice tool but it was not developed with every single application in mind.
Boost::Spirit (which this language was developed with) is not for the faint of heart. I didn't even manage to get it to compile, although this was some time ago when I hadn't had much experience with programming outside of Daedalus and Java.
-
Hi!
Is it possible to add directly with zSlang a vobtree? I have some vobtrees saved as zen files because it's convenient when I have to add the same object over and over. Is it possible to do that via zslang?
EDIT: or at least how do you export vobs from a compiled zen to a text zen (only vobs no mesh)? WLD_LoadWithoutMesh make zSlang crash. I'm asking this, because if ii cannot be done with zslang maybe I could do that in python by changing text files, and then marging them with the mesh
Geändert von Frank-95 (19.06.2017 um 13:56 Uhr)
-
Zitat von Frank-95
Hi!
Is it possible to add directly with zSlang a vobtree? I have some vobtrees saved as zen files because it's convenient when I have to add the same object over and over. Is it possible to do that via zslang?
EDIT: or at least how do you export vobs from a compiled zen to a text zen (only vobs no mesh)? WLD_LoadWithoutMesh make zSlang crash. I'm asking this, because if ii cannot be done with zslang maybe I could do that in python by changing text files, and then marging them with the mesh
Where would you get the position info from to add it?
I think I have used WLD_LoadWithoutMesh before. Maybe you can share your code so we can see what's making it crash.
-
Where would you get the position info from to add it?
In the original zens there are some vobtrees (like torches or candles) which I would like to replace with my owns. The mesh is the same but I changed lights/sounds/things. Replacing one by one in the spacer would be suicidal. Via zSlang it would be pretty easier, but it's not impossible via python either (much longer though).
Maybe you can share your code so we can see what's making it crash.
Well, it is the function itself that makes zSpy crash
Code:
#include<stdlib.zsl>
func void main()
{
WLD_LoadWithoutMesh("C:\Program Files (x86)\Gothic 2 Gold\_work\data\Worlds\NewWorld\NewWorld_Part_Farm_01.zen");
//WLD_Save("C:\Program Files (x86)\Gothic 2 Gold\_work\data\Worlds\NewWorld\NewWorld_Part_Farm_02.zen");
}
Windows box opens up saying "zSpyInterpreter.exe has stopped working"
-
Neuling
Hallo (:
Könnte mir einer der technisch begabten evtl. sagen, ob es per zlang möglich ist, sämtliche Items aus einer .zen zu löschen? Gegebenenfalls sogar den Script geben?
Scripten ist leider nicht so mein Ding o.o
Danke, falls sich jemand die Mühe macht.
Berechtigungen
- Neue Themen erstellen: Nein
- Themen beantworten: Nein
- Anhänge hochladen: Nein
- Beiträge bearbeiten: Nein
|
|