LUA/Animationen

Eure Foren für alle Diskussionen rund ums Thema Modding.
User avatar
MonkeyWalk
Posts: 3
Joined: Sat Nov 05, 2016 9:16 pm

LUA/Animationen

Post by MonkeyWalk »

Hallo, ich habe ein kleines Problem.
Habe eine neue Version von SafetyWeight gemacht. Neues Modell und neue Texturen.
Die Animationen werden über selbstgemachte skript ausgefürth.
Mein Problem ist jetzt das die Ingame positionen nicht stimmen wie auf dem Bild zu sehen ist, die GE werte für Rotation passen mit der Script.
Kann mir jemand da weiter helfen?

Image

Teil des scripts das für die rotation verantwortlich ist:

Code: Select all

 if self:getIsActiveForInput() then
         if InputBinding.hasEvent(InputBinding.movePanels) then
             g_client:getServerConnection():sendEvent(BumbGewichtEvent:new(self, self.GewichtState + 1 ));
         end;
    end;  
    if self.newGewichtState then
        self.newGewichtState = nil;
        if self.GewichtState == 0  then
            setRotation(self.panelRight1, 0, 0, 0);
            setRotation(self.panelRight2, 0, 0, 0);
            setRotation(self.panelLeft1, 0, 0, 0);
            setRotation(self.panelLeft2, 0, 0, 0);
        elseif self.GewichtState == 1 then
            setRotation(self.panelRight1, 0, -8.213, 0);
            setRotation(self.panelRight2, 0, -25.966, 0);
            setRotation(self.panelLeft1, 0, 8.213, 0);
            setRotation(self.panelLeft2, 0, 25.966, 0);
        elseif self.GewichtState == 2 then
            setRotation(self.panelRight1, 0, -17.084, 0);
            setRotation(self.panelRight2, 0, -57.246, 0);
            setRotation(self.panelLeft1, 0, 17.084, 0);
            setRotation(self.panelLeft2, 0, 57.246, 0);
        elseif self.GewichtState == 3 then
            setRotation(self.panelRight1, 0, 19.07, 0);
            setRotation(self.panelRight2, 0, 39.351, 0);
            setRotation(self.panelLeft1, 0, -19.07, 0);
            setRotation(self.panelLeft2, 0, -39.351, 0);
        elseif self.GewichtState == 4 then
            setRotation(self.panelRight1, 0, 9.794, 0);
            setRotation(self.panelRight2, 0, 20.155, 0);
            setRotation(self.panelLeft1, 0, -9.794, 0);
            setRotation(self.panelLeft2, 0, -20.155, 0);
        elseif self.GewichtState == 5 then
            setRotation(self.panelRight1, 0, 0, 0);
            setRotation(self.panelRight2, 0, 0, 0);
            setRotation(self.panelLeft1, 0, 0, 0);
            setRotation(self.panelLeft2, 0, 0, 0);
            self.GewichtState = 0;            
        end;
    end;
User avatar
modelleicher
Posts: 1575
Joined: Fri Jul 09, 2010 11:10 pm
Location: Hessen
Contact:

Re: LUA/Animationen

Post by modelleicher »

Die setRotation Funktion möchte radian-Werte, keine degree-Werte..
Also math.rad(Wert_in_Grad) für jeden Wert.. eintragen ;)

LG
Eine Stunde oder Minute ist nur ein winziger Teil unseres gesamten Lebens. Und dennoch sind es die einzelnen Momente, die das Leben lebenswert machen.
User avatar
MonkeyWalk
Posts: 3
Joined: Sat Nov 05, 2016 9:16 pm

Re: LUA/Animationen

Post by MonkeyWalk »

Vielen Dank für die Hilfe!
User avatar
Aranea
Posts: 289
Joined: Thu Oct 06, 2016 9:51 pm
Location: meine Höhle

Re: LUA/Animationen

Post by Aranea »

wär's nicht einfacher die Animation über das Standartscript foldable zu machen? da hast du alles was du brauchst und benötigst keine mod Scripte für ein Gewicht...
oder hat es einen Grund, dass du das unbedingt anders lösen musst/willst ?
MfG
die Spinne :hi:
FS modder & scripter
quality modding and support since 2012
viewtopic.php?f=884&t=115656
Post Reply