Author Topic: Half Life 1 Weapons Project - Redux  (Read 6507 times)

post more of the code. it looks like that %rayvector is the direction the raycast is casted in

also 500 is a lot lol that's 1000 brick studs of distance. may want to keep it down a bit

Currently each placed mine runs 2 scheduled loops of it's own... one checks if there's a player infront of it and one checks if the tripmine static shape is still there in-case the laser needs to be deleted. I don't really know how i'd approach it differently

Currently the mines disappear after 2 minutes of being placed, but that's just kinda a placeholder. How would I go about limiting the amount of mines in the server? Just delete the oldest one when we hit the max or not allow players to place them?
first point: i don't see how there would be a laser without you deleting it unless you cleared projectiles or static shapes or something, but i guess its fine.

second point: you can store a list of staticshape objectID's and a counter; if the counter goes above x then the next placed mine would delete/explode the first mine in the list, and append the new mine to the end of the list. i guess it could get problematic if your string ends up being over 5000 characters long or something (whatever's the limit)
eg $Server::Tripmines = "10001 10002 10003"; $Server::TripmineCount = 3;

post more of the code. it looks like that %rayvector is the direction the raycast is casted in

It is, it's taking the vector direction and scaling it into a 3f position. Pretty sure anyway
I've uploaded all the functions so far here (forewarning: it's messy)

also 500 is a lot lol that's 1000 brick studs of distance. may want to keep it down a bit
first point: i don't see how there would be a laser without you deleting it unless you cleared projectiles or static shapes or something, but i guess its fine.

Good point, I turned it down to about 32 studs

What I was doing was when the laser gets tripped, it spawns an explosion at the static shape and then deletes it. But that left the laser just kinda hanging around and I didn't know how I would be able to delete it without constantly checking to see if it's source object is still there. The laser itself is a static shape also

second point: you can store a list of staticshape objectID's and a counter; if the counter goes above x then the next placed mine would delete/explode the first mine in the list, and append the new mine to the end of the list. i guess it could get problematic if your string ends up being over 5000 characters long or something (whatever's the limit)
eg $Server::Tripmines = "10001 10002 10003"; $Server::TripmineCount = 3;

I haven't really experimented with lists yet, I'll give it a whirl
« Last Edit: June 03, 2016, 10:16:21 AM by Rally »



It works! Well, if you like schedule spam. It's got a long way to go
what kind of schedule is spamming that requires it to work

what kind of schedule is spamming that requires it to work

- When the mine gets placed it starts a schedule loop that loops every 100ms. It fires a raycast the length of the beam and blows up if it detects a player. once it blows up or despawns it stops looping

- When it's placed it spawns the laser static shape, which has it's own 100ms loop, which checks to make sure it's source object is still there. if it aint, it deletes itself and stops looping

I know schedules are unsavory af and that's why I've made a bunch of options like despawn time and max per player. you can also use /cleartripmines to delete all mines in the server.

im not sure how it works but couldn't you just make a zone the length of the laser like how zone events work and when the player enters the zone it explodes and deletes itself

im not sure how it works but couldn't you just make a zone the length of the laser like how zone events work and when the player enters the zone it explodes and deletes itself

Pretty sure the zone events themselves use a constant schedule loop, defaulted at around 200ms.

Realistically the best way would probably be to give the laser beam collision and then have everything explode when the player armor collides with it. But then stuff starts to get really dicey to the point where you'd probably rather just have a background loop than a bunch of weird static shape collision artifacts

I've had 64 trip-mines on my server at a single time with no issue before. I went up to 4096 (the theoretical absolute max, if every player on a fully maxed out server had 64 mines placed) and the FPS dropped pretty bad but it still didn't crash.

Test
« Last Edit: May 24, 2017, 09:32:42 PM by Rally »