Hello everyone,
I have a few questions, that I felt did not quite belong into the "Problems That Don't Need Their Own Thread" thread.
My first question is regarding a HUD. Consider this: (The Forest)
[IMG]http://hydra-media.cursecdn.com/theforest.gamepedia.com/e/e9/Hud.jpg[/IMG]
How would I go on about drawing the stomach? Should I have someone create a vtf file for me and then draw it as a material plus texturedrect? My problem is especially about the "filling", how can I draw a proper bar just inside of the stomach? Some example code would be very appreciated!
Now, to my second question, I have a helicopter ent, that currently flies over the map like so:
[lua]
function ENT:Initialize()
self:SetModel( "models/combine_helicopter.mdl" )
self:SetCollisionGroup( COLLISION_GROUP_NONE )
self:SetSolid( SOLID_NONE )
self:SetMoveType( MOVETYPE_VPHYSICS )
self:PhysicsInit( SOLID_VPHYSICS )
self:ResetSequence( self:LookupSequence( "idle" ) )
timer.Create("SetChopperAngles", 0.3, 0, function()
local ang = self:GetAngles()
self:SetAngles(Angle(ang.x, ang.y+3, ang.z))
end)
end
function ENT:Think()
if ( !self.Sound ) then
self.Sound = CreateSound( self, Sound("npc/attack_helicopter/aheli_rotor_loop1.wav") )
self.Sound:Play()
end
local phys = self:GetPhysicsObject()
if ( !phys ) then return end
phys:SetVelocity( (self:GetUp() * 72.1) + (self:GetForward() * 600) )
end
[/lua]
Not only have I a horrible feeling about the timer and the setangels, but it also does not fly over the map in a circle (of course not considering my method). Now, how would I get it so it truly flies in a circular shape?
Next up, upon spawning I let the player spectate the helicopter:
[lua]
for k,v in pairs(ents.FindByClass("ent_spawn_chopper")) do
ply:Spectate(OBS_MODE_CHASE)
ply:SpectateEntity(v)
end
[/lua]
My problem here is that the camera is too close, I tried messing around with SetViewOffset/SetCurrentViewOffset, but those do not work whilst spectating an entity. How would I get the spectating camera to get some more "distance" to the helicopter?
And last but not least, [URL="http://facepunch.com/showthread.php?t=1449139&p=47174095&viewfull=1#post47174095"]Giraffen shows[/URL] a top-down view of the map in a panel, how exactly is this done, since it'd be great for an actual map?
Thank you and hopefully you can answer some to all of my questions! :)
1. Look in to stencils, [url=http://facepunch.com/showthread.php?t=1449800]this might help[/url]
2. I'm not sure how to answer this.
3. You could use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/CalcView]GM/CalcView[/url] for that
4. [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/render/RenderView]render.RenderView[/url] and [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/render/SetRenderTarget]render.SetRenderTarget[/url]
Sorry, you need to Log In to post a reply to this thread.