• What do you need help with? V3
    6,419 replies, posted
  • Avatar of werewolf0020
  • [QUOTE=SFArial;34662494]I don't quite understand where you are stuck, but the way I would make something like this is set up some kind of a grid system for the map and then either setting how many squares a building takes up or using the collision bounds of that prop and then checking if these squares around the prop are already occupied or not. I could draw it in paint if you need me to clarify.[/QUOTE] Ok first i am triying to do someting similar to This [video=youtube;YlfLByO7L_c]http://www.youtube.com/watch?v=YlfLByO7L_c&feature=related[/video] Minute 0-07,0-10 As you can see the Buildings follows the player mouse and switches its colour if its placeable or not Now what i want is that instead of doing an RTS View handle it trough the FPS View basicly put the "Building" a few metters away so far i have a trace and well i guess the end point of the trace is where i should "Spawn" or create the building entity Now i have to do the same trace Every frame and set the building/entity position to the Trace end location too? or theres a simplier way to do it?
  • Avatar of E X C L
  • Has anyone ever experienced this before? The playermodel is turned 90 degrees for some reason, their gun and torso face 90 degrees away. [img]http://puu.sh/gDNS[/img]
  • Avatar of lorde banana
  • [QUOTE=_NewBee;34662779][img]http://puu.sh/gCVu[/img] Is this fixed in gmod13? It started happening since some engine update in december.[/QUOTE] didn't you answer your own question? [editline]12th February 2012[/editline] [video=youtube;9UIj8syYG5A]http://www.youtube.com/watch?v=9UIj8syYG5A[/video] anyone have any idea why this happens or how to fix it? every vehicle I spawn does this :(
  • Avatar of E X C L
  • [QUOTE=Banana Lord.;34664566]didn't you answer your own question? [editline]12th February 2012[/editline] [video=youtube;9UIj8syYG5A]http://www.youtube.com/watch?v=9UIj8syYG5A[/video] anyone have any idea why this happens or how to fix it? every vehicle I spawn does this :([/QUOTE] They were diffirent. The post in gmod11 thread was ClientsideModel facing to the corner. This one is with actual playermodels that players have. This happens when they simply walk arround.
  • Avatar of PencilOnDesk
  • [QUOTE=PencilOnDesk;34626053][lua]function bloodtest() for k,v in pairs(player.GetAll()) do if v:Health() >= 25 then if timer.IsTimer("NextBleedOut") then timer.Destroy("NextBleedOut") end end if v:Health() <= 24 then if timer.IsTimer("NextBleedOut") then return end timer.Create("NextBleedOut",1,0,function() local Pos = v:GetPos() + Vector(0,0,30) local effectdata = EffectData() effectdata:SetStart( Pos ) effectdata:SetOrigin( Pos ) effectdata:SetScale( 1 ) util.Effect( "BloodImpact", effectdata ) local trace = {}; trace.start = v:GetPos() + Vector(0, 0, 256); trace.endpos = trace.start + Vector(0, 0, -1024); trace.filter = v; trace2 = util.TraceLine(trace); util.Decal("Blood", trace2.HitPos + trace2.HitNormal, trace2.HitPos - trace2.HitNormal) end) end end end hook.Add("Think","Bloodoasdf",bloodtest) hook.Add("PlayerDeath","ClearTimers", function() if timer.IsTimer("NextBleedOut") then timer.Destroy("NextBleedOut") end end)[/lua] Trying to work on some sort of bleeding system where the decal is drawn under the player; However at the moment the Decal only gets drawn when the player dies. Why is this?[/QUOTE] Bump
  • Avatar of Drakehawke
  • [QUOTE=PencilOnDesk;34666449]Bump[/QUOTE] I had your same problem, it's because the player is standing there, the decal gets drawn onto the player not the floor, I couldn't think of a way of doing it so I just made it so there's 1 second timer before the decal is drawn, so if the player is moving it does leave a trail behind them. If they stand still for a while the problem persists though. If anyone knows a proper way to do this I would also appreciate it.
  • [QUOTE=werewolf0020;34664040]Ok first i am triying to do someting similar to This [video=youtube;YlfLByO7L_c]http://www.youtube.com/watch?v=YlfLByO7L_c&feature=related[/video] Minute 0-07,0-10 As you can see the Buildings follows the player mouse and switches its colour if its placeable or not Now what i want is that instead of doing an RTS View handle it trough the FPS View basicly put the "Building" a few metters away so far i have a trace and well i guess the end point of the trace is where i should "Spawn" or create the building entity Now i have to do the same trace Every frame and set the building/entity position to the Trace end location too? or theres a simplier way to do it?[/QUOTE] Yes, putting the prop at your trace every frame, I think that's simple enough. [editline]12th February 2012[/editline] [QUOTE=_NewBee;34664430]Has anyone ever experienced this before? The playermodel is turned 90 degrees for some reason, their gun and torso face 90 degrees away. [img]http://puu.sh/gDNS[/img][/QUOTE] Try resetting the pose parameters.
  • Avatar of E X C L
  • [QUOTE=SFArial;34667159] Try resetting the pose parameters.[/QUOTE] Wouldn't that be kind of weird. It's just a Player.SetModel. I don't know anyone who does that. If I should do it then which function would I use?
  • [QUOTE=_NewBee;34668367]Wouldn't that be kind of weird. It's just a Player.SetModel. I don't know anyone who does that. If I should do it then which function would I use?[/QUOTE] [b][url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexbb44.html?title=Entity.ClearPoseParameters]Entity.ClearPoseParameters [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
  • Avatar of NickCC5
  • [lua]function GM:Move(ply, movedata) movedata:SetForwardSpeed(0) movedata:SetSideSpeed(0) movedata:SetVelocity(novel) if SERVER then ply:SetGroundEntity(NULL) end local ball = ply:GetBall() if IsValid(ball) then movedata:SetOrigin(ball:GetPos()) end return true end local Player = FindMetaTable("Player") function Player:SetBall(ent) self:SetOwner(ent) end function Player:GetBall() return self:GetOwner() end[/lua] [gamemodes\nintendorr\gamemode\shared.lua:18] attempt to index local 'self' (a nil value)(Hook: PlayerSpawn) Any help with this? please?
  • Avatar of NickCC5
  • [QUOTE=ralle105;34669581]I don't see a PlayerSpawn hook in there.[/QUOTE] How would I add a PlayerSpawn in there?
  • Avatar of ArmageddonScr
  • [QUOTE=NickCC5;34669748] [QUOTE=NickCC5;34669503] [gamemodes\nintendorr\gamemode\shared.lua:18] attempt to index local 'self' (a nil value)[B](Hook: PlayerSpawn)[/B] Any help with this? please?[/QUOTE] How would I add a PlayerSpawn in there?[/QUOTE] ?
  • Avatar of NickCC5
  • [QUOTE=ArmageddonScr;34669810]?[/QUOTE] [lua]function GM:Move(ply, movedata) movedata:SetForwardSpeed(0) movedata:SetSideSpeed(0) movedata:SetVelocity(novel) if SERVER then ply:SetGroundEntity(NULL) end local ball = ply:GetBall() if IsValid(ball) then movedata:SetOrigin(ball:GetPos()) end return true end local Player = FindMetaTable("Player") function Player:SetBall(ent) self:SetOwner(ent) end function Player:GetBall() return self:GetOwner() end[/lua] [gamemodes\nintendorr\gamemode\shared.lua:18] attempt to index local 'self' (a nil value)(Hook: PlayerSpawn) self is not working, anything else I could use?
  • Avatar of JustSoFaded
  • [QUOTE=NickCC5;34669935][lua]function GM:Move(ply, movedata) movedata:SetForwardSpeed(0) movedata:SetSideSpeed(0) movedata:SetVelocity(novel) if SERVER then ply:SetGroundEntity(NULL) end local ball = ply:GetBall() if IsValid(ball) then movedata:SetOrigin(ball:GetPos()) end return true end local Player = FindMetaTable("Player") function Player:SetBall(ent) self:SetOwner(ent) end function Player:GetBall() return self:GetOwner() end[/lua] [gamemodes\nintendorr\gamemode\shared.lua:18] attempt to index local 'self' (a nil value)(Hook: PlayerSpawn) self is not working, anything else I could use?[/QUOTE] Go to nintendorr\\gamemode\\shared.lua and the post the contents of the file
  • Avatar of Gmod4ever
  • Oh hell, I'll post here. Basically I'm trying to draw a rotating box using quads. The entity has a similar model, with collisions disabled, and its rotation is dictated serverside, where the quad drawing is (obviously) done client-side. It all works fine, except that the top and bottom don't rotate. It appears that :GetAngles():Top() doesn't really change, like the Forward() and Right(). The result is this. [img]http://dl.dropbox.com/u/8416055/gm_construct0036.jpg[/img] Anyone got any ideas on how I can make the top and bottom rotate with the rest of the box? I think I need to use RotateAroundAxis, but I don't know how to use that thing worth a damn. I've tried adding the Forward() or Right() to Up(), but that just makes it slanted, which isn't what I want. Thanks in advance.
  • Avatar of lorde banana
  • It sounds like RotateAroundAxis is what you want. It's a kinda weird function (or at least the outcome), from what I've seen of it, have you tried Forward/Right/Up with negative values as well?
  • Avatar of GameDev
  • I'm fairly new to LUA, and me and Pyth are making a Marble Blast gamemode; but of course we have no idea what we're doing. Basically, we want the player on spawn to change model to: [code]models/XQM/Rails/gumball_1.mdl[/code] and then be able to roll around with WASD, and jump. (Similar to melon racer) How would we go about doing this? We're completely stumped.
  • Avatar of Gmod4ever
  • [QUOTE=Banana Lord.;34673987]It sounds like RotateAroundAxis is what you want. It's a kinda weird function (or at least the outcome), from what I've seen of it, have you tried Forward/Right/Up with negative values as well?[/QUOTE] Yeah, I figured I need to use RAA, but I just have no idea what to do. I was hoping someone here could point me in the right direction. I'll fuck around with it, and ask around. Hopefully I'll be able to get it.
  • Avatar of Fantym420
  • [QUOTE=GameDev;34674159]I'm fairly new to LUA, and me and Pyth are making a Marble Blast gamemode; but of course we have no idea what we're doing. Basically, we want the player on spawn to change model to: [code]models/XQM/Rails/gumball_1.mdl[/code] and then be able to roll around with WASD, and jump. (Similar to melon racer) How would we go about doing this? We're completely stumped.[/QUOTE] They way I achieved this with my Marble Gravity Racer was to stick the player somewhere on the edge of the map bounds, and then create an entity that acts as the player. I originally started my game mode for the last GCC, which was to make a game mode based on the melon racer code, it's almost completely different now, but the core elements are there, like using a player entity, you should check it out, [url=http://www.facepunch.com/threads/1150064] here -> http://www.facepunch.com/threads/1150064[/url]. any way, hope that helps. [b]Edited[/b] also use [url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index4e84.html?title=Entity.PhysicsInitSphere] Entity.PhysicsInitSphere [/url] insted of the model's collision mesh, much smoother.
  • [QUOTE=Gmod4ever;34674294]Yeah, I figured I need to use RAA, but I just have no idea what to do. I was hoping someone here could point me in the right direction. I'll fuck around with it, and ask around. Hopefully I'll be able to get it.[/QUOTE] Well, DrawQuadEasy has a parameter that's pretty much rotation, you could use that for the top and bottom part. If you really want to get it working with RAA then it shouldn't be too hard either: you give it the angle object you want to rotate, give it a normal vector that you want to rotate it around (imagine it like a pole dancer, the normal is the pole and the dancer is the angle) and then just give it how many degrees you want to rotate. Don't forget that RAA modifies the original angle, not returns it.
  • How would one create a screen space alteration in which the borders are darkened? e.g like in OpenAura (if I recall correctly) where the screens borders are slightly darkened.
  • [QUOTE=Panto;34677045]How would one create a screen space alteration in which the borders are darkened? e.g like in OpenAura (if I recall correctly) where the screens borders are slightly darkened.[/QUOTE] It's just a texture with gradient alpha drawn in HUDPaint.
  • Avatar of E X C L
  • [QUOTE=SFArial;34668908][b][url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexbb44.html?title=Entity.ClearPoseParameters]Entity.ClearPoseParameters [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b][/QUOTE] That didn't work.
  • Avatar of Gmod4ever
  • Success! [t]http://dl.dropbox.com/u/8416055/gm_construct0037.jpg[/t] And if anyone wants to draw a box like this, [url=http://pastebin.com/Fe7UtGp8]here's the code[/url], free for anyone to use.
  • [QUOTE=_NewBee;34679852]That didn't work.[/QUOTE] I guess there isn't anything you can do then.
  • Avatar of ralle105
  • [QUOTE=_NewBee;34679852]That didn't work.[/QUOTE] Try calling :SetupBones() afterwards.
  • Avatar of PencilOnDesk
  • [QUOTE=Drakehawke;34666569]I had your same problem, it's because the player is standing there, the decal gets drawn onto the player not the floor, I couldn't think of a way of doing it so I just made it so there's 1 second timer before the decal is drawn, so if the player is moving it does leave a trail behind them. If they stand still for a while the problem persists though. If anyone knows a proper way to do this I would also appreciate it.[/QUOTE] This.
  • Avatar of |Royal|
  • Hey, How i get the sound duration of an "mp3" file, because [lua] SoundDuration() [/lua] works only for "wav" files ? best regards, |Royal|