Wie beim Kärcher ist das dann ne Art Schleife wenn ich das richtig sehe ich teste jetzt geich mal sofort
Beiträge von mx 270
-
-
Gradzahl drehen nicht rotieren lassen das wäre ja einfach
-
So dasmit dem Event usw. hab ich jetzt fest im kopf nur habe ich jetzt das Problem ich will wie im Beispiel oben etwas drehen lass aber diesmal nur wenn die taste gedrückt ist
Also in etwa so
[lua] if InputBinding.isPressed(InputBinding.TASTE1) then
local x, y, z = getRotation(self.Rotation1.node);
local rot = {x,y,z};
local newRot = Utils.getMovedLimitedValues(rot, self.Rotation1.maxRot, self.Rotation1.minRot, 3, self.Rotation1.rotTime, dt, true );
setRotation(self.Rotation1.node, unpack(newRot));
end;if InputBinding.isPressed(InputBinding.TASTE2) then
local x, y, z = getRotation(self.Rotation1.node);
local rot = {x,y,z};
local newRot = Utils.getMovedLimitedValues(rot, self.Rotation1.maxRot, self.Rotation1.minRot, 3, self.Rotation1.rotTime, dt, false );
setRotation(self.Rotation1.node, unpack(newRot));
end;[/lua]So sieht das dann in etwa in der Update aus und das möchte ich MPready machen
-
So hier mal wieder was von mir eine Ladeplattform für den Agroliner HKL.
Hat vielleicht ähnlichkeit mit dem aus 09 ist aber ein Komplett neues ModellEr ist sowohl Spiel aus auch MP ready
Funktionen:
Wenn die Rampen zu sind ist der Traktor oder das Gerät fest.(by Geri-G aus 09)Modell/Textur/Ingame: by Mx270
So und hier die Bilder
-
Jo danke hab grade mein Script umbebaut und hat den Tests bestanden alles Funktionniert
-
Ich habe mal ne Frage oder nen Thema was sicher für vile interessant ist unzwar wie mann Scripte MP Ready macht (Der Aufbau der "Event" LUA mit der Standart LUA) ich habe mal ganz einfaches geschrieben und hab das mal soweit gemacht wie ich es weiß.
[lua]
myScript = {};function myScript.prerequisitesPresent(specializations)
return true;
end;function myScript:load(xmlFile)
self.-kp- = SpecializationUtil.callSpecializationsFunction("setRotation");
local rotationPartNodeRotation1= Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.Rotation1#index"));
if rotationPartNodeRotation1 ~= nil then
self.Rotation1 = {};
self.Rotation1.node = rotationPartNodeRotation1;local x, y, z = Utils.getVectorFromString(getXMLString(xmlFile, "vehicle.Rotation1#minRot"));
self.Rotation1.minRot = {};
self.Rotation1.minRot[1] = Utils.degToRad(Utils.getNoNil(x, 0));
self.Rotation1.minRot[2] = Utils.degToRad(Utils.getNoNil(y, 0));
self.Rotation1.minRot[3] = Utils.degToRad(Utils.getNoNil(z, 0));x, y, z = Utils.getVectorFromString(getXMLString(xmlFile, "vehicle.Rotation1#maxRot"));
self.Rotation1.maxRot = {};
self.Rotation1.maxRot[1] = Utils.degToRad(Utils.getNoNil(x, 0));
self.Rotation1.maxRot[2] = Utils.degToRad(Utils.getNoNil(y, 0));
self.Rotation1.maxRot[3] = Utils.degToRad(Utils.getNoNil(z, 0));self.Rotation1.rotTime = Utils.getNoNil(getXMLString(xmlFile, "vehicle.Rotation1#rotTime"), 2)*1000;
end;end;
function myScript:delete()
end;function myScript:mouseEvent(posX, posY, isDown, isUp, button)
end;function myScript:keyEvent(unicode, sym, modifier, isDown)
end;function myScript:readStream(streamId, connection)
end;function myScript:writeStream(streamId, connection)
end;function myScript:update(dt)
if InputBinding.isPressed(InputBinding.TASTE) then
self.drehen = not self.drehen;
end;
end;function myScript:updateTick(dt)
if self.Rotation1 ~= nil then
local x, y, z = getRotation(self.Rotation1.node);
local rot = {x,y,z};
local newRot = Utils.getMovedLimitedValues(rot, self.Rotation1.maxRot, self.Rotation1.minRot, 3, self.Rotation1.rotTime, dt, not self.drehen);
setRotation(self.Rotation1.node, unpack(newRot));
end;
end;function myScript:setRotation(Rotation, noEventSend)
end;function myScript:draw()
end;[/lua]Aber von der "Event" LUA hab ich 0 Plan
[lua]RotationEvent = {};
RotationEvent_mt = Class(RotationEvent, Event);InitEventClass(RotationEvent, "RotationEvent");
function RotationEvent:emptyNew()
end;function RotationEvent:new(vehicle, Rotation)
end;function RotationEvent:readStream(streamId, connection)
end;function RotationEvent:writeStream(streamId, connection)
end;function RotationEvent:run(connection)
end;function RotationEvent.sendEvent(vehicle, Rotation, noEventSend)
end;
[/lua]
Würde mich über Antworten freuen -
Ich würde sagen dass das blau etwas heller müsste aber, das Modell und die Textur ansich ist echt 1a
-
Mh hätte ja sein können da die "großen" Srcipter ja immer viel wissen aber wir werden es ja sehen
-
Also braucht man nur einige sachen ändern um ein Script LS2011 ready zu machen
-
Da wir uns dem Release LS 2011 näher und ich LS 2008 nicht gekannt hab würde ich gerne wissen worin die Unterschiede der LUA's liegen
Mfg Mx270
-
So meine Fragen sind geklärt kan eigentlich zu gemacht werden
-
Ja ne ich stand i-wie aufem schlauch hab nicht richtig gelesen hab inzwischen verstanden
-
Aber dann dreht er sich doch nicht nur wenn ich die Taste drüke oder ??
-
Kann mir jemand hierbei auch noch helfen
Zitat-Wie schreieibe ich das denn ich z.B. eine Greifer Rotation das man ich
links und rechts rum drehen kann ohne das irgentwann ende ist. -
@ John Deere 6930
Ich hab geschrieben
Zitatoder hab ich das Falsch
und du hast geschrieben
Zitatja
da dachte ich das was ist gepostet habe sei Falsch, kleines missverstäntnis
@ Skullman
Das ist mir schon klar nur als "Platzhalter" mir ist nix besseres eingefallen
Danke für die hilfe euch allen oder ehr gesagt John Deere 6930 und Skullman schnelle gute hilfe
-
OK ich habs Faltsdch und wie isses richtig ich hoffe ich nerv nicht sry
-
-
Dei Orininalen Maxxum Reifen sind geiller gut arbeit
-
OK danke soweit ist alles klar nur mit speed wenn ich da über ne variable laufenlassen will wie mss ich das dann machen also was oben bei load also für die xml ??
-
So meine Fragen sind,
-Wie muss ich das schreiben wenn ich per tasten druck o.ä. ein objekt zum drehen bekomme was dann immer durch läuft bis man es stoppt z.B. wie bei Schwadkreiseln.
-Wie schreieibe ich das denn ich z.B. eine Greifer Rotation das man ich links und rechts rum drehen kann ohne das irgentwann ende ist.
Ich hoffe ihr wisst was ich meine
Mfg mx270