How to detect collision ?

Post » Mon May 05, 2014 1:24 pm

Hi :smile:

After more than 1 year not touching CK and Skyrim, I decided to come back.

And I started a mod, with a great dongeon, and all, but I'm stopped like a noob in one thing :

I created a deep well, with fire deep inside. I plane to turn it into a "sacrifice pit'. The first thing coming to my mind is a reanimated body the player will kill / release, and drag into the well.

When the body made its way through the well, a script should be able to detect that a dead body entered in collision with something (a collision place just under the flames in the well, maybe ?), delete the body (in order not to fill the well lol), and that would add some hidden object (for a count) or an INT value maybe, I don't know yet. When the player would have enough, it will be quested something like he can craft some devil weapons or I don't know yet.

But I'm not used anymore to all those things, and I must restart my papyrus and CK scholarship from a basic level ^^

By the way, obioviously, I thought to verify first if the body hitting the deep is an essential NPC still alive, it would spit him it (like just a movetoplayer will be enough), and saying thing like "the well doens't want that". But this... I think I would be able to do it alone (unless someone does it before lol)

Does someone have an idea how to do this collision detection thing ? Or doing it another way to detect a dead body in the deep of the well ? I thought to OnHit, but that is only for a wepon hit, right ? Not for a dead body hitting a collision plane ?

I make it shorter, for the one who maybe didn't understand all of my speech :

Spoiler

- I have a deep well.

- I want to drag dead bodies inside.

- The bottom of the well must detect when anything is reaching (a dead body, an enssential actor, an objetc).

--> dead bodies will be deleted and add something to a variable.

--> essential NPC will be teleported to the player again.

--> objetcts will simply be deleted.

--> Quest Objects (I don't know if the player is able to drop some of important items in the game) will be added to the inventory again.

I'm just stopped now by the "detecting what enter collision with the bottom" :(

And sorry for my bad english, not native :smile:

User avatar
Ally Chimienti
 
Posts: 3409
Joined: Fri Jan 19, 2007 6:53 am

Post » Mon May 05, 2014 7:42 pm

If collision in question you want to detect is a collision primitive, then yes. Armor/weapon/static collisions cannot be accessed.

Collision primitives are kind of like trigger volumes(note: they do not function as triggers) with collision information. You can even add scripts to them, which should help with a detection setup.

User avatar
Vahpie
 
Posts: 3447
Joined: Sat Aug 26, 2006 5:07 pm

Post » Mon May 05, 2014 12:58 pm

Ho.
I think I strat to understand what I am wrong in my way of doing the thing.

But I'm not used at all with the trigger volumes (?), I never heard about that. I will search a little what kind of thing it is, and how I can use it to do what I want to do...

So there is no papyrus command like "OnHit" reffering to a collision between two objects :/

That'd be so much easy if I could put that on a collision plane. Too bad.

In fact, the only thing I want to find is how to make the collision plane I put in the well see when something (anything, in fact) is hitting it. That's all. There must be a solution, no ?

Or, at worst, can I put a marker (like a quest marker, when the player must reach a specific point), and apply it to a dead body ?

I mean, make a quest with a map marker deep in the well, saying "Drop a dead body inside", and verifying when a dead body is reaching it ? It will be quested no matter what, so...

User avatar
Danii Brown
 
Posts: 3337
Joined: Tue Aug 22, 2006 7:13 am

Post » Tue May 06, 2014 4:47 am

There is the event OnHit and it was my first thought, however, I'm not sure how that function would handle something like this.

What I can suggest for your situation, (even better that you're using a custom primitive) is place a trigger volume around the collision plan, small enough but big enough to cover the plane.

And then do something like this:

Actor property PlayerRef auto Event OnTriggerEnter(ObjectReference akTriggerRef)     if akTriggerRef == PlayerRef         ;something here    endifEndEvent

And if you're only wanting this to fire once

Actor property PlayerRef auto AUTO STATE DefaultEvent OnTriggerEnter(ObjectReference akTriggerRef)     if akTriggerRef == PlayerRef         GoToState("Done")         ;something here    endifEndEventENDSTATE STATE DoneEvent OnTriggerEnter(ObjectReference akTriggerRef);empty stateEndEventENDSTATE

You may need to make the volume, just a bit bigger for player detection.

I don't know any other way(or an advanced way, which I'm sure someone has)

Obviously the akTriggerRef doesn't need to be the player, that's just an example.

User avatar
Steeeph
 
Posts: 3443
Joined: Wed Apr 04, 2007 8:28 am

Post » Mon May 05, 2014 11:10 pm

Oh, I got it. I think I can do something with that, thanks.

Otherwise, I was wondering about putting a sandbox marker and doing a quest alias, followed by a quest objective (if reference is < 50 the alias, for example, do something). But it would be big for not much ^^

User avatar
vicki kitterman
 
Posts: 3494
Joined: Mon Aug 07, 2006 11:58 am


Return to V - Skyrim