![]() |
|
Holographic Ring Rotator? - Printable Version +- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk) +-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html) +--- Forum: Starfall (https://teamscm.co.uk/forum-7.html) +--- Thread: Holographic Ring Rotator? (/thread-3392.html) |
Holographic Ring Rotator? - him - 19-07-2020 I've been trying (and utterly failing) at building off of Doc's Holographic Iris Starfall to create something a little like this: Gears (from Doc's holo iris) will rotate at the same speed as the glyphs on an SG-1, Movie, Infinity, etc. gate, or at the speed that a Universe gate rotates. I've even tried making the simplest form of this idea (gears rotating at a fixed speed when the glyphs/gate rotates at all), but, being Starfall-illiterate, can't seem to get anything to work. A problem I've seen with this idea is that there's only a Wiremod input for "Rotate Ring," which is a normal input, but no output for how fast the ring is rotating. Could a Starfall/E2 be able to detect how fast a ring is rotating? If he finds this I'll be overjoyed. RE: Holographic Ring Rotator? - The17thDoctor - 19-07-2020 The ring is a separate entity, starfall has stargate functions to get the ring's angle but not its actual speed ( at least I didnt try searching ) If I get on at some point, i'll test this and try to make your idea. RE: Holographic Ring Rotator? - him - 20-07-2020 (19-07-2020, 11:36 PM)The17thDoctor Wrote: The ring is a separate entity, starfall has stargate functions to get the ring's angle but not its actual speed ( at least I didnt try searching )Thanks Doc! I'll get on as soon as possible. [ After I'm done watching anime and playing Minecraft at the same time. ] RE: Holographic Ring Rotator? - pho - 20-07-2020 Seen in Cap code: Code: if (self.RingSpeed == 1) then
self.Ring.Entity:SetKeyValue("maxspeed",30);
elseif (self.RingSpeed == 2) then
self.Ring.Entity:SetKeyValue("maxspeed",45);
pitch = 102;
elseif (self.RingSpeed == 3) then
self.Ring.Entity:SetKeyValue("maxspeed",60);
pitch = 106;
elseif (self.RingSpeed == -1) then
self.Ring.Entity:SetKeyValue("maxspeed",7.5);
pitch = 93;
else
self.Ring.Entity:SetKeyValue("maxspeed",15);
pitch = 95;
endused to set a rotating function on the ring Code: function ENT:AddRing()
local pos = self.Entity:GetPos();
local e = ents.Create("func_rotating");
e:SetKeyValue("spawnflags",4 + 16); -- rotate around x-axis
e:SetKeyValue("rendermode",10); -- dont draw,or the game crashes on touch
e:SetKeyValue("maxspeed",30);
e:SetKeyValue("friction",100);from what i've read https://developer.valvesoftware.com/wiki/Func_rotating Code: Note: These formulas get called every 0.1 seconds.
Purpose: Think function: Accelerates a func_rotating to a higher angular velocity. new_speed = fabs( current_speed ) + 0.2 * maxspeed * fanfriction;
Purpose: Decelerates the rotator from a higher speed to a lower one. new_speed = fabs( current_speed ) - 0.1 * maxspeed * fanfriction;So there's an acceleration from when the ring start rotating until it reached the specified max speed (in deg/s) taking 400ms to reach max speed
|