Is there a function base anywhere that tells what each function does, like how they operate?
I know about the gmod wiki and such and that it tells how to use the function, but is there anything anywhere that shows what goes on within the functions.
I want to make my own custom FireBullets function.... and I'm trying to find the base code for it so I know what I can change about it for my own personal sweps. There are a number of other functions I would like to know how they work but I can't seem to find anywhere the function bases...
Help?
As linked to in the lua documentation sticky : [url]http://code.garrysmod.com[/url]
:science:
That's the source code for the part of Garry's Mod that's scripted in lua. Keep in mind that many functions are defined in the .dll files because they are originally c++ functions so their source is not available there.
[QUOTE=Crazy Quebec;18532906][url]http://code.garrysmod.com[/url]
:science:[/QUOTE]
My friend already gave me that... it doesn't give me any different information than any of the addons in my folder currently
Are you sure?
[url]http://luabin.foszor.com/code/gamemodes/base/entities/weapons/weapon_base[/url]
That's the souce of the weapon every scripted weapon is based on. That means it has code in it most scripted weapons don't need to include. It shows the use of SWEP:ShootBullet() quite clearly.
Note that all of that code is also present in the Garry's Mod gcf archive.
[QUOTE=Crazy Quebec;18533035]Are you sure?
[url]http://luabin.foszor.com/code/gamemodes/base/entities/weapons/weapon_base[/url]
That's the souce of the weapon every scripted weapon is based on. That means it has code in it most scripted weapons don't need to include. It shows the use of SWEP:ShootBullet() quite clearly.
Note that all of that code is also present in the Garry's Mod gcf archive.[/QUOTE]
ShootBullets is NOT fire bullets.
Notice the only thing it says about firebullets is
self.Owner:FireBullets( bullet )
I want to see the base of that function, see indepth how it generates the bullets with offsets and such.
Did you even go to the link I gave you? It told you everything you needed to know about the structure of a bullet, you don't really need more then that unless you really need to do something completely different that doesn't shoot regular bullets. In that case since FireBullets is a Source Engine function that is not defined not defined in lua you will have to create it from scratch and to replicate what it does. Maybe you could tell us what it is you want to make that requires modifying FireBullets.
[editline]1[/editline]
And if you must know the actual source of firebullets is probably available in the source code supplied by the source SDK when you create a mod. In C++ of course.
[editline]2[/editline]
Note that all firebullets really does is perform a trace and apply damage and force to whatever it hits. It also makes a tracer effect once in a while.
[QUOTE=Crazy Quebec;18533506]Did you even go to the link I gave you? It told you everything you needed to know about the structure of a bullet, you don't really need more then that unless you really need to do something completely different that doesn't shoot regular bullets. In that case since FireBullets is a Source Engine function that is not defined not defined in lua you will have to create it from scratch and to replicate what it does. Maybe you could tell us what it is you want to make that requires modifying FireBullets.
[editline]1[/editline]
And if you must know the actual source of firebullets is probably available in the source code supplied by the source SDK when you create a mod. In C++ of course.
[editline]2[/editline]
Note that all firebullets really does is perform a trace and apply damage and force to whatever it hits. It also makes a tracer effect once in a while.[/QUOTE]
Yeah but I also want to know exactly how the spread is generated lol. Where the math.Rand funtion seeds from etc.
[url=http://luabin.foszor.com/code/lua/includes/extensions/math.lua#71]math.Rand source[/url]
If you really want to take a look at the C++ code, download source sdk and create a mod from source only. This gives us as close to the actual code to things as we can get without an engine license, I suppose.
[QUOTE=Kogitsune;18534196][url=http://luabin.foszor.com/code/lua/includes/extensions/math.lua#71]math.Rand source[/url]
If you really want to take a look at the C++ code, download source sdk and create a mod from source only. This gives us as close to the actual code to things as we can get without an engine license, I suppose.[/QUOTE]
That's no help there because I didn't know the math.Rand uses math.Random lol.. which then I would also need that.
Thank's for the link though, i searched that before and couldn't find it.
I've seen the CSS source code online.. Ill have to find it and download it.
If you want to get inside math.random's head, or other Lua functions that are built-in, you could download the most recent source of Lua, [url=http://www.lua.org/ftp/lua-5.1.4.tar.gz][noparse][Link][/noparse][/url], but that's more recent than the current version in garrysmod, and I don't know what functions garry has altered in other than the ones he removed.
Is this just a disguised attempt to have us help you make a no-spread hack? Because I don't know what else you would need that stuff for. Also FireBullets' random function is probably c++ based and not lua based since it is defined in the source engine.
[QUOTE=Crazy Quebec;18534643]Is this just a disguised attempt to have us help you make a no-spread hack? Because I don't know what else you would need that stuff for. Also FireBullets' random function is probably c++ based and not lua based since it is defined in the source engine.[/QUOTE]
Yeah I realize a nospread hack would have to be in c++, and the fire bullets probably is in the the c++ source of source engine... but it can still be called in lua.
Personally I'm not trying to strictly make a nospread hack, certinaly not for release. Right now it's just for education purposes since i'm bored here and nothing else to do/only thing to do online for me atm. A nospread hack is the last thing we need being released for garrymod, but I like learning crap ranging from hacks to hack prevention. I figure being able to predict the next number in a RNG would be useful not just for a nospread hack but for many others things involving one. I'm just curious.
Sorry, you need to Log In to post a reply to this thread.