OnTrigger block question

Post » Sat Feb 19, 2011 2:25 am

What's the best way to attach an OnTrigger block script to the player? The script has to be an object script, so it has to be attached to some object. What's the least invasive thing to attach the object script to, which can then be added to the player?
User avatar
TRIsha FEnnesse
 
Posts: 3369
Joined: Sun Feb 04, 2007 5:59 am

Post » Sat Feb 19, 2011 10:39 am

An activator, perhaps? I'll try that.
User avatar
Fanny Rouyé
 
Posts: 3316
Joined: Sun Mar 25, 2007 9:47 am

Post » Sat Feb 19, 2011 11:25 am

Might want to use a trigger zone instead. just, a very small one. Else, the ontrigger block will actually only run when you, erm. trigger.... it.
User avatar
Liv Staff
 
Posts: 3473
Joined: Wed Oct 25, 2006 10:51 pm

Post » Sat Feb 19, 2011 10:28 am

TriggerZone? Could you, pretty please, elaborate on that?
User avatar
Kelly Tomlinson
 
Posts: 3503
Joined: Sat Jul 08, 2006 11:57 pm

Post » Sat Feb 19, 2011 5:11 am

Is it

Begin TriggerZone 


?

I'll try it. I've done the stuff that needs to be done, but my actions don't equal the results I want. I wish I could ask skycaptain how he made his shield bash so effective.

This is what I've done:
Created an activator. Placed it in a cell to make it a reference. Attached an OnTrigger script to it. In my quest script, I placed the reference to the same position as the player. But when I collide with NPC's, nothing happens.

Any ideas, HeyYou, as to why it isn't working?
User avatar
Eilidh Brian
 
Posts: 3504
Joined: Mon Jun 19, 2006 10:45 am

Post » Sat Feb 19, 2011 1:18 am

Is this still with trying to get the player running into someone to knock them down?

If so, wrap the player in a trigger zone. The game knows just who triggered it, and you can get that reference. Then, use that information to do whatever to the reference.
User avatar
Paul Rice
 
Posts: 3430
Joined: Thu Jun 14, 2007 11:51 am

Post » Fri Feb 18, 2011 8:12 pm

Yes.

I troubleshot it and the "OnTrigger" script isn't running.

Could you please elaborate on what you mean by a "TriggerZone"? I'm quite the noob. Is TriggerZone a script bock? Is it an object?
User avatar
Unstoppable Judge
 
Posts: 3337
Joined: Sat Jul 29, 2006 11:22 pm

Post » Fri Feb 18, 2011 7:39 pm

A triggerzone is used to activate traps, like the poison vents, or, the falling floors/ceiling traps. When anyone/thing walks into X area, it 'triggers' whatever it is scripted to do.

I don't have the CS open at the moment, but, there should be some various varieties in there. have a look at a dungeon that uses one. See what you can infer from there. (I haven't done this particular trick before.)

I don't know how difficult it will be to wrap one around the player, but, I do believe that others have used the method effectively.
User avatar
Mistress trades Melissa
 
Posts: 3464
Joined: Mon Jun 19, 2006 9:28 pm

Post » Fri Feb 18, 2011 9:00 pm

There are multiple trigzones in the activators list, some for specifically just the player others for any actor. Coming in both box and rectangle shapes and I think there is even a 3rd shape thats more of a circle or octagon.

Just go to the T sections of the Activator list, you'll find a plethora of TrigZones there to work with.
User avatar
Sabrina garzotto
 
Posts: 3384
Joined: Fri Dec 29, 2006 4:58 pm

Post » Sat Feb 19, 2011 6:00 am

A Trigger zone is an invisible mesh. But it can be 'hit', and thus the trigger. Its a zone because of the size of the mesh.

You would have to move the trigger zone with the player, which may be difficult to do.

You then need to only check for http://cs.elderscrolls.com/constwiki/index.php/OnTriggerActor otherwise it will trigger when objects hit it too.
User avatar
DAVId Bryant
 
Posts: 3366
Joined: Wed Nov 14, 2007 11:41 pm

Post » Sat Feb 19, 2011 3:24 am

A triggerzone is used to activate traps, like the poison vents, or, the falling floors/ceiling traps. When anyone/thing walks into X area, it 'triggers' whatever it is scripted to do.

I don't have the CS open at the moment, but, there should be some various varieties in there. have a look at a dungeon that uses one. See what you can infer from there. (I haven't done this particular trick before.)

I don't know how difficult it will be to wrap one around the player, but, I do believe that others have used the method effectively.


There are multiple trigzones in the activators list, some for specifically just the player others for any actor. Coming in both box and rectangle shapes and I think there is even a 3rd shape thats more of a circle or octagon.

Just go to the T sections of the Activator list, you'll find a plethora of TrigZones there to work with.


A Trigger zone is an invisible mesh. But it can be 'hit', and thus the trigger. Its a zone because of the size of the mesh.

You would have to move the trigger zone with the player, which may be difficult to do.

You then need to only check for http://cs.elderscrolls.com/constwiki/index.php/OnTriggerActor otherwise it will trigger when objects hit it too.


Okay. Activators --> TriggerZones. Got it. I'll see what I can do.

Thanks, everybody.
User avatar
Nicole Kraus
 
Posts: 3432
Joined: Sat Apr 14, 2007 11:34 pm

Post » Sat Feb 19, 2011 11:33 am

Well, a TriggerZone is just an activator with a certain mesh and script attached to it. So, it shouldn't be that different from what I have.

Anyway, after much trial and error, I just can't get it to work. I can not, for the life of me, get an NPC to stagger via a script.

I've looked at mods that do it, even copied one, and it didn't work. I need to type with someone who knows how to do it, and can give me some serious pointers.
User avatar
kelly thomson
 
Posts: 3380
Joined: Thu Jun 22, 2006 12:18 pm

Post » Sat Feb 19, 2011 11:13 am

Why not post your Code, and give a bit of detail on what each one is attached to? Often times, things like this do not work due to simple mistakes or assumptions about how Oblivion works :) I've done silly things myself before, and spent ages look for the issue :S Perhaps with your Script, we can see what's up :)
User avatar
SHAWNNA-KAY
 
Posts: 3444
Joined: Mon Dec 18, 2006 1:22 pm

Post » Sat Feb 19, 2011 8:07 am

I am afraid a trigger zone around the player won't work.

Considering only actors for simplicity, trigger zones triggers not only when an actor collides with it for the first time, but also every frame thereafter while that actor is within its boundaries.
Also, with GetActionRef you can only detect one of the (potentially many) triggering actors.
Also, GetActionRef returns the player ref if the player is one of the actors.

Therefore, with a trigger zone around the player, all you will get is the astonishing conclusion that the player is within the trigger zone boundaries.
User avatar
Vickytoria Vasquez
 
Posts: 3456
Joined: Thu Aug 31, 2006 7:06 pm

Post » Fri Feb 18, 2011 11:39 pm

Why not post your Code, and give a bit of detail on what each one is attached to? Often times, things like this do not work due to simple mistakes or assumptions about how Oblivion works :) I've done silly things myself before, and spent ages look for the issue :S Perhaps with your Script, we can see what's up :)


I am afraid a trigger zone around the player won't work.

Considering only actors for simplicity, trigger zones triggers not only when an actor collides with it for the first time, but also every frame thereafter while that actor is within its boundaries.
Also, with GetActionRef you can only detect one of the (potentially many) triggering actors.
Also, GetActionRef returns the player ref if the player is one of the actors.

Therefore, with a trigger zone around the player, all you will get is the astonishing conclusion that the player is within the trigger zone boundaries.


Okay. I'm going to try something different with GetFirstRef and Get Next Ref. If it doesn't work, I'll post the script. Maybe a better scripter can spot what's wrong.
User avatar
Andrew
 
Posts: 3521
Joined: Tue May 08, 2007 1:44 am


Return to IV - Oblivion