prinyo Posted February 17, 2016 Posted February 17, 2016 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. Thanks!
Guest ffabris Posted February 17, 2016 Posted February 17, 2016 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.
prinyo Posted February 22, 2016 Author Posted February 22, 2016 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! :-)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.