1. Post #1
    Gold Member
    madjawa's Avatar
    March 2005
    644 Posts
    This is the new version of my Laser STOOL. I recoded it from scratch, because the old version was using Source's env_laser entity that limited the possibilities.

    The new features:
    [list][*]Lasers can now be reflected by mirrors (Laser Reflector in the Entities tab)[*]You can now choose if the laser will push the props[*]New wire inputs (On/Off, Length, Width, Damage)[*]Sounds when turning the laser on/off and when killing something[*]Compatible with Stargate shields[*]Duplicator support[*]a few things I forgot[/list]
    Special thanks to:
    - Nevec, for the idea of disintegrating the player's ragdoll
    - Nevec and Kogitsune, for helping me to solve the NPC ragdoll bug in SP
    - AzuiSleet, for solving the "laser always drawing behind props" bug
    - People on the #luahelp IRC chan
    - Everyone on my server that "helped" in beta testing :P

    Of course, you don't need Wire or Stargate mod.
    If you set Damage to 0, the laser will not hurt anything.

    Download:

    SVN : https://svn.madjawa.net/lua/LaserSTOOL/




    Known bugs:
    [list][*]If Keep Corpses is checked, NPCs won't dissolve correctly FIXED[*]Heavy props are pushed toward the laser FIXED[*]No free edicts (?)[*]Spawing a laser on a dead NPC gives a Lua error FIXED[*]Active weapon sometimes disappears FIXED (I hope)[*]Repeating sound when hitting a Strider buster FIXED[*]Wired inputs not getting saved FIXED[*]Props randomly appears to be infront of the beam FIXED[*]Weird shadows randomly appearing temp FIXED[*]Laser beam starts inside the emitter and not in front of it[/list]
    To do:
    [list][*]Be able to make the laser ignore some props ADDED[*]New effects (Scripted Effects)[/list]
    If you find another bug, I'll try to fix it as soon as possible.
    Reply With Quote Edit / Delete Reply Show Events Lua King Lua King x 15Useful Useful x 10Agree Agree x 3Dumb Dumb x 2 (list)

  2. Post #2
    Ex-Least Respected Usergroup
    icemaz's Avatar
    June 2007
    7,095 Posts
    Fucking AWESOME. Lua kinged and adding to my server
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Dumb Dumb x 2Agree Agree x 2Friendly Friendly x 1 (list)

  3. Post #3
    Raptor -TT-'s Avatar
    August 2007
    50 Posts
    woah, good idea with mirrors :D
    Reply With Quote Edit / Delete Reply Czech Republic Show Events Agree Agree x 2 (list)

  4. Post #4
    Fox-Face's Avatar
    June 2008
    244 Posts
    Finally you released it! Great work!
    Reply With Quote Edit / Delete Reply Brazil Show Events Agree Agree x 1 (list)

  5. Post #5
    Teh_Cheese's Avatar
    June 2008
    3,707 Posts
    Wow! This is great. I never thought you could do so much in lua!

  6. Post #6
    SteamDB
    Marlamin's Avatar
    November 2007
    10,902 Posts
    Awesome!

  7. Post #7
    Urablahblah's Avatar
    March 2008
    6 Posts
    Awesome! Is there a way to make it take power if LS is enabled? That would make it more compatible with SB. Still... AWESOME!

  8. Post #8
    CNiall's Avatar
    January 2008
    390 Posts
    Given that LS3 is coming out fairly soon (note fairly) if I recall correctly, it may be better if madjawa leaves LS compatibility until the full release of LS3 if he (she?) decides to implement it.

  9. Post #9
    Dennab
    January 2008
    121 Posts
    CNiall posted:
    Given that LS3 is coming out fairly soon (note fairly) if I recall correctly, it may be better if madjawa leaves LS compatibility until the full release of LS3 if he (she?) decides to implement it.
    Also LS2 compatibility for people that don't like LS3.

  10. Post #10
    Gold Member
    BlackWind's Avatar
    May 2008
    1,959 Posts
    I have not tested it yet, so i don't know the full functions, but for the next update could you make it have the effect that you can choose whether it could kill you or not, pp buddys (prop protection), nobody (except npcs), i bit like Anti-noclip. (If you use Anti noclip)


    EDIT:

    And What do you mean, Mirrors? do you have to materialize the props?

  11. Post #11
    phrostwave's Avatar
    February 2008
    23 Posts
    works great, nice job on this madjawa :excited:

  12. Post #12
    Gold Member
    Nevec's Avatar
    June 2008
    1,091 Posts
    Awesomeness cannot describe this.

    If you decide to make an LS dependant version then you should also add GCombat and/or CDS support. So that we can drill holes into ships. :D

    Edit:

    Hm. It seems that I found a bug.

    Whenever a laser kills an NPC it kinda creates two ragdolls, one is invisible and gets disintegrated but the other stays as it is.

    I looked at your code and it may be because you aren't removing the created ragdoll entity. When you fire the disintegrate entity it creates a separate model to be disintegrated, so you still have to remove the NPC ragdoll entity. It works fine for players, though.

  13. Post #13
    TheLinxV3's Avatar
    July 2008
    149 Posts
    holy carp
    Reply With Quote Edit / Delete Reply Sweden Show Events Funny Funny x 1 (list)

  14. Post #14
    Dennab
    January 2008
    355 Posts
    How does one rebuild the VGUI in the qmenu? Beacuse I can spawn the wiremod laser model fine, but in the VGUI it shows up as an error.

  15. Post #15
    Zaitzev's Avatar
    May 2005
    291 Posts
    I've been hoping for some update on the laser, and here it is! Awesome! You're a Lua King for sure! :D

  16. Post #16
    Shad0wStrike's Avatar
    February 2008
    4 Posts
    Bouncing lasers! :excited:

  17. Post #17
    Gold Member
    terrorclaw's Avatar
    March 2005
    502 Posts
    Well, I have a question, Why does it only bounce three or four times, and is there a way to change it so it can bounce more then that..?

  18. Post #18
    Gold Member
    madjawa's Avatar
    March 2005
    644 Posts
    terrorclaw posted:
    Well, I have a question, Why does it only bounce three or four times, and is there a way to change it so it can bounce more then that..?
    I made that to avoid infinite bouncing with two parallel mirrors. And to avoid general lag too. You can change that in the file Laser STOOL 2/lua/entities/gmod_laser/shared.lua, change the variable "LASER_MAXBOUNCES" at line 19 (I plan to make a convar for this, and maybe increase the default value if it doesn't lag too much)

    Also thanks Nevec, I'm looking into this ragdoll bug.

  19. Post #19
    Gold Member
    Kogitsune's Avatar
    September 2005
    2,796 Posts
    I was talking with Arkantos about the exact thing madjawa just said :). Pretty cool update there, madjawa. Nice job.

  20. Post #20
    Gold Member
    Arkantos's Avatar
    July 2006
    974 Posts
    Awesome tool.

    Found a little bug with pushing props. Instead of them flying away, it would slowly pull them towards the laser emitter.

  21. Post #21
    Gold Member
    -Chief-'s Avatar
    August 2007
    3,636 Posts
    Nice.

    Have a Lua King.

  22. Post #22
    nebe123's Avatar
    July 2008
    272 Posts
    where do you get mirrors

  23. Post #23
    Gold Member
    Kogitsune's Avatar
    September 2005
    2,796 Posts
    It's a SENT in the download.

  24. Post #24
    Gold Member
    madjawa's Avatar
    March 2005
    644 Posts
    Arkantos posted:
    Found a little bug with pushing props. Instead of them flying away, it would slowly pull them towards the laser emitter.
    I thought I fixed this :uhoh: Were you using mirrors? And what prop was it if you remember? I can't reproduce this bug.

    Nevec posted:
    Whenever a laser kills an NPC it kinda creates two ragdolls, one is invisible and gets disintegrated but the other stays as it is.

    I looked at your code and it may be because you aren't removing the created ragdoll entity. When you fire the disintegrate entity it creates a separate model to be disintegrated, so you still have to remove the NPC ragdoll entity. It works fine for players, though.
    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..

  25. Post #25
    Gold Member
    Kogitsune's Avatar
    September 2005
    2,796 Posts
    madjawa posted:
    I thought I fixed this :uhoh: Were you using mirrors? And what prop was it if you remember? I can't reproduce this bug
    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.

  26. Post #26
    nebe123's Avatar
    July 2008
    272 Posts
    Kogitsune posted:
    It's a SENT in the download.


    thank you

    Edit:

    Nevec posted:
    Awesomeness cannot describe this.

    If you decide to make an LS dependant version then you should also add GCombat and/or CDS support. So that we can drill holes into ships. :D

    Edit:

    Hm. It seems that I found a bug.

    Whenever a laser kills an NPC it kinda creates two ragdolls, one is invisible and gets disintegrated but the other stays as it is.

    I looked at your code and it may be because you aren't removing the created ragdoll entity. When you fire the disintegrate entity it creates a separate model to be disintegrated, so you still have to remove the NPC ragdoll entity. It works fine for players, though.


    download the derstebment mod the corpses blow up
    Reply With Quote Edit / Delete Reply United States Show Events Dumb Dumb x 1 (list)

  27. Post #27
    Gold Member
    madjawa's Avatar
    March 2005
    644 Posts
    Kogitsune posted:
    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.
    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 :D I think I will upload the updated version when I get the NPCs ragdoll bug fixed.

  28. Post #28
    Large Aqua's Avatar
    June 2008
    256 Posts
    HOLY FUCKING FUCK FUCK FUCK

  29. Post #29
    Gold Member
    Nevec's Avatar
    June 2008
    1,091 Posts
    madjawa posted:
    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..
    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.

  30. Post #30
    Gold Member
    Kogitsune's Avatar
    September 2005
    2,796 Posts
    Sandbox replaces the NPC entity in the undo list with the ragdoll.

  31. Post #31
    Gold Member
    Nevec's Avatar
    June 2008
    1,091 Posts
    None the less, you can get the ragdoll entity, somehow.

  32. Post #32
    Gold Member
    madjawa's Avatar
    March 2005
    644 Posts
    For the moment, the only way I found is to search the NPC's ragdoll when killing it:
    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

    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:

  33. Post #33
    There's only one person in this whole world like you. And people can like you exactly as you are.
    Lambda 217's Avatar
    March 2008
    4,504 Posts
    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"

  34. Post #34
    Gold Member
    Kogitsune's Avatar
    September 2005
    2,796 Posts
    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 :(.

  35. Post #35
    Gold Member
    Block's Avatar
    December 2006
    777 Posts
    Yay for lasers! Awesome addon!

  36. Post #36
    Gold Member
    madjawa's Avatar
    March 2005
    644 Posts
    Kogitsune posted:
    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 :(.
    I searched for CreateEntityRagdoll in code.garrysmod.com and I found this:
    http://code.garrysmod.com/?show=/gar...e/init.lua#214

    So I tried this:
    function AssignNPCRagdoll( entity, ragdoll )
    	entity.DeathRagdoll = ragdoll;
    end
    
    hook.Add( "CreateEntityRagdoll", "AssignNPCRagdoll", AssignNPCRagdoll ) 

    And it worked! I can dissolve the NPC's ragdoll :D
    Thanks you very much :)

    Edit:

    Block posted:
    Yay for lasers! Awesome addon!
    Awesome!

  37. Post #37
    There's only one person in this whole world like you. And people can like you exactly as you are.
    Lambda 217's Avatar
    March 2008
    4,504 Posts
    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.

  38. Post #38
    I will huff and puff and FLIP YOUR FUCKING TABLES
    Lyokanthrope's Avatar
    October 2005
    7,127 Posts
    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/s...5&postcount=35
    Without faking it.
    Also, sorry for any grammatical errors, I woke up 12 minutes ago.

  39. Post #39
    Gold Member
    Arkantos's Avatar
    July 2006
    974 Posts
    Now a prism would be cool, put a white laser through, and a colorful shotgun effect of lasers comes out.

  40. Post #40
    JamieH is a retarded bitch <3
    Pantho's Avatar
    July 2008
    2,191 Posts
    Been playing with this all day, it's great only problem

    cvar for max lasers please ?