Commit Graph

100 Commits

Author SHA1 Message Date
Mista-Tea
2d0318c848 Merge pull request #13 from Mista-Tea/dev
Renaming file name inside file
2015-07-26 14:23:47 -06:00
Mista-Tea
731ea756b3 Renaming file name inside file 2015-07-26 14:23:26 -06:00
Mista-Tea
33d1a997dc Merge pull request #12 from Mista-Tea/dev
Add README file
2015-07-26 14:22:31 -06:00
Mista-Tea
51e973bbfd Merge pull request #11 from Mista-Tea/Mista-Tea-patch-1
Update README.md
2015-07-26 14:21:52 -06:00
Mista-Tea
3aa4f70baf Update README.md 2015-07-26 14:21:47 -06:00
Mista-Tea
3c6ba9438a Merge pull request #10 from Mista-Tea/Mista-Tea-patch-1
Create README.md
2015-07-26 14:20:45 -06:00
Mista-Tea
1844742123 Create README.md 2015-07-26 14:20:37 -06:00
Mista-Tea
2e258ca578 Merge pull request #9 from Mista-Tea/dev
Merging dev into master
2015-07-26 14:17:55 -06:00
Mista-Tea
6227d11626 Merge pull request #8 from Mista-Tea/Mista-Tea-patch-2
Update improvedstacker.lua
2015-07-26 14:16:52 -06:00
Mista-Tea
6754a53899 Update improvedstacker.lua 2015-07-26 14:16:32 -06:00
Mista-Tea
c2a3e55815 Merge pull request #7 from Mista-Tea/Mista-Tea-patch-1
Fixing stacker entity count-related bugs
2015-07-11 19:25:21 -06:00
Mista-Tea
2f7605e69f Fixing stacker entity count-related bugs
I forgot to add checks that ensured the player entity was valid before trying to decrement their total stacker entities when an entity was removed. If the player has disconnected before the entity was removed, removing it later would cause a relatively harmless, yet annoying error. This should now be resolved.

The other fix addresses the possibility that the TotalStackerEnts field does not get created on the player when they initially spawn. If for some reason it failed, trying to decrement the player's total stacker entity count would cause an error and break things in a bad way. This pull request also addresses this problem.
2015-07-11 19:24:58 -06:00
Mista-Tea
2912a15afb Rename stacker.lua to improvedstacker.lua 2015-07-11 19:00:17 -06:00
Mista-Tea
69b0bc34fe Rename stacker.lua to improvedstacker.lua 2015-07-11 18:58:02 -06:00
Mista-Tea
de1af2d269 Merge pull request #5 from Mista-Tea/dev
Bug fixes, new features, more comments
2015-06-30 20:42:11 -06:00
Mista-Tea
1e1e4e925b Bug fixes, new features, more comments
Bug fixes:
- Duplicating props that were spawned from the Stacker tool with colors and materials now actually saves the colors and materials

New features:
- Added stacker_max_total and stacker_set_maxtotal (bad names, sorry)
These cvars control the total number of props that can be spawned out by the stacker at any give time. For example, setting it to 30 means players can only spawn 30 total props with the stacker tool before being blocked. They must deleted their old props before they can create any more. An error message is printed to their chat when they exceed this limit. This should address issue #4.

By default the value is set to -1 (no limit) so that it doesn't interfere with servers that don't want a hard limit.

More comments:
L308 - L359
L612
L618
L651
L653
L655
L665
L682
L685 - L686
L688 - L689
L725 - L726
2015-06-30 00:44:34 -06:00
Mista-Tea
f28678f112 Made TOOL:LeftClick fail-fast
I don't particularly know what reasoning I had for making the for-loop continue if one of the prop check hooks failed. If any single one of the props fails a check, it should follow that all of the remaining props to be created in the stack would also fail.

For example, when a player hits the prop limit, this should no longer needlessly create and check props that would fail after the prop limit was initially hit.
2014-09-04 23:51:36 -06:00
Mista-Tea
ea135a071d Added stacker_delay
Usually, external prop protections should be in charge of limiting
tools. Unfortunately, as many prop protections greatly differ and may
not easily allow editing, I've decided to include a time delay setting
for stacker that will prevent players from spamming the stacker tool too
quickly.

The default delay is 0, which is normal behavior (you can use stacker as
fast as you want). If you want there to be a 2 second delay between
using stacker, you can use stacker_delay 3 from the server console, or
stacker_set_delay 3 if you are a server admin.
2014-08-12 14:39:23 -06:00
Mista-Tea
e101cf769f Updating file info 2014-08-12 13:37:50 -06:00
Mista-Tea
dd74e06aa4 Optimized NoCollide, cleaned up StackerCalcPos, added more cvars
The nocollide functionality should now complete in  !(N-1) ops as
compared to N^2.

Got rid of unnecessary parameters within the StackerCalcPos function.

Added stacker_force_freeze/weld/nocollide so that server
operators/admins can force stacked props to be spawned
frozen/welded/nocollided.
2014-08-12 13:26:36 -06:00
Mista-Tea
06f9456b97 Modified option wording, removed adv settings label
Options should now be cased consistently ("Foo bar", not "Foo Bar")

Stacker direction options now use the enums (should automatically be
coerced to strings)

Got rid of the advanced options warning label. Not really needed at this
point.
2014-08-11 20:56:02 -06:00
Mista-Tea
6132505dc7 Disabled resetting of various options
Some players have brought it to my attention that clicking the Reset
button for the rotation/offsets while having halos disabled will
automatically enable the halos again.

I realize now that if a user has changed these options, they most likely
don't want them to be reset every time they clear the offsets and
rotations.

As a result, I am taking them out of the list of options to reset. If
enough people would still like a way to reset the options, I can make a
secondary button to reset them.
2014-08-11 20:46:49 -06:00
Mista-Tea
973216d272 Added convar/concmd argument ranges 2014-07-24 22:33:36 -06:00
Mista-Tea
20f9fd703e Updating file history information 2014-07-24 22:15:25 -06:00
Mista-Tea
32bfc218dd Gave up on using PreDrawHalos, gmod_tool is too messed up
For some reason, the way the gmod_tool was coded causes tool functions
like TOOL:Init() to be called on EVERY client when ANY client respawns.
It pretty much made using halos in PreDrawHalos unreliable.

Instead, I've unfortunately moved the halos back into TOOL:Think(),
which means there will be a large FPS drop when using halos. Sorry :/

Added stacker_stayinworld and stacker_set_stayinworld for server owners
that want to restrict stacker so that props MUST be spawned inside of
the world. Apparently some DarkRP server(s) crash(es) when many props
are spawned in the world and then are unfrozen.
2014-07-24 21:52:09 -06:00
Mista-Tea
ac30fea936 Missed a parameter change 2014-07-23 19:56:26 -06:00
Mista-Tea
a2737142a1 Updated the NoCollide option so it actually nocollides all entities with each other
The old behavior was cheap and only nocollided the previous entity with
the current entity -- not a true nocollide since every other entity
would still collide with it.

The new behavior will loop through each entity and nocollide it with
every other entity, so none of them collide with any other entity in the
stack.
2014-07-23 19:49:13 -06:00
Mista-Tea
dd6cab2d86 Various fixes/modifications
Moved GhostStack to self.GhostStack
Added TOOL:Deploy
Added TOOL:OnRemove (gmod_tool doesn't appear to call this though...)
Added TOOL:OnDrop (same as above?)
Hopefully fixed the PreDrawHalos spam randomly when a player dies/drops
toolgun/etc
Fixed the strangest crash with weld/nocollide constraints ever...
2014-07-23 18:38:44 -06:00
Mista-Tea
f4651d615a Moving all of the entity attributes prior to calling hooks
I didn't realize it at the time but if your
StackerEntity/PlayerSpawnedProp hooks try to do anything with the
entity's physics object, it would error out because I hadn't actually
spawned the entity yet. My mistake.
2014-07-23 17:55:20 -06:00
Mista-Tea
8dd672bef1 Resolved PlayerSpawnProp and PlayerSpawnedProp issues
PlayerSpawnProp returns true if the player is allowed to spawn this
prop, so we should check only if it returns false to block it.

PlayerSpawnedProp doesn't return anything (nil) so we should check if
they return anything other than nil to block it.

Also, PlayerSpawnedProp already calls ply:AddCount, so we no longer need
to use it (otherwise it would make the gamemode think you have twice as
many props spawned out as you do).
2014-07-03 20:43:21 -06:00
Mista-Tea
0accde8558 Adding PlayerSpawnProp and PlayerSpawnedProp hooks 2014-06-16 00:33:50 -06:00
Mista-Tea
4075dc066c Fixing undefined behavior when _ has been declared as some value
Typically _ is used in Lua to signify that we are choosing to skip some
parameter. This is fine as long as no other scripts have accidentally
(forgetting to localize) or purposefully set _ to a value, e.g.
_ = true

In this specific case, if _ is true, it will cause construct.SetPhysProp
to horribly break.
2014-06-06 16:03:51 -06:00
Mista-Tea
34596b8b1b Fixed bug that occurred when the player is dead (making the SWEP invalid) 2014-06-05 15:07:15 -06:00
Mista-Tea
9b2b8973ad Adding missed notes in changelog 2014-06-05 04:20:55 -06:00
Mista-Tea
79b969462d Physical Properties, Weight, Optimizations, Fixes
- Added support for physics properties (gravity and physics material
using the Physical Properties tool) (toggle using the "Apply Physical
Properties" option)
- Added support for weight (toggle using the "Apply Physical Properties"
option)
- Thoroughly cleaned up and optimized more problem areas (ghost stack)
- Moved halo functionality from TOOL:Think() to PreDrawHalos hook
(TOOL:Think is called way more often than it needs to be to render
halos)
- Removed net messages for sending ghost stack to client (entirely
unneeded)
- Removed server involvement in TOOL:Think() (entirely unneeded)
- Cleaned up TOOL:Think() and prevented doing redundant work on the
ghosted stack
- Cleaned up TOOL:LeftClick() by separating optional functionality like
materials and colors into their own functions
- Added official support for external prop protections/anti-spam addons
by calling hook.Run( "StackerEntity", ent, owner ) directly after a
stacked entity has been created.
2014-06-05 04:16:26 -06:00
Mista-Tea
387f7fa72e Fixed accidentally breaking stacking with MODE_WORLD 2014-05-30 15:18:21 -06:00
Mista-Tea
60dddbec81 Removing debug concommand 2014-05-29 16:41:21 -06:00
Mista-Tea
7d526c5d25 Update stacker.lua 2014-05-29 16:33:47 -06:00
Mista-Tea
c10523b09d Revert "Update stacker.lua"
This reverts commit 9bbe8bc862.
2014-05-29 16:31:26 -06:00
Mista-Tea
9bbe8bc862 Update stacker.lua 2014-05-29 16:29:55 -06:00
Mista-Tea
aba2aa2ce2 Update stacker.lua 2014-05-29 16:06:09 -06:00
Mista-Tea
43eaf7cbee Added support for entity skins
If a prop has multiple skins, the stacked props will now use the same skin as the original prop.

Before this, the stacked props would default to the first skin only.
2014-05-29 16:05:37 -06:00
Mista-Tea
b48324da2c Updating file information, added to steam workshop 2014-05-28 03:10:37 -06:00
Mista-Tea
074b78225e Adding more localized global functions 2014-05-28 02:41:35 -06:00
Mista-Tea
640e271c4f Localizing more global functions, slight reorganization 2014-05-28 02:36:28 -06:00
Mista-Tea
b35dda1914 Fixing console commands acting strange 2014-05-27 19:51:46 -06:00
Mista-Tea
75c333ac85 Reduced redundant checks in console commands 2014-05-27 18:54:04 -06:00
Mista-Tea
869aa26f09 Adding stacker_halo_a cvar to the color control 2014-05-27 18:51:33 -06:00
Mista-Tea
2b68aba872 Update stacker.lua 2014-05-27 18:49:48 -06:00
Mista-Tea
4b472ef194 Initial commit 2014-05-27 18:48:11 -06:00