ProjectEW Posted February 9, 2011 Share Posted February 9, 2011 (edited) So...yeah, I'm having some trouble doing exactly what the title says. I currently have a trigger that encompasses the area I don't want them to be, with a script attached to it. This is the script (I use maybe one or two NVSE functions): scn xyzAntiDeathclawTriggerSCRIPT int markerX int MarkerY int MarkerZ ref ActionRef BEGIN OnTriggerEnter Set MarkerX to xyzAntiDeathclawMarker.GetPos X Set MarkerY to xyzAntiDeathclawMarker.GetPos Y Set MarkerZ to xyzAntiDeathclawMarker.GetPos Z Set ActionRef to GetActionRef if ActionRef.GetBaseObject == (QJDeathclawAlphaMale || QJDeathclawAmbusher || QJDeathclawBaby || QJDeathclawDead || QJDeathclawEater || QJDeathclawHawkins || QJDeathclawMother || QJDeathclawWanderer01 || QJDeathclawWanderer02 || QJDeathclawWanderer03 QJDeathclawWanderer04 || QJDeathclawWanderer05) ActionRef.SetPos X MarkerX ActionRef.SetPos Y MarkerY ActionRef.SetPos Z MarkerZ endif END This does absolutely nothing. I am in Quarry Junction, so these should be the right Deathclaws to filter out, right? The area is a little mobile home, where I have one human NPC, and I will have to enter the place as well. Also, xyzAntiDeathclawMarker does exist, in fact, it's in the same cell only about 10 feet away. Can someone here please shed some light as to why this doesn't work? Thanks. Edited February 9, 2011 by ProjectEW Link to comment Share on other sites More sharing options...
davidlallen Posted February 9, 2011 Share Posted February 9, 2011 if ActionRef.GetBaseObject == (QJDeathclawAlphaMale || QJDeathclawAmbusher || ...While this line has correct syntax, it is not at all what you want. What you want is:if (a == b) || (a == c) || (a == d) Link to comment Share on other sites More sharing options...
ProjectEW Posted February 9, 2011 Author Share Posted February 9, 2011 Okay, well, I tried your suggestion, by putting ActionRef.GetBaseObject == in front of all of them, but that makes it exceed max script line length. Any way to shorten what I'm trying to do? Thanks, by the way. Link to comment Share on other sites More sharing options...
davidlallen Posted February 9, 2011 Share Posted February 9, 2011 1. Set a variable r to ActionRef.GetBaseObject and use that.2. Are these particular creatures all in the same faction? If so you can use a single GetInFaction instead. Separately, you may want to use moveto instead of setpos x, setpos y, setpos z. Link to comment Share on other sites More sharing options...
rickerhk Posted February 9, 2011 Share Posted February 9, 2011 Double post Link to comment Share on other sites More sharing options...
rickerhk Posted February 9, 2011 Share Posted February 9, 2011 Sometimes certain functions won't work if inside an IF statement. I like to separate out and not try to use compound function statements - for the base object, set a ref variable, like what David said, then test it. Also, you can use a form list to simplify. scn xyzAntiDeathclawTriggerSCRIPT int markerX int MarkerY int MarkerZ ref ActionRef ref rBaseObject short iIndex ;These are in DeathClawFormList: (QJDeathclawAlphaMale || QJDeathclawAmbusher || QJDeathclawBaby || QJDeathclawDead || QJDeathclawEater || QJDeathclawHawkins || QJDeathclawMother || QJDeathclawWanderer01 || QJDeathclawWanderer02 || QJDeathclawWanderer03 QJDeathclawWanderer04 || QJDeathclawWanderer05) BEGIN OnTriggerEnter Set MarkerX to xyzAntiDeathclawMarker.GetPos X Set MarkerY to xyzAntiDeathclawMarker.GetPos Y Set MarkerZ to xyzAntiDeathclawMarker.GetPos Z Set ActionRef to GetActionRef set rBaseObject to ActionRef.GetBaseObject set iIndex to ListGetFormIndex DeathClawFormList rBaseObject if iIndex > -1 ;its in the list ActionRef.SetPos X MarkerX ActionRef.SetPos Y MarkerY ActionRef.SetPos Z MarkerZ endif END Link to comment Share on other sites More sharing options...
ProjectEW Posted February 9, 2011 Author Share Posted February 9, 2011 (edited) Thank you davidlallen! Using the GetFaction function worked! And using a variable shortened it enough to fit in a single line. I feel dumb for not thinking to use a variable for that...Thanks for the suggestion rickerhk, but I forgot to refresh the page, and I didn't see your post. Edited February 9, 2011 by ProjectEW Link to comment Share on other sites More sharing options...
Recommended Posts