Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help [SOLVED] Rotate entity fixed amount of degrees
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#11
RE: Rotate entity fixed amount of degrees

I don't think this script must make the object rotate forever. Did you try disabling the AutoMove in the entity file?

03-28-2014, 10:34 PM
Find
Reminiscity Offline
Member

Posts: 81
Threads: 16
Joined: Jan 2013
Reputation: 2
#12
RE: Rotate entity fixed amount of degrees

(03-28-2014, 10:34 PM)Mudbill Wrote: I don't think this script must make the object rotate forever. Did you try disabling the AutoMove in the entity file?

Yes its turned off by default. I don't see anything in the script that would make it possible for it to stop at wanted degree tho Sad And when come to think of it, I can't think of a single part of amnesia tdd where they would need it so it might be that such a feature was never implemented... but then again is feels like such a basic thing to include in an engine doesn't it?xD

My mod Amadeus
03-29-2014, 12:53 AM
Find
Apfel Offline
Junior Member

Posts: 19
Threads: 3
Joined: Jun 2011
Reputation: 1
#13
RE: Rotate entity fixed amount of degrees

Hi there,

(03-28-2014, 10:00 PM)Reminiscity Wrote: If I knew what the speed of the rotation is measured in then I could calculate how long it has to be spinning. Right now the speed is 1... but what does that mean? 1 degree a second? No, that much I'm sure of derp xD But that would be the key to calculating an exact delay for the timer I guess.


it is measured in rad/s. That means a whole turn in one second would be achieved with a speed of 2*pi. ( well the acceleration must be very high though)
But I don't know how exact this will be.



regarding the issue with SetMoveObjectState, maybe you could try to reset it after one turn: ResetProp(string& asName);
The Player shouldn't note this, as it has the same position just like at the beginning. (not tested myself)


maybe that helps a bit.
03-29-2014, 10:30 AM
Find
Reminiscity Offline
Member

Posts: 81
Threads: 16
Joined: Jan 2013
Reputation: 2
#14
RE: Rotate entity fixed amount of degrees

ResetProp(string& asName); was the key to this work around! This is what I ended up with. This script controls a number of wheels so that's the reason for all the entity + "_wheel" stuff.

void symbolCombination(string &in entity) {

RotatePropToSpeed(entity + "_wheel", 1, 1, 120, 0, 0, true, "");

AddLocalVarInt(entity + "_spins", 1);
AddTimer(entity, 2.59f, "stopWheel");

}

void stopWheel(string &in asTimer)
{

StopPropMovement(asTimer + "_wheel");

if(GetLocalVarInt(asTimer + "_spins") == 3) {

SetLocalVarInt(asTimer + "_spins", 0);
ResetProp(asTimer + "_wheel");
}
}

And it works perfectly Smile Thank you all so much for taking the time to help me I really really appreciated it! Marking this as solved!

My mod Amadeus
03-29-2014, 02:48 PM
Find




Users browsing this thread: 5 Guest(s)