Ulysses Stuff > Suggestions
Random gravity?
Aaron113:
I've been busy. I'll try and fit some time in for it today or after Christmas.
krooks:
That Christmas is getting all of us!
Such a busy time of year.
sweetone:
--- Quote from: Aaron113 on December 13, 2011, 03:27:09 PM ---It isn't done, but is this something like what you guys had in mind?
--- Code: --------------------------------- Grav ------------------------------
function ulx.grav( calling_ply, gravity, seconds )
for k,v in pairs( player.GetAll() ) do
v:SetGravity( gravity )
end
timer.Simple( seconds, function()
for k,v in pairs( player.GetAll() ) do
v:SetGravity( 1 )
end
end )
ulx.fancyLogAdmin( calling_ply, "#A set gravity to #i for #i seconds", gravity, seconds )
end
local grav = ulx.command( CATEGORY_NAME, "ulx grav", ulx.grav, "!grav" )
grav:addParam{ type=ULib.cmds.NumArg }
grav:addParam{ type=ULib.cmds.NumArg }
grav:defaultAccess( ULib.ACCESS_ADMIN )
grav:help( "Randomizes gravity for everyone." )
--- End code ---
--- End quote ---
hehe tryed it and yea it don't work yet. :) can't wait the final version of it.
Aaron113:
Ehh, I do not know of any way to set prop's gravity other then applying force to it or something in that area. So if I finish this, it'll most likely just include player's gravity.
sweetone:
--- Quote from: Aaron113 on January 05, 2012, 04:57:48 PM ---Ehh, I do not know of any way to set prop's gravity other then applying force to it or something in that area. So if I finish this, it'll most likely just include player's gravity.
--- End quote ---
:) can't you check how wire field generator - gravity works then? use same idea?
--- Code: ---function ENT:Toogle_Prop_Gravity( prop , yes_no )
if ( !prop:IsValid() ) then return end
if ( self.ignore[ prop:EntIndex() ] == prop ) then return false; end
if ( !self:is_true(self.workonplayers) && prop:GetClass() == "player" ) then
return false;
end
if prop:GetMoveType() == MOVETYPE_NONE then return false; end
if prop:GetMoveType() == MOVETYPE_NOCLIP then return false; end //do this to prevent -uncliping-
if prop:GetClass() != "player" && !gamemode.Call("PhysgunPickup",self.pl,prop) then return false; end
if prop:GetMoveType() != MOVETYPE_VPHYSICS then
if yes_no == false then
if prop:IsNPC() || prop:IsPlayer() then
prop:SetMoveType(MOVETYPE_FLY);
prop:SetMoveCollide(MOVECOLLIDE_FLY_BOUNCE);
else
prop:SetGravity(0);
end
else
if prop:IsPlayer() then
prop:SetMoveType(MOVETYPE_WALK);
prop:SetMoveCollide(MOVECOLLIDE_DEFAULT);
elseif prop:IsNPC() then
prop:SetMoveType(MOVETYPE_STEP);
prop:SetMoveCollide(MOVECOLLIDE_DEFAULT);
else
prop:SetGravity(1);
end
end
end
--- End code ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version