• lua_reloadent
    70 replies, posted
[url=http://www.garrysmod.org/downloads/?a=view&id=131147][img]http://www.garrysmod.org/img/?t=dll&id=131147[/img]Download[/url] [b]What it does[/b] lua_reloadent reloads the code of a single entity, weapon or tool type. [b]Advantages over lua_reloadent[i]s[/i][/b] It's a lot more reliable and less intrusive than lua_reloadent[i]s[/i]. With lua_reloadent[i]s[/i], you usually have to rebuild your test contraption if there was any "complex" component in it. Reloading a single entity class with lua_reloadent will most likely not break anything, apart for some pitfalls. Read the "pitfalls" section of the description in the Lua file for more details. [b]How to use[/b] lua_reloadent class/toolmode For more info see the "Usage" section of the description in the Lua file. [b]Version history[/b] 1.5.2 - You can now choose whether to reload a tool, SENT or SWEP. See the "Usage" section in the Lua file for how. 1.5.1 - Fixed an oversight error in the gmod13 support for weapons. 1.5.0 - Added support for the current GMod 12/13 versions. (as of 2012-06-15) 1.4.1 - Auto-complete is now case-insensitive. Fixed a server-side Lua error in lua_loadent. 1.4 - Added auto-completition for both server-side and client-side lua_reloadent* commands 1.3 - lua_(re)loadent now looks into the current gamemode's directory as well. It's just using FindInLua now. 1.2.1 - lua_loadent now fills all necessary fields for both SENTs and SWEPs 1.2 - Made lua_loadent work with SWEPs as well 1.1 - Added lua_loadent 1.0 - First public release [b]GitHub[/b] I put all my stuff on GitHub. lua_reloadent is available at: [url]https://github.com/TomyLobo/lua_reloadent[/url] This URL can also be used by an SVN client. [url=https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5JWSR7NT8VJKJ][img]https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif[/img][/url]
I fucking love you. Feature this in Garry's Mod! EDIT: It works completely flawlessly and even displays lua errors (if the reloaded file has any), god bless you. EDIT2: [b]Request: if possible, make a lua_loadent, to load newly created entities[/b]
loading new ents is a bit more complicated. mostly due to [url=http://wiki.garrysmod.com/?title=Scripted_ents.Register]scripted_ents.Register[/url] being undocumented :)
misread OP
[QUOTE=TomyLobo;15961949]loading new ents is a bit more complicated. mostly due to [url=http://wiki.garrysmod.com/?title=Scripted_ents.Register]scripted_ents.Register[/url] being undocumented :)[/QUOTE] Liar... (Refresh the page)
[QUOTE=Deco Da Man;15964182]Liar... (Refresh the page)[/QUOTE] Like a hawk, like a hawk. [editline]08:06PM[/editline] This is awesome, thank you very much for this :3
Added lua_loadent, updated first post. Thanks, deco
I can't load SWEPs, everytime I use it with "lua_loadent file" it gives me [code]No source file for entity 'file' found.[/code] Entities appearently work fine [b]Well yeah, reloadent works fucking perfectly without any problems (Single and multiplayer) and hell I love you for that :P[/B] But anyway, please add support for autorun files if you can!
you can just use lua_openscript(_cl) on autorun files :D SWEPs as well? man you're lazy [editline]04:51AM[/editline] Made lua_loadent work with SWEPs as well, updated first post
Well lua_(re)loadent certainly saves a lot time since it's literally instantly, so why not have it work with everything? :P [b]Edit:[/B] when loading a swep it gives me the error: [code]attempt to index field 'Primary' (a nil value)[/code] which is [lua]SWEP.Primary.Recoil = 1[/lua]
meh, i'm more of a builder type, so I didn't make any weapons yet. make a list of stuff that is expected to be there :) EDIT: or I could just put PrintTable(SWEP) in an otherwise empty shared.lua :D [editline]05:21PM[/editline] lua_loadent now fills all necessary fields for both SENTs and SWEPs. first post updated.
Hmm. Does it allow you to load multiple entities in one concommand? Then you could do: bind / "lua_reloadent sent_exploder sent_magical sent_destructo" Or perhaps works with a prefix. Like "lua_reloadent oe_*" :)
So far, when I do lua_reloadent on a weapon defined in gamemodes/[gamemode]/entities/weapons/, it gives me an error for being unable to find the file to load.
-stupid post-
[QUOTE=TheGreatVax;15991392]"lua_reloadent <ent>; <ent>; ent>" (It would work like that) Would be a nice addition[/QUOTE] ; would not work as seperator since it's the source seperator It would look like this: [code] ] lua_reloadent sent_omg1; sent_omg2; sent_omg3 > lua_reloadent sent_omg1 Unknown command: sent_omg2 Unknown command: sent_omg3 [/code] It would work if you put " around the arguments (lua_reloadent "sent_omg1; sent_omg2; sent_omg3")
Do you make a SVN version?
[QUOTE=The-Stone;15995235]; would not work as seperator since it's the source seperator It would look like this: [code] ] lua_reloadent sent_omg1; sent_omg2; sent_omg3 > lua_reloadent sent_omg1 Unknown command: sent_omg2 Unknown command: sent_omg3 [/code] It would work if you put " around the arguments (lua_reloadent "sent_omg1; sent_omg2; sent_omg3")[/QUOTE] Or, simply lua_reloadent sent_omg1 sent_omg2 sent_omg3.
lua_reloadent sent_omg1; lua_reloadent sent_omg2; lua_reloadent sent_omg3 [editline]08:40PM[/editline] [QUOTE=Gbps;15987804]So far, when I do lua_reloadent on a weapon defined in gamemodes/[gamemode]/entities/weapons/, it gives me an error for being unable to find the file to load.[/QUOTE] then gmod set the "Folder" field wrong. I have no idea how to fix that though.
[QUOTE=TomyLobo;16001558]then gmod set the "Folder" field wrong. I have no idea how to fix that though.[/QUOTE]GAMEMODE.Folder is "gamemodes/[name]", rather than "[name]"
thanks. never made a gamemode so far. I'll see if i can add this without complicating the code too much I meant ENT/SWEP.Folder is set wrong, btw [editline]12:54AM[/editline] I simply made it use file.FindInLua now. I hope that coincides with what can be include()d :) if it doesn't work, I'll need to check it manually
This is amazing. I love you.
Your babies. Let me have them.
domo arigato, mr roberto
Have to admit it is very useful. It's stupid that you have to restart your server which takes billion years to see the results when you've teweaked your swep.
1.4 - Added autocomplete for lua_reloadent* commands first post updated.
Unknown command '_lua_reloadent' .
Bletotum this is a server-side script. And its use is mainly development in single-player mode.
I was developing in single-player. I got - the - error, when trying to use this addon for a script with alot of parenting offsets to get updated constantly... 'lua_reloadent flag_red' . And I got - the mentioned error. Lua_reloadent_cl does not update - the server's loaded code, I still have to reload the map... Lua_reloadent_sv gives the same - error. >.>...
My god, PLEASE tell me this reloads gamemode without taking years, because if it does, I will love you. I will give you good ratings every post you make. This will help rocket my development of my gamemode to the nth degree.
@Bletotum the server-side part of the script isn't initialized properly if that command is missing. there's probably a conflicting addon or something. Did you get any Lua errors on the server? Is the file "lua_reloadent.lua" in garrysmod\addons\lua_reloadent\lua\autorun\lua_reloadent.lua? @Killer_Steel This will not reload the whole gamemode, but you can reload entities, weapons and tools within it. For autorun scripts use lua_openscript(_cl)
Sorry, you need to Log In to post a reply to this thread.