Stargate Event Horizon

So, I’ve started my project based around using Jinto’s render clipping module to create a more true-to-the-show effect. I’ve got the clipping and touch hooks for when it is completely inside or completely removed working flawlessly!

Problem: I am making the objects that make contact with the event horizon into the collisiongroup WORLD so they gain the ability to actually go through anything else (which is good in most cases). Thing is, if I applyed it to the stargate mod made by aVoN then an object could touch the EH then slip out of the gate boundaries.
Any idea on how I could contain them? Is there any way to add a hook to an entity that isn’t the one you are coding in? I am avoiding using any think hooks in the event horizon itself, but I may have to add one for this.
I tried creating a dummy scripted entity that would take the exact position and model of the original and it would detect and prevent gatemodel collisions. Needless to say the model never took the exact positon of the original and it would flip out.

The event horizon model is from the Stargate Addon, whenever I tried to make my own it would have the wrong dimensions.
Jinto made the clipping module that makes this possible.

What I have so far:

Comments? Critique? Suggestions?

Update 1:
Alright, I’ve got it able to recalculate the clipping planes if it’s position changes AND only for things it is touching, so no think event added! Yay!
Problem that arose because of this is apparently it doesn’t detect when it hits a static prop, the prop itself has to move.
I might have to change the way the horizon handles hit detection.
Can I completely override physics actions by adding a StartTouch hook instead of it just being a regular function?

I give up, no one was really of any help and I don’t play gmod very often anymore.
Here’s the SVN link:
I don’t know about the username/password, probably anon or anonsvn… whatever google code uses as its default.

Things you will need, Jinto’s Render Library (yes there are working links in the thread):

Things you might want, the guardian module for touch hook awesomeness (buggy, also there are working links in the thread):

There are some config option at the top of the entity’s init.lua file. Feel free to mess with them… if you want to.
The .bak and .txt files are there because I did make some crappy backups and I wrote down some idea tests… I don’t really care if you all see them anyways.

So yeah, modify it all you want, I don’t care to further this project anymore.
If you want to ever release it or use it in a video I’d appreciate some credit for it.
It’s only really useful for videos and pictures as it is now because if just deletes/kills entities.

oooh that looks nice :open_mouth:

now i dont know anything about Lua, but wouldnt it be possible to make a new collisiongroup somehow that ignores anything but the stargates?

If I could find where the collisiongroups are set then yeah, but I’ve got a sneaking suspicion they aren’t editable… are they?

Nice, very nice.

What do you do about physics and the clipping of it?

That looks pretty nice man good job

The clipping is set when the object first touches the horizon (well it never really touches but I have the SetTrigger(true) to catch it anyways.) That’s why moving the horizon right now would look weird, it wouldn’t update the clipping plane location, I’m working on getting this fixed now.

When the entity touches the horizon it loses its gravity and it begins to get pulled toward the horizon. When the EndToch is triggered it checks which side the entity entered from and if it was still going the same direction when it stopped touching, if so it gets deleted (teleport added later) if it changed direction then just restore it’s gravity and collision group.

I want to add decremental gravity as well, it would calculate the distance of the center of the object and use that to determine how much attraction and counter-gravitational force to apply, the closer it got the less gravity would affect it and the easier it would slip into the horizon.

Yes, but Jinto’s module only handles rendering, not physics. If I were to run into the invisible part of the prop, would I collide?

If so, I suggest using AzuiSleet’s Collision Guard module, and returning false if it is with the prop and the collision point is on the opposite side of the plane.

Ah, it’s mentioned in the first post: I set the entity to collisiongroup world so it doesn’t collide with anything. I am looking for newer and better ways to make this more realistic so I will totally look into that module! Thanks! :smiley:

EDIT: Hmm, so far no luck on finding that module… ah, he was using a different account.

The thread is here, but the download has gone.

You can get it from here, though.

And sorry, the collision group to WORLD (why caps?) went totally through my head and out the other side, not quite with it at the moment.

Oh because I literally copy pasted it (sorry, wasn’t shouting), the group is called: COLLISION_GROUP_WORLD

Also, that module is another dll and I’d like to keep those down to a minimum, it will be a good alternative to have though, thanks!

I’m afraid that module is the only way you can control collision, unless ou do some neat work with PhysicsFromMesh.

Yeah, I might just make two versions, one using the best tools I have available with just using lua and another using the extra dll. I still don’t even know if I’ll ever get this into a “release worthy” state.

EDIT: Funny thing, I can’t even get that guardian file to run with gmod. It just crashes, even with the most minimal of scripts.

This… Is…


[sp]Bet you weren’t expecting that![/sp]

Is this EH a modification of my current one or a completely new SENT, where you just added modelclipping and “move slowly in” effects?

If it’s the second, I would like to add these codes to my EH (but not for February since I’M currently busy with exams again)

i would like it too avon :smiley: also, why wouldn’t you be able to add it if he has just edited your gates? i dont understand lua, i’m sure there is good reason :smiley:

I would be able too (cope file to the svn - done). But I like to add new code manually so I can see how it works, if it is compatible/well coded etc.

This would sure be a nice add to the current stargates :slight_smile:

By the way, what is that song playing in the background?

Oh no, it’s not integrated into your code. This a new SENT written completely from scratch, I even made my own material to make sure it looked different (It’s a good one too, done in aftereffects without hitch in it’s loop). The model is yours though, I should have mentioned that in the first post, I’ll add it now.

There are currently some problems with the way it works and you might not want to add it for those reasons:
1.) If there is a static object on the ground and the horizon comes down on it it won’t be detected to hit at all! I don’t know why yet.
2.) Once the entity hits the horizon it goes into the collision group world and can then escape the gate boundaries because it no longer collides with anything.
3.) It doesn’t handle constrained props yet, so it would just take the whole mess apart!
4.) It doesn’t work on players, but these could work like your normal ones do, the only possible problem would be if the player is in a vehicle, but I’m sure I could work up a conditional to catch that scenario, maybe draw a blue screen on the player? (since they are technically, “inside the gate”)
5.) When I was trying it out in singleplayer I used a camera to see myself but the gate wouldn’t clip me, any ideas why? Is the model a separate entity?

If you’d like to see the code I can drop you a PM, I’d love some constructive criticism!

Oh the song is The End of the Beginning by God is an Astronaut.

are you by any chance trying to make the prop reaper through the other gate once it is completly through?

Right now it is only the one working entity. I’ll get to that once I’ve ironed out the problem of getting the collisions to work as they should and detecting constrained entities.