[QUOTE=Atebite;52556411]I've been trying to figure out stencils for a while, and it finally clicked! Decided to work on some fancy barriers that can move in and out of the ground.
[video]https://youtu.be/6aFjLtYa-Gs[/video][/QUOTE]
Now what happens if you stand on it while it rises?
[QUOTE=Nookyava;52556627]Now what happens if you stand on it while it rises?[/QUOTE]
[media]https://www.youtube.com/watch?v=0TZd95BCKMY[/media]
Finished learning how to use Lerp smoothly
[video]https://youtu.be/syluWD1lwjQ[/video]
[QUOTE=rtm516;52548910]How did the road map on you gmod screenshot in the bottom left, get rendered? Is it based on a premade texture or is it created based on the world?[/QUOTE]
It's simply just a 2D displacement material (one material grass, other part road).
So the road is flat and a separate displacement, and the ground is alternate displacement. Everything was created off of the source engine limits. Shrinking stuff down made the map enjoyable and seem like it never ends.
I essentially scaled all the physics calculations *0.05.
The vehicles were the most difficult to get just right,
but I ended up succeeding and making the map bigger.
About the time I stopped working on
this project, I learned C++ and it blew my mind!
I probably will never finish it... I feel horrible I never released it!
No one could appreciate the effort it took to write physics like I could.
0.05 was possible mainly because..
of 3DS Max && Wall-Worm Pro.
VMF Exporter allowed me to import REALLY good displacements(now export since new-project). It was how most of my race-tracks were made smooth.
Here's a few old pictures, so could see what I mean:
[t]https://cdn.discordapp.com/attachments/287162509763280897/345388749548683264/C_378.jpg[/t]
[t]https://cdn.discordapp.com/attachments/287162509763280897/345391813063868417/C_425.png[/t]
[t]https://cdn.discordapp.com/attachments/287162509763280897/345392456663040001/C_367.png[/t]
[t]https://cdn.discordapp.com/attachments/287162509763280897/345395239982465024/C_411.png[/t]
i went ahead and added some of my own effects to the teleporter. i spent hours trying to get the destination "peeking" to work, because [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/render/RenderView]render.RenderView[/url] can get [i]real[/i] fucky with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/PixelVisible]util.PixelVisible[/url].
anyways here it is:
[video=youtube;ooDC45g07kU]http://www.youtube.com/watch?v=ooDC45g07kU[/video]
Over the past month [URL="http://www.github.com/MysteryPancake/Rule-Book"]I've made a rule book[/URL] so I don't forget stuff and make stupid mistakes.
A lot of it is specific to how I like doing things, but I'm just posting it here so everyone can tell me what I got wrong.
[QUOTE=MPan1;52561805]Over the past month [URL="https://github.com/MysteryPancake/Rule-Book"]I've made a rule book[/URL] so I don't forget stuff and make stupid mistakes.
A lot of it is specific to how I like doing things, but I'm just posting it here so everyone can tell me what I got wrong.[/QUOTE]
[quote]for loops must be used, not while, repeat, or until loops.[/quote]
Why?
Otherwise it's mostly style.
[QUOTE=FPtje;52562006]Why?[/QUOTE]
It's specific to how I like to do things, but a while or repeat or until loop has the potential to repeat endlessly and crash the game if a single variable doesn't get changed correctly, for example:
[CODE]
while true do
[/CODE]
It is much harder to crash the game at all with a for loop, if not impossible. Also, I haven't encountered any incidences so far where any of those kinds of loops would be applicable or favourable over a for loop.
Sorry, I don't want to clog this thread, so if anyone can find dodgy rules then please put it as an issue on the GitHub page (if you want)
[QUOTE=MPan1;52562024]It's specific to how I like to do things, but a while or repeat or until loop has the potential to repeat endlessly and crash the game if a single variable doesn't get changed correctly, for example:
[CODE]
while true do
[/CODE]
It is much harder to crash the game at all with a for loop, if not impossible. Also, I haven't encountered any incidences so far where any of those kinds of loops would be applicable or favourable over a for loop.
Sorry, I don't want to clog this thread, so if anyone can find dodgy rules then please put it as an issue on the GitHub page (if you want)[/QUOTE]
Sometimes it's impossible to use a for loop because you aren't doing numeric or sequential iteration. For example when actually [I]making [/I]iterators like this:
[code]
do ---- Word iterator ------------------
local whitespace = {
[0x0009] = CK_TAB,
[0x000A] = CK_LINE,
[0x000B] = CK_SPACE,
[0x000C] = CK_SPACE,
[0x000D] = CK_LINE,
[0x0020] = CK_SPACE,
}
function worditer(str)
local iterator = utf8.codes(str)
local ltPos, ltChar = iterator()
local ltKind = whitespace[ltChar]
local rtPos, rtChar, rtKind
local wordPos, endPos = 1, 1
return function()
while true do
if not wordPos then break end
local word, wType = nil
rtPos, rtChar = iterator()
rtKind = whitespace[rtChar]
if not rtPos or rtKind ~= ltKind then
endPos = (rtPos or 0) - 1
word = str:sub(wordPos, endPos)
wType = ltKind or CK_NONE
wordPos = rtPos
end
ltPos, ltChar, ltKind = rtPos, rtChar, rtKind
if word then return word, wType end
end
return nil
end
end
end ------------------------------------
[/code]
I made a circular audio visualizer for a project
[video=youtube;dDqrLU9hkRw]https://www.youtube.com/watch?v=dDqrLU9hkRw[/video]
Also shoutout to swadicalrag helping me out with the smoothing function for this
[QUOTE=mitterdoo;52560708]i went ahead and added some of my own effects to the teleporter. i spent hours trying to get the destination "peeking" to work, because [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/render/RenderView]render.RenderView[/url] can get [i]real[/i] fucky with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/PixelVisible]util.PixelVisible[/url].
anyways here it is:
[video=youtube;ooDC45g07kU]http://www.youtube.com/watch?v=ooDC45g07kU[/video][/QUOTE]
Wow I sure don't know how the fuck that works
Another thing to learn, I suppose
Edit: Also I think my preference, were I doing that myself, would be to have the spinning things be exactly synced up between start and destination and to have the world outside of the teleporter fade from one location to the other with the teleporter appearing to not change due to both sides being identical.
[QUOTE=MPan1;52561805]Over the past month [URL="https://github.com/MysteryPancake/Rule-Book"]I've made a rule book[/URL] so I don't forget stuff and make stupid mistakes.
A lot of it is specific to how I like doing things, but I'm just posting it here so everyone can tell me what I got wrong.[/QUOTE]
The Lua section is interesting and helpful. Does anybody else have anything to add to this?
[IMG]https://i.gyazo.com/8babe46e79c50f35a97372f666e214fc.png[/IMG]
*So many mixed flavors and reactions to this one. I just posted it as a bit of a joke people. But watch the add-ons section. Hotfire dropping soon.
[QUOTE=TheCloak;52562543]The Lua section is interesting and helpful. Does anybody else have anything to add to this?[/QUOTE]
Check the issues.
Decided to make a cooking mod, where players will be able to create their own recipes, level up their cooking skill, create modular sandwiches and all of this stuff, all of this trying to retain the dynamic part of the addon in tact, you won't simply touch two ingredients to make something. You'd need to cut some of ingredients, boil them. So far the interaction module is planned to be drag'n'drop - you click E on one thing, drag the mouse above the other (the 1st selected prop doesn't actually move) and wzoom, it combines. Imagine; meat seasoning, salads and stuff like that. The recipe will probably be "guessed" by the code at the very beginning - for example - if player puts water into a pot, then he either is going to boil something, or start making a soup - He adds sasuages, okay, so far its boiling, but then he adds vegetables, so if theres x amount of meat and veggies, then it should become a soup. I plan on adding stuff like poison as well, or even some more stuff, but that is uncertain, my vision is to make some players the best at baking the bread, making their own bakeries, while some people might be good at smoking meat. The more people do that action, the better they get, also, I'd probably hardcode some "ideal" proportions - Well, we can't taste in game, so at least I can estimate how good something will be, right? Thought of a point system - Strawberries with cocoa and chicken? Well chicken doesn't mix with either, so -2 points, but cocoa might mix with strawberries, which gives +3 bonus, depending how well the hardcoded values mix with each other, enabling people to discover new dishes, that provide many bonuses - and they could name them too.
But as we all know, plans doesn't always work out because poor execution. I have done in my past somewhat okayish stuff, and I have no idea if I have took on, on something that could easily overburden my skills. Saying all of that, and showing that, makes me feel kind of dumb (who knows if I ever post a status update on that ever again?) but, there you go, I used Matts 3d2d lib to project derma in the world. I still have to work with somebody on custom models, but that is a start.
People could've probably made that in 3 hours or even less, but I did that in 6h + ~2h learning and researching stuff.
[vid]https://www.dropbox.com/s/8focya7fe60yfo3/2017-08-11_20-14-46.mp4?dl=1[/vid]
Overall, wish me luck :)
edit: how the hell do I embed a dropbox video on facepunch?
edit2: kk figured it out
[QUOTE=MPan1;52562024] Also, I haven't encountered any incidences so far where any of those kinds of loops would be applicable or favourable over a for loop.
[/QUOTE]
[url=https://en.wikipedia.org/wiki/Breadth-first_search]Breadth First Search (BFS)[/url], used for example in [url=https://github.com/FPtje/Falcos-Prop-protection/blob/master/lua/fpp/server/ownability.lua#L388]FPP[/url] to efficiently iterate over contraptions.
The [url=https://en.wikipedia.org/wiki/Disjoint-set_data_structure]find[/url] operation of disjoint sets. Defined recursively on the wiki, generally implemented more efficiently with a while loop in imperative languages. I implemented it in my [url=https://github.com/FPtje/DarkRP/blob/master/gamemode/libraries/disjointset.lua#L55]disjoint set[/url] library, which is used to create "demote groups". Get demoted from one job, and you'll be banned from getting any of the jobs in its group. Algorithmic complexity of the [I]Find [/I]function is in the order of the "inverse Ackerman" function, which is a CS term for "hella fast" :v:. For the couple hundred jobs people create [I]at most[/I], disjoint sets are pretty damn overkill, but cool nonetheless :v:
While loops are useful when you don't know the size of the thing you're iterating over beforehand. With BFS you won't know you're done iterating until you find no more nodes to iterate over. Disjoint sets are graphs, and "find" is a search operation. In the rare occasion that the loop [I]isn't[/I] just one iteration, you won't know how few iterations are left.
repeat-until loops are useful as while loops of which you're certain that at least [I]one[/I] iteration must be performed. In [url=https://github.com/FPtje/DarkRP/blob/master/gamemode/modules/fpp/pp/client/ownability.lua#L28]this[/url] case it's used to process a variable length net message. I'd have to introduce variables if I were to use a while loop. Besides, the code intuitively shows that the "[I]is this the end yet[/I]" bit comes [I]after[/I] every chunk of data.
repeat-until is the best way in Lua to do an infinite loop, as well, since it is a post-check.
[QUOTE=code_gs;52562810]repeat-until is the best way in Lua to do an infinite loop, as well, since it is a post-check.[/QUOTE]
Sorry, that spot is reserved for goto :excited:
[QUOTE=FPtje;52562872]Sorry, that spot is reserved for goto :excited:[/QUOTE]
The best way that's compatible thru all Lua versions :v:
Recursion ftw
[lua]
local garbage = {
"Fuck",
"Balls",
"Loops",
"trash",
75
}
local function loop(arr)
local de =
{
i = 0,
max = #arr
}
function de:loop()
if self.i < self.max
then
print(arr[self.i])
self.i + 1
self:loop()
end
end
return de:loop()
end
[/lua]
Also google recursion. It took me 5 times to realize what was going on..
[QUOTE=TheCloak;52562543]The Lua section is interesting and helpful. Does anybody else have anything to add to this?[/QUOTE]
I probably shouldn't have posted this. It was really only meant for me to use but I guess I should make it more applicable for actual people
[QUOTE=marvincmarvin;52563112]Recursion ftw
[lua]
local garbage = {
"Fuck",
"Balls",
"Loops",
"trash",
75
}
local function loop(arr)
local de =
{
i = 0,
max = #arr
}
function de:loop()
if self.i < self.max
then
print(arr[self.i])
self.i + 1
self:loop()
end
end
return de:loop()
end
[/lua]
Also google recursion. It took me 5 times to realize what was going on..[/QUOTE]
Problem with recursions like this is stack overflow.
[QUOTE=James xX;52564375]Problem with recursions like this is stack overflow.[/QUOTE]
Actually the code in question can be made to use tail calls by replacing `self:loop()` with `return self:loop()`. At least LuaJIT [i]should[/i] do it in this case, if it doesn't – oh well.
[QUOTE=mitterdoo;52560708]i went ahead and added some of my own effects to the teleporter. i spent hours trying to get the destination "peeking" to work, because [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/render/RenderView]render.RenderView[/url] can get [i]real[/i] fucky with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/PixelVisible]util.PixelVisible[/url].
anyways here it is:
[video=youtube;ooDC45g07kU]http://www.youtube.com/watch?v=ooDC45g07kU[/video][/QUOTE]
where did you get the particle effects from?
[QUOTE=dr.dray_7;52564803]where did you get the particle effects from?[/QUOTE]
They came from HL2. Just look up HL2 particle effects online and you'll find it.
[img]http://i.imgur.com/Z8Rvjj6.gif[/img]
Ideas?
I don't want to so offensive or agressive, but that would be the best addition of this year into garrysmod for users if that gets implemented
I know that gmod is a game where modders extends it...But gmod 13 gave us LOTS of stuff and made awesome changes
It's almost as if it's [URL="http://steamcommunity.com/sharedfiles/filedetails/?id=891116528"]my add-on[/URL] or something. [B]You're ripping me off Rubat.[/B]
just kidding
[QUOTE=Tenrys;52565740]It's almost as if it's [URL="http://steamcommunity.com/sharedfiles/filedetails/?id=891116528"]my add-on[/URL] or something. [B]You're ripping me off Rubat.[/B]
just kidding[/QUOTE]
Careful he might blacklist you from the workshop. He's cray cray.
[QUOTE=Robotboy655;52565644][img]http://i.imgur.com/Z8Rvjj6.gif[/img]
Ideas?[/QUOTE]
You would think this would have been implemented already.
Sorry, you need to Log In to post a reply to this thread.