Laser STOOL 2.0

Nice.

Have a Lua King.

where do you get mirrors

It’s a SENT in the download.

I thought I fixed this :uhoh: Were you using mirrors? And what prop was it if you remember? I can’t reproduce this bug.

Now I know why I didn’t see this bug : I mostly tested in multiplayer, and when I tested in single player, “keep corpses” was disabled. So until you check “Keep corpses”, it works well. I’m trying to fix that but I can’t find how to get the NPC ragdoll entity from the NPC entity…

He was using mirrors, but it was in between the laser and the first mirror. The prop was a green couch from HL2, not sure if tested any others.

thank you

Edit:

download the derstebment mod the corpses blow up

Ok, there was no enough force to push the prop or something, it works better when scaling the force according to the prop’s weight (I also use ApplyForceOffset instead of ApplyForceCenter now).
Thanks :smiley: I think I will upload the updated version when I get the NPCs ragdoll bug fixed.

HOLY FUCKING FUCK FUCK FUCK

I’m up very early so don’t yell if I say anything stupid. When you kill an NPC you can undo its corpe. So either the NPC entity turns into that ragdoll or the sandbox gamemode somehow fiddles with it. So try removing the NPC instead of finding its ragdoll entity, or look at the sandbox NPC spawn/kill part which adds the undo.

Edit:

Also for applying force, apply it to the limb of the ragdoll it hits. That would make it more realistic.

Sandbox replaces the NPC entity in the undo list with the ragdoll.

None the less, you can get the ragdoll entity, somehow.

For the moment, the only way I found is to search the NPC’s ragdoll when killing it:
[lua]for k,v in pairs(ents.FindByClass(“prop_ragdoll”)) do
if (v:GetClass() == “prop_ragdoll” and v:GetTable().Created == CurTime()) then
v:SetName( dissolverEnt.Target );
end
end[/lua]

I’m still searching in Sandbox how to retrieve the NPC’s ragdoll out of the Entity but if I really can’t find anything I’ll use the above code

Edit:

Too bad that “GetRagdollEntity” only works on player :uhoh:

MIRRORS OH GOD SEXY OH GOD
But seriously, when I read about this mod I actually got a weird floating sensation throughout me.
And also, the mirror sent will be epic for minges who like to laser spam.
“HAHA LASER-OWNED HAHA”
“BRING IN THE MIRROR-TANK”
jeep covered in mirrors rolls in
“HAHAH I OWN YOUR- OH GOD MY FACE OW OW WO”

You could look into:

GM.CreateEntityRagdoll( entity, ragdoll )

It’s defined in base, but I don’t know what it does or where it’s really called from, after a bit of searching since it’s a blank function in the base gamemode.

From what I can tell, there is no longer the OnNPCKilled bit where the the ragdoll is assigned to the NPC that I could find in code.garrysmod.com :(.

Yay for lasers! Awesome addon!

I searched for CreateEntityRagdoll in code.garrysmod.com and I found this:
http://code.garrysmod.com/?show=/garrysmod/gamemodes/sandbox/gamemode/init.lua#214

So I tried this:
[lua]function AssignNPCRagdoll( entity, ragdoll )
entity.DeathRagdoll = ragdoll;
end

hook.Add( “CreateEntityRagdoll”, “AssignNPCRagdoll”, AssignNPCRagdoll ) [/lua]

And it worked! I can dissolve the NPC’s ragdoll :smiley:
Thanks you very much :slight_smile:

Edit:

Awesome!

I found a bug, if a player is killed by “Core effect”, the screen will go red, and there will be a ragdoll, but the player can still walk and noclip, but clicking will respawn them.
Also, I like the kill-icon.

I have a request…how about a crystal SENT thing that “Refracts” the laser’s direction in a certain direction (no matter where the laser hits it)?
So you could actually do what this guy did: http://forums.facepunchstudios.com/showpost.php?p=11086485&postcount=35
Without faking it.
Also, sorry for any grammatical errors, I woke up 12 minutes ago. :v:

Now a prism would be cool, put a white laser through, and a colorful shotgun effect of lasers comes out.

Been playing with this all day, it’s great only problem

cvar for max lasers please ?