Subscribe
 Post #1
 28th September 2007
Gold Member
tad2020's Avatar
December 2006
1,656 Posts
Resource Distribution 2

This is a rewrite of the Resource Distribution addon by Shanjaq.





Changes:
  • Speed improvements (like 200% faster)
  • Extremely low network traffic when using new overlay methods (see LS2)
  • No cutoff valve hax
  • New methods for beams (no disappearing ent bugs)
  • Full compatibility with existing addons that require RD
  • Lots of stuff I'll list later



New Functions:
See LS2 for how to use these funcitons
  • RD2_ToolRegister() -- quickly set up an RD2 stool with the fancy control panel selection
  • RD2_AddStoolItem() -- adds ent to a stool
--Still more that I need to list--



Downlaods:

Zip Version:
Delete all old versions first or you are a moron

Delete all old versions first or you are a moron
Extract to addons


SVN Version: there is no difference with this version, it will always be the same as the ZIP version
If you do not know how to use an SVN, then there is no reason to use this one at all, just get the ZIP version it is the same.

Make a new folder in your addons folder, call it "RD2" and do the checkout to there:
https://svn.wiremod.com/svn/RDistrib2/trunk/RD2/ << New Address! <<
User/Pass (if asked): anonsvn/anonsvn

DO NOT upload dumps of this SVN, there is no point, it will be at most the same as the current ZIP version.



What's Next:
I will begin working on SBx and RDx (which every version number it ends up being then) some day after I finish up a lot of other stuff. Don't expect anything anytime soon, nothing will be ready for testing for a very long time.

Ideas for RDx:
  • Custom defined resource networks
  • Different types of resources that are not just "liquid though a hose"
  • Quick and easy base classes for basic entities
  • new ideas
  • Move on think processes to RD core instead of each entity via emulated resource generator production (ie. 5 air gens on one net is the same as the air gen formula * 5)
  • Make core code independent of GMod specific lua as mush as possible to allow for non-GMod uses. Maybe just develop core code outside GMod using standard lua binaries and port for GMod for release.
 Post #2
 28th September 2007
MythBuster's Avatar
August 2007
309 Posts
Thank you very much again for this
 Post #3
 28th September 2007
Spacetech's Avatar
January 2006
813 Posts
If their are any tooltip problems with anything involving ls2 or cds or sb2 this is were you should probably post them.
 Post #4
 28th September 2007
Gold Member
LPine's Avatar
April 2007
2,469 Posts
Place Hold.
 Post #5
 28th September 2007
hedhunta95's Avatar
July 2007
943 Posts
Yay! Resource Distribution two! Thanks to the SB2 dev team! YOU GUYS ROCK!
 Post #6
 28th September 2007
gilly_54's Avatar
June 2006
932 Posts
Awesomeness!
 Post #7
 28th September 2007
Gold Member
LPine's Avatar
April 2007
2,469 Posts
hedhunta95 posted:
Yay! Resource Distribution two! Thanks to the SB2 dev team! YOU GUYS ROCK!
We know.
 Post #8
 28th September 2007
Beastmaster's Avatar
November 2006
680 Posts
LPine posted:
We know.
I smell smart ass, do you?
 Post #9
 28th September 2007
MythBuster's Avatar
August 2007
309 Posts
Beast he is part of the team he is just stating that they know lol
 Post #10
 28th September 2007
hedhunta95's Avatar
July 2007
943 Posts
Hurry TAD! We're waiting for RD2, then we can be like the SB people! And SB... if that's a verb.
 Post #11
 28th September 2007
MythBuster's Avatar
August 2007
309 Posts
I'm gonna start up a 6 person sb listen server once the link gets put up
 Post #12
 28th September 2007
Razot's Avatar
April 2007
61 Posts
where do i get svn and how do i use it
 Post #13
 28th September 2007
Froogle_'s Avatar
September 2006
893 Posts
MythBuster posted:
I'm gonna start up a 6 person sb listen server once the link gets put up
European?
 Post #14
 28th September 2007
PuddlePirate's Avatar
June 2007
282 Posts
Adding to my server as I type this message!
 Post #15
 28th September 2007
hedhunta95's Avatar
July 2007
943 Posts
I'll be hosting an SDS too.
 Post #16
 28th September 2007
MythBuster's Avatar
August 2007
309 Posts
No usa but what map should i get for it
 Post #17
 28th September 2007
hedhunta95's Avatar
July 2007
943 Posts
gm_solarsystem_v3? I heard that's a good map.
 Post #18
 28th September 2007
Beastmaster's Avatar
November 2006
680 Posts
For those too impatient to wait, the SVN is...

-snip?-
 Post #19
 28th September 2007
MythBuster's Avatar
August 2007
309 Posts
Ok thanks i'll download it and start up once he links up ill edit this post with the server name when i get it up
 Post #20
 28th September 2007
gilly_54's Avatar
June 2006
932 Posts
Razot posted:
where do i get svn and how do i use it
1. Download TortoiseSVN from here: http://tortoisesvn.tigris.org/
2. Install it
3. Go to your addons folder and create a folder called lifesupport(if you want to use svn for lifesupport 2 for example)
4. Right click on the folder you created and select SVN Checkout
5. Paste the SVN link in the main post above, into the "URL Repository" box
6. Let the program download all the files
7. ???
8. PROFIT!

You're done, when the team releases an update, just right click on your folder and select SVN Update.
 Post #21
 28th September 2007
physgun's Avatar
July 2007
294 Posts
this is epic!
 Post #22
 28th September 2007
PuddlePirate's Avatar
June 2007
282 Posts
Beastmaster posted:
For those too impatient to wait, the SVN is...
I don't think they wanted anyone to know that yet or else I would have posted that already :p
 Post #23
 28th September 2007
Razot's Avatar
April 2007
61 Posts
thanks alot
 Post #24
 28th September 2007
cmdrolly's Avatar
May 2007
227 Posts
It this still compatible with everything that used RS1?
 Post #25
 28th September 2007
hedhunta95's Avatar
July 2007
943 Posts
Thank you guys.
 Post #26
 28th September 2007
MythBuster's Avatar
August 2007
309 Posts
Server not up until the spacebuild game mode not showing up on the gamemode list is fixed and posting in the thread now
 Post #27
 28th September 2007
Gold Member
tad2020's Avatar
December 2006
1,656 Posts
Beastmaster posted:
For those too impatient to wait, the SVN is...

Code:
http://tools.assembla.com/svn/ResourceDistribution2
Oh thanks, now I have to delete it.
 Post #28
 28th September 2007
BlackPhoenix's Avatar
May 2006
1,428 Posts
Beastmaster posted:
For those too impatient to wait, the SVN is...

Code:
http://tools.assembla.com/svn/ResourceDistribution2
Why are you posting link that is closed (as in private), and is only for RD team?
 Post #29
 28th September 2007
SB2DevTeam's Avatar
September 2007
114 Posts
tad2020 posted:
Oh thanks, now I have to delete it.
No you don't. I revocked the read access for not team-members.
 Post #30
 28th September 2007
Omnimmotus's Avatar
August 2006
1,985 Posts
This should be fun.
 Post #31
 28th September 2007
BlackPhoenix's Avatar
May 2006
1,428 Posts
Link no longer valid, moved to another SECURE svn
 Post #32
 28th September 2007
Gold Member
tad2020's Avatar
December 2006
1,656 Posts
BlackPhoenix posted:
Link no longer valid, moved to another SECURE svn
Yeah, Assembla lacks access control modification to their SVNs.

Leaking of our and my dev SVNs is the quickest way to make the projects become abandoned. It better not happen again.
 Post #33
 28th September 2007
Kjakings's Avatar
August 2007
44 Posts
Beastmaster posted:
I smell smart ass, do you?
*sniffs* I don't smell any ass...:D

Edit:

hedhunta95 posted:
gm_solarsystem_v3? I heard that's a good map.
There's a v3?Where???????????????????

Edit:

hedhunta95 posted:
gm_solarsystem_v3? I heard that's a good map.
There's a v3?Where???????????????????
 Post #34
 28th September 2007
labalicious's Avatar
March 2006
158 Posts
Awesome! Awesome! AWESOME! Thank you so much. King to you and everyone else working on this.
 Post #35
 28th September 2007
Gold Member
ole johan's Avatar
December 2006
2,527 Posts
Kjakings posted:
*sniffs* I don't smell any ass...:D

Edit:



There's a v3?Where???????????????????
www.justfuckinggoogleit.com

( INSTABANNED Used the word justfuckinggoogleit )
 Post #36
 28th September 2007
T-362's Avatar
September 2006
5 Posts
Das it works correctly with TIBERIUM addon?
 Post #37
 28th September 2007
MythBuster's Avatar
August 2007
309 Posts
Kinda hard to google something that was never released
 Post #38
 28th September 2007
Spacetech's Avatar
January 2006
813 Posts
T-362 posted:
Das it works correctly wth TIBERIUM addon?
It probably doesn't. All lua coders will probably have to end up updating their mods.
 Post #39
 28th September 2007
DrMiles's Avatar
May 2007
35 Posts
Big thanks for new RD, and, by the way [spoiler]moron yourself :|[/spoiler]
 Post #40
 28th September 2007
MythBuster's Avatar
August 2007
309 Posts
Space can you fix the gamemodes folder in the spacebuild svn so it is
Code:
 gamemodes and not gamemode
so that it will load up
 Post #41
 28th September 2007
Spacetech's Avatar
January 2006
813 Posts
MythBuster posted:
Space can you fix the gamemodes folder in the spacebuild svn so it is
Code:
 gamemodes and not gamemode
so that it will load up
Did you even try to checkout?
Make a folder called spacebuild2 in your gamemodes folder and right click the spacebuild2 folder and checkout to the svn url.
 Post #42
 28th September 2007
MythBuster's Avatar
August 2007
309 Posts
Change it from addon format then or fix the gamemodes type in the svn because alot of people are having the same problem

and stop making me out as a fucking moron and just fix it without making excuses to not fix it
 Post #43
 28th September 2007
Gold Member
tad2020's Avatar
December 2006
1,656 Posts
MythBuster posted:
Space can you fix the gamemodes folder in the spacebuild svn so it is
Code:
 gamemodes and not gamemode
so that it will load up
Wrong thread.
 Post #44
 28th September 2007
MythBuster's Avatar
August 2007
309 Posts
Wrong thread because the people are not listening in the right one and i get morons posting there
 Post #45
 28th September 2007
Spacetech's Avatar
January 2006
813 Posts
MythBuster posted:
Wrong thread because the people are not listening in the right one and i get morons posting there
Can't help you if your in the wrong thread
 Post #46
 28th September 2007
TotalMark's Avatar
September 2007
9 Posts
Is it just me, or is the link broken? All I'm getting is the picture when I click on it.

Do I have to SVN this or something?
 Post #47
 28th September 2007
Spacetech's Avatar
January 2006
813 Posts
 Post #48
 28th September 2007
TotalMark's Avatar
September 2007
9 Posts
Okay, thank you.
 Post #49
 28th September 2007
Gold Member
tad2020's Avatar
December 2006
1,656 Posts
TotalMark posted:
Is it just me, or is the link broken? All I'm getting is the picture when I click on it.

Do I have to SVN this or something?
Fixed, gmod.org links don't seem to work when they're in a quote block.
 Post #50
 29th September 2007
Roktarok's Avatar
July 2007
402 Posts
Hi, I don't see the terraformer tool in the tool list, Any suggestions? also i'm not sure wat the terraformer is supposed to do, could any one explain?
 Post #51
 29th September 2007
PuddlePirate's Avatar
June 2007
282 Posts
A request for the next version, A one way valve.
 Post #52
 29th September 2007
Dennab
April 2007
3,330 Posts
PuddlePirate posted:
A request for the next version, A one way valve.
You mean a pump?
 Post #53
 29th September 2007
PuddlePirate's Avatar
June 2007
282 Posts
yeah, but without making 2 supply connectors and connecting them. Just a cutoff valve with a pump and instead of open and close make it (Off, Pump <-, and Pump ->)
 Post #54
 29th September 2007
ThePlague2's Avatar
August 2007
152 Posts
Yes! It's finally there. Thank you!
 Post #55
 29th September 2007
Spacetech's Avatar
January 2006
813 Posts
Roktarok posted:
Hi, I don't see the terraformer tool in the tool list, Any suggestions? also i'm not sure wat the terraformer is supposed to do, could any one explain?
Terra former is a life support thing. It's supposed to make any planet earth like so its livable. It requires the asteroid mod but it's not out yet so..
 Post #56
 29th September 2007
Gold Member
Xera's Avatar
November 2006
8,002 Posts
There's an error in base_rd_entity.

function ENT:OnTakeDamage(DmgInfo)//should make the damage go to the shield if the shield is installed(CDS)
	if ent.Shield then
		ent.Shield:ShieldDamage(DmgInfo:GetDamage())
		CDS_ShieldImpact(self.Entity:GetPos())
		return
	end
	DamageLS(self, DmgInfo:GetDamage())
end

ent is not being defined.
 Post #57
 29th September 2007
Gold Member
Haxxer's Avatar
February 2007
5,835 Posts
This is great. I'll have to....





:freeman: RAVE!
 Post #58
 29th September 2007
SB2DevTeam's Avatar
September 2007
114 Posts
Xera posted:
There's an error in base_rd_entity.

function ENT:OnTakeDamage(DmgInfo)//should make the damage go to the shield if the shield is installed(CDS)
	if ent.Shield then
		ent.Shield:ShieldDamage(DmgInfo:GetDamage())
		CDS_ShieldImpact(self.Entity:GetPos())
		return
	end
	DamageLS(self, DmgInfo:GetDamage())
end

ent is not being defined.
That has already been fixed yesterday, so it will be in the next update.
 Post #59
 29th September 2007
Gold Member
tad2020's Avatar
December 2006
1,656 Posts
Roktarok posted:
Hi, I don't see the terraformer tool in the tool list, Any suggestions? also i'm not sure wat the terraformer is supposed to do, could any one explain?
Goto LS2 thread: http://forums.facepunchstudios.com/s...d.php?t=425099
 Post #60
 29th September 2007
mankind_me's Avatar
August 2007
1,767 Posts
Terraformer isn't released yet.

Edit:

It was part of the Asteroids mod.
 Post #61
 29th September 2007
PuddlePirate's Avatar
June 2007
282 Posts
You can tweak the Terraformer in the file so that you can spawn and use it like I did on my server :D

*Worships the Time Lords Science Storage Vessel*
 Post #62
 29th September 2007
Roktarok's Avatar
July 2007
402 Posts
Ah, thanks for the help , i was starting to go nuts trying to find it :P
 Post #63
 29th September 2007
SB2DevTeam's Avatar
September 2007
114 Posts
PuddlePirate posted:
You can tweak the Terraformer in the file so that you can spawn and use it like I did on my server :D

*Worships the Time Lords Science Storage Vessel*
Yea the terraformer code is already included in LS2, it's just not showing up in the list, but is there already for other devs to see how it works.
 Post #64
 30th September 2007
Roktarok's Avatar
July 2007
402 Posts
But you can't mine terrajuice so there's not really much use for it right?
 Post #65
 30th September 2007
PuddlePirate's Avatar
June 2007
282 Posts
Correct, But if you know some lua you can whip up a ent that creates the juice, something like to the oil drill.
 Post #66
 30th September 2007
SB2DevTeam's Avatar
September 2007
114 Posts
PuddlePirate posted:
Correct, But if you know some lua you can whip up a ent that creates the juice, something like to the oil drill.
Or you could make an addon and create a new terraformer that uses different resources (It's been made so other other devs can easily add new TerraFormers, Air and Heat Exchangers without needing to put them over the new ones (it just depends on the registration and some vars).

I've already put some info about it in the FAQ's of the official website.
 Post #67
 30th September 2007
Gold Member
aVoN's Avatar
December 2005
7,891 Posts
Looking through your code made me recognizing this:
base_rd_entity/init.lua
function ENT:OnTakeDamage(DmgInfo)//should make the damage go to the shield if the shield is installed(CDS)
	if ent.Shield then
		ent.Shield:ShieldDamage(DmgInfo:GetDamage())
		CDS_ShieldImpact(self.Entity:GetPos())
		return
	end
	DamageLS(self, DmgInfo:GetDamage())
end
Neither ent nor ent.Shield is defined in there and may produce lua errors (tried to index a nil value)
 Post #68
 30th September 2007
Gold Member
Catdaemon's Avatar
February 2005
11,542 Posts
aVoN posted:
Looking through your code made me recognizing this:
base_rd_entity/init.lua
function ENT:OnTakeDamage(DmgInfo)//should make the damage go to the shield if the shield is installed(CDS)
	if ent.Shield then
		ent.Shield:ShieldDamage(DmgInfo:GetDamage())
		CDS_ShieldImpact(self.Entity:GetPos())
		return
	end
	DamageLS(self, DmgInfo:GetDamage())
end
Neither ent nor ent.Shield is defined in there and may produce lua errors (tried to index a nil value)
Why would that produce errors?
 Post #69
 30th September 2007
Gold Member
Xera's Avatar
November 2006
8,002 Posts
Catdaemon posted:
Why would that produce errors?
Because it does.

If it was
if ent and ent.Shield then

It wouldn't.

But still, ent isn't being defined.
 Post #70
 30th September 2007
Gold Member
aVoN's Avatar
December 2005
7,891 Posts
Yes, it actually even does :)
Code:
Error: [Scripted Entity Function] entities/base_rd_entity/init.lua:34: attempt to index global 'ent' (a nil value)
 Post #71
 30th September 2007
SB2DevTeam's Avatar
September 2007
114 Posts
aVoN posted:
Yes, it actually even does :)
Code:
Error: [Scripted Entity Function] entities/base_rd_entity/init.lua:34: attempt to index global 'ent' (a nil value)
Is already fixed in the svn (since yesterday). Tad just needs to upload it.
 Post #72
 30th September 2007
haXs's Avatar
September 2007
2 Posts
Hi, is there a bug with the cutoff valve?I see you have "No cutoff valve hax" but i am not sure if this means it's not supposed to work, or if it's a bug.

I have not used version 1 before so i am not sure about the history of this, but the current one seems cool!
 Post #73
 30th September 2007
Q42's Avatar
August 2006
1,939 Posts
I'm working on a different approach to RD. I found the old one poorly thought out and buggy as shit, so I started making one from scratch. The problem is that the resources in RD have always been abstract values with very little importance to the player, since EVERY resource acts like electricity.

I'm doing it by making the dev define a "header" type dealie so that other parts of the script have a fairly low-cost reference point for dynamic factors, like rate of flow, density, that kind of thing. If you go to www.gamedev.net, there are no shortage of fluid dispersing algorithms, and they take so little to run that there's really no point in having resources propagate instantly.
 Post #74
 1st October 2007
subenji99's Avatar
May 2005
1,097 Posts
I've found a bug in RD2 while experimenting with it.

The new Link Junctions Don't update to each other properly if you have a chain of them. I'll try to explain:

Say you have

Solar Panel > Junction > Energy Cache

and then add

Junction > new 2nd Junction

then add to that

2nd Junction > Coolant Compressor
2nd Junction > Large Coolant Tank

The Coolant resources do not get updated on the first Junction unless the 2 junctions are reconnected after there is coolant listed on the 2nd junction list.

With a large network of junctions, this lack of distribution can get awkward when resources at one end are needed at the other - the links through the whole network need to be rebuilt.

Hope I made sense :P
 Post #75
 1st October 2007
Gold Member
tad2020's Avatar
December 2006
1,656 Posts
subenji99 posted:
I've found a bug in RD2 while experimenting with it.

The new Link Junctions Don't update to each other properly if you have a chain of them. I'll try to explain:

Say you have

Solar Panel > Junction > Energy Cache

and then add

Junction > new 2nd Junction

then add to that

2nd Junction > Coolant Compressor
2nd Junction > Large Coolant Tank

The Coolant resources do not get updated on the first Junction unless the 2 junctions are reconnected after there is coolant listed on the 2nd junction list.

With a large network of junctions, this lack of distribution can get awkward when resources at one end are needed at the other - the links through the whole network need to be rebuilt.

Hope I made sense :P
Damn it, someone must have broken it while I was away, that was all working last time I was working on it.
 Post #76
 1st October 2007
Dennab
June 2006
8,328 Posts
I had the same issue with the junctions during development. I told space and snake about it and apparently they knew about the issue :)
 Post #77
 1st October 2007
Gold Member
tad2020's Avatar
December 2006
1,656 Posts
Q42 posted:
I'm working on a different approach to RD. I found the old one poorly thought out and buggy as shit, so I started making one from scratch. The problem is that the resources in RD have always been abstract values with very little importance to the player, since EVERY resource acts like electricity.
It's more like sub-ether.

Q42 posted:
I'm doing it by making the dev define a "header" type dealie so that other parts of the script have a fairly low-cost reference point for dynamic factors, like rate of flow, density, that kind of thing. If you go to www.gamedev.net, there are no shortage of fluid dispersing algorithms, and they take so little to run that there's really no point in having resources propagate instantly.
My appeoach was a rather simple idea: A network is just a table shared between linked ents and you don't have to rebuild a net to add to it.
The old RD used propagation to update nets, each ent had a net tab that recursed to all linked ents, this was rather slow. RD2 only has to change the values in one tab and the update it done. I was only replicating the functions of RD1 for right now, RD3 will add new functions to make custom nets that can work however you want (it's just a table that's shared between link ents, you can do all sorts of stuff with that). I was going to add a net type that would work like a CPU (or more like a real power supply via amps).
 Post #78
 1st October 2007
Dennab
April 2007
3,330 Posts
I have a small question,
When is the debugging text being removed bycose my server console is being spammed with Pumping Air and that kind of stuff and its getting verry anoying.
 Post #79
 1st October 2007
Midtown123's Avatar
August 2007
180 Posts
Links don't seem to work, Entities still disappearing. I did delete the other addons so... Well, nothing in the console, except for sv_cheats turning on and off. Anyone else seen this?


I also touched my storage device with the physgun and it said:
autorun/server/sv_resource2.lua:496: attempt to perform arithmetic on a nil value
 Post #80
 2nd October 2007
nagachief's Avatar
June 2007
1,146 Posts
Midtown123 posted:
Links don't seem to work, Entities still disappearing. I did delete the other addons so... Well, nothing in the console, except for sv_cheats turning on and off. Anyone else seen this?


I also touched my storage device with the physgun and it said:
autorun/server/sv_resource2.lua:496: attempt to perform arithmetic on a nil value
Where is the Life Support Stuff located and where is the RD located? Also try and see if anything is conflicting. Use SVN if your not already. IF all else fails, reinstall Gmod.
Reply


All times are GMT. The time now is 05:12PM.

Facepunch Studios 2009 - Server 'Softlayer 2.0'