Jump to content

Creating a zone where AI don't react to you


ual002

Recommended Posts

The big question, I think that would help fg109 out too, is are you *really* not supposed to leave the cell?

 

but if he catches you out of the cell it sets the relations ships back to bandit=badguy.

 

or is he just not supposed to *see* you leave? There are tons of solutions for simply not allowing the player to leave and/or detecting he's left. If that's your intention fg109's idea sounds pretty foolproof.

 

@fg109 aww, but then they'd be BAD Rp'er lol I'd assume that's why they got such a mod in the first place >.<

Edited by SinderionsBones
Link to comment
Share on other sites

Ok so I just realized I was willfully unprepared for triggers. I've got the defaultactivateselfTRIG in place in the jailcell (Not even sure if I should use that trigger), but I have no idea where to do the editing. Is there an advanced tutorial on triggers? All I can find tutorials on are ambushes. Does someone wanna walk me through it?

 

EDIT: THIS IS MY GOAL. So, there are 3 lockpicks under a bucket. If you fail to get out with those, the guard is SUPPOSED TO be wandering around and get close to the bars for you to pickpocket the key. The trigger area is for keeping him docile to keep him from going hostile and agro-ing to you when you wander around the cell. If you finally get out and leave the trigger area, the guard once again becomes hostile (However you would do that) and attacks you like he would anywhere else in the world. Then the trigger cleans up and goes by by.

 

Does that help?

 

-Cheers

 

http://i.imgur.com/6piLZ.jpg

Edited by ual002
Link to comment
Share on other sites

Do you see that button that looks like a cube with a T on it? It's under and slightly to the right of the Help menu. That button allows you to create trigger zones. But I think using the defaultActivateSelfTrigger would work too. Now you have to edit the trigger. The window you have open has a lot more tabs to it, you just have to click on the little arrows. Keep clicking the right arrow until you get to the last tab, "Scripts".

 

Remove the default script and choose to create a new script. Use something like this:

 

 

scriptname MyTriggerScript extends objectreference


Faction property BanditFaction auto					;declare a Faction property


Event OnTriggerEnter(ObjectReference akActionRef)	;this event is received when something enters the trigger zone

if (akActionRef == Game.GetPlayer())			;check to see if whatever entered is the player
	akActionRef.AddToFaction(BanditFaction)		;add the player to BanditFaction
endif

EndEvent


Event OnTriggerLeave(ObjectReference akActionRef)	;this event is received when something leaves the trigger zone

if (akActionRef == Game.GetPlayer())			;check to see if whatever left is the player
	akActionRef.RemoveFromFaction(BanditFaction)	;remove the player from BanditFaction
	Disable()									;disable itself so the player doesn't get added to faction again if he/she returns
endif

EndEvent

 

 

I don't know if you want to script the door as well. If you do, then remember to disable the trigger zone if the door gets picked open as well.

 

EDIT: Oh yeah, after you save the script, remember to set what faction goes into the faction property.

Edited by fg109
Link to comment
Share on other sites

Badass, I'll report my findings after a bit of BF3. ;)

 

EDIT:

 

1. AddToFaction is not a function or does not exist

RemoveFromFaction is not a function or does not exist

 

...is the error I get when the script compiles.

 

I'd check to to if the nomenclature was off but I have no reference. Is there a website with a list of all the scripting commands like .. ARMAII (or operation flashpoint) if you're familiar with those

 

2. After that save, the properties don't include a place to specify the faction. Is this because the script didn't compile right as a result of problem 1?

 

 

Sorry, I'm a scripting newb for TES series. But I apreciete your swift responces. This is how I learn quickest.

Edited by ual002
Link to comment
Share on other sites

Oops, I forgot about casting. Basically, anything can trigger the event for the trigger, but AddToFaction only works on actors. So casting is needed:

 

scriptname MyTriggerScript extends objectreference


Faction property BanditFaction auto                                     ;declare a Faction property


Event OnTriggerEnter(ObjectReference akActionRef)	;this event is received when something enters the trigger zone

if (akActionRef == Game.GetPlayer())	;check to see if whatever entered is the player
	(akActionRef as Actor).AddToFaction(BanditFaction)		;add the player to BanditFaction
endif

EndEvent


Event OnTriggerLeave(ObjectReference akActionRef)	;this event is received when something leaves the trigger zone

if (akActionRef == Game.GetPlayer())	;check to see if whatever left is the player
	(akActionRef as Actor).RemoveFromFaction(BanditFaction)	;remove the player from BanditFaction
	Disable()		;disable itself so the player doesn't get added to faction again if he/she returns
endif

EndEvent

 

And the Papyrus page on the CK wiki lists all the scripting functions.

Edited by fg109
Link to comment
Share on other sites

Oops, I forgot about casting. Basically, anything can trigger the event for the trigger, but AddToFaction only works on actors. So casting is needed:

 

scriptname MyTriggerScript extends objectreference


Faction property BanditFaction auto                                     ;declare a Faction property


Event OnTriggerEnter(ObjectReference akActionRef)	;this event is received when something enters the trigger zone

if (akActionRef == Game.GetPlayer())	;check to see if whatever entered is the player
	(akActionRef as Actor).AddToFaction(BanditFaction)		;add the player to BanditFaction
endif

EndEvent


Event OnTriggerLeave(ObjectReference akActionRef)	;this event is received when something leaves the trigger zone

if (akActionRef == Game.GetPlayer())	;check to see if whatever left is the player
	(akActionRef as Actor).RemoveFromFaction(BanditFaction)	;remove the player from BanditFaction
	Disable()		;disable itself so the player doesn't get added to faction again if he/she returns
endif

EndEvent

 

And the Papyrus page on the CK wiki lists all the scripting functions.

 

 

I'll give it a go once again when I get home. Thanks. Also I found some resources since posting the other night. Figured I could try and not be totally useless and use the google machine. But yet another thank you.

Link to comment
Share on other sites

On an unrelated note, if you follow the link to download my mod... If you load skyrim and immediately coc calavalcave, and leave the cell to skyrim worldspace, if you turn around, the cave entrance isn't there. Not until you go back in a come out again does it appear. WTF?
Link to comment
Share on other sites

  • Recently Browsing   0 members

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