Jump to content

Question about trigger in CK


prinyo

Recommended Posts

This probably has some easy and obvious solution but is driving me crazy for some time now.

What I'm trying to do is a trigger in an open world cell and execute a script when the PC enters the trigger zone.

I read and watched tutorials that were mostly about activators or triggers that detect when the PC enters the cell.

Then I finally realized (maybe wrongly) that I need to create a trigger on an object and then drag it away and resize it to whatever the zone I want it to cover.

So at the Solitude training yard I added a new leveled imperial NPC and used him to create a trigger that I then stretched to cover 1/4 of the yard. I added the script from the example scripts page on the CK site called "A Trigger That Detects When The Player Enters". The title and the explanation are quite vague and I'm still not sure what they mean by "enters" - enters the cell or enters the trigger zone. Because they say I need to add the trigger to an object but then then the trigger box is quite small as it fits the dimensions of the object. So if you read their explanation they expect somehow the player to enter the object...

Anyway I did that and tried it in the game - nothing. So I'm obviously missing something but I haven't been able to find the solution in any tutorial so far.

Here is a screenshot that shows the trigger, the trigger options and the script.

 

post-925979-0-01419500-1455737500_thumb.jpg

 

Thanks!

Link to comment
Guest ffabris

The script in the trigger object is activated when an actor (player or NPC) enters the trigger, not the cell.

 

As for the script failing, make sure the PlayerRef property is assigned a value. Other than that, the code looks OK. All you should need is to walk into the area enclosed by the trigger.

Link to comment

The playerRef is assigned via the Properties window of the script. 

I clicked Auto-Fill and it added PlayerRef(00000014) as a value.

 

And now it works... I reassigned it again and it worked. I think before I was assigning it via the dropdown where I selected PlayerRef myself. Now I clicked Auto-fill. 

 

Thanks for your help! :-)

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use