Garry's Mod

Garry's Mod

71 ratings
[E2] AntCore
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Server content
File Size
Posted
Updated
104.626 KB
Dec 26, 2016 @ 9:58pm
Jun 22, 2020 @ 1:04am
74 Change Notes ( view )

Subscribe to download
[E2] AntCore

Description
Useful E2 stuff

Documentation (too long for workshop): https://github.com/Antagonise/E2-AntCore


Some of the most useful functions:

E = shootBolt(pos, vel, damage)
Allows you to create a moving crossbow bolt that will hit targets identically as if you fired it yourself. Great alternative to hologram or prop projectiles.

E:turretShoot(direction, damage, spread, force, count, tracer)
Allows you to make an entity (including holograms) that you own fire a turret bullet that will act exactly like a real turret bullet.

propSpawnASync(enable)
Allows you to spawn more props per second, but they can't become solid until they would've been able to be spawned (via PropCore). Requires PropCore to be installed and enabled. By default, allows a max of 60 (non-solid) props to be spawned per second, any more than this can cause problems. Conforms to PropCore's settings for max solid per second. The benefit of this function is it makes your code much more manageable if it spawns a lot of different props in a short time.

findClosestCentered(pos, dir)
Finds the center entity based on a view angle, runs exactly the same as findClosest(pos) but for a direction.

findSetResults(R) / findAddResult(E)
Allows you to skip the actual finding part of find, but still use sort functions on known entities. Massively reduces lag.

runOnEntSpawn(enable) / runOnEntSpawn(type,enable)
Makes an e2 execute whenever an entity is created. Allows entity type to be specified, also the runOnEntRemove equivallent allows for specific entities only.

R:sort() / T:sort()
Returns a sorted array or table of keys from the input, sorted by the values. All values must be the same type.

E:setModelScale(N, time) / E:setPhysScale(N) / E:makeSpherical(..) / E:makeBoxical(..)
Allows extremely useful manipulation of physics and models. The first one allows linear smooth animated scaling of entities' models (including holos). The others allow entities themselves to physically be scaled.



Let me know if you find any problems.
69 Comments
Sanders Mar 29 @ 12:46pm 
ok @Tenndex care to explain? cause i can show you how im doing it
Sawnik85 Feb 15 @ 1:45am 
anyone else having trouble with propSpawnASync(enable) not functioning?
Tenndex Jan 18 @ 1:51am 
Works for me just fine.
Sanders Jan 17 @ 9:14pm 
ok sooo with this core its neat but the shootbolt has a MAJOR flaw. despite the holo it shoots from its not spawning from that holo! and i have to make sure the turret isnt near any walls or the bolt shoots backwards for some reason
Darmagon Oct 28, 2024 @ 11:54pm 
On a server am having problems with n=propCanCreate() not detecting the e=propSpawn(svan) rate limit since this was added, believe the check may be getting overridden thinking propSpawnASync(n) is enabled.
Sanders Oct 13, 2024 @ 8:09pm 
hey with the E:turretShoot() can you add a delay option? so we can make some tun turrets? like if you wanna have them fire slower then you could or faster?
Mardröm Mar 21, 2022 @ 10:56am 
my E2 is crashing whenever i use findClosestCentered(), the error says this:
entities/gmod_wire_expression2/core/custom/antcore.lua:746: attempt to perform arithmetic on field 'x' (a nil value)
as far as i can tell it's doing this only if it finds an entity, regardless of what i tell it to do with said entity or what i put in the pos/direction fields
Sanders Mar 16, 2022 @ 9:33pm 
could you guys perhaps add onto this the option to fire things like missiles and ar2 alt fire stuff? would be nice for a defense system im working on'


if you can anyways thank you.
Sanders Mar 7, 2022 @ 7:12am 
thank you i forgot about that XD
Antonym  [author] Mar 7, 2022 @ 12:32am 
@SANDERS
You could try holoEntity(400):toWorld(vec(-20,0,0)) instead of holoEntity(400):pos()