And, triggers occasionally completely miss and don't run their "ontriggerenter" code on something which entered the trigger. I've seen that its not a matter of the npc/creature/player passing through it too quickly. They really can totally miss. If your application needs perfect handling of all the nearby npcs/creatures, you won't be using triggers for it.
-
How to make a "ref walk explosion"
Step 1. Decide and create what you want to do to the npc/creature once you've detected it. In this case, I'll assume that you are adding a scripted item to the npc/creature (which I call "mobs" from here on out). The purpose of this item being that it can have script code attached to it which affects the mob in the way you choose.
So, rename an Abraxo Cleaner item (its in category "Misc Item" in the GECK). You do this by single clicking the name as it appears in the "Misc Item" list, and the name will allow you to type in a new one that way. When you hit enter on it, a box will come up asking you about stuff - - tell it to make a new item. For the example I'll call ours MyHappyBoxItem. Then, write yourself an object type script with the script code you want to be run on every REF you've selected with your explosion. Then, CLOSE THE ITEM WINDOW COMPLETELY and reopen it. Your new script should be available to select in the dropdown list.
Basic form of script is below (it is written for clarity not for optimization btw), and the thing I decided to do to each mob is move the NPC to my special Xmarker which is... elsewhere.
Note: always exclude the player from script code like this unless you really mean it to run on him. which in this context, you wouldn't.
scn MyHappyBoxSCRIPTref TheNPCbegin onadd set TheNPC to GetContainer if TheNPC == Player removeme endif TheNPC.moveto MyXmarkerSomwhereElseREF removemeend
Step 2. Create a new script, and set it to type "effect" in the dropdown to the top right of the script window. Make your script have a "scripteffectstart" block which does 2 things. It selects which mobs to do stuff to, and in this case, it is adding our special item. Example is like this - - this happens to detect a typical follower who has not been told to "wait". (Note: always have some condition which excludes the player if you're not trying to add something to him in your explosion. My intended conditions here for a follower happen to do that naturally. If they did not, I would add code similar to what's in the object script earlier).
scn MyExplosionEffectSCRIPTbegin scripteffectstartif getplayerteammate == 1 && getcurrentaipackage != 35 && getcurrentAIpackage != 36 additem MyHappyBoxItem 1endifend
Step 3. Create a new "base effect" in the GECK. Configure it from the top down this way. Pick an ID for it (I'm picking "MyExplosionBaseEffect" as the ID), and for Name just put whatever you want that makes sense, its just for you to see. On the Effect Archetype, you must select "Script" from the list. Then for "Assoc. Item" you pick your effect script's name from the list (in this example it is "MyExplosionEffectSCRIPT"). Then go down to the dropdown boxes and click these boxes only: Self Touch Target No-Duration. Then click okay to finish making it.
Step 4. Create a new "object effect" in the GECK (it is below "Ingestibles" which is right below the other effect types). Configuring it from top down: give it an ID, for this example I'm picking "ENCHMyExplosion". For name, put whatever you want, like before. For the Type dropdown, pick "Weapon". Then, right click the empty list-looking area to the right of that window that says "Effects", and left-click New when it comes up. In that new window called Effect Item, configure from top down: for "Effect" pick "the name of the new "base effect" you made in step 3 (our example one was: "MyExplosionBaseEffect"), for Range pick "Touch", Area is 0, Duration should be greyed out, and magnitude would be 0. (You might notice where its possible to put conditions in here, but I happened to do it in the explosion script itself, either way should work to exclude/include targets I think). When you click "Okay" on that, you should have a line now listed in the formerly-empty "Effects" side of your Object Effect window, and it has your base effect there. Click Okay on that last window to close it out.
Step 5. Go to the "Explosion" item listing in the GECK. Pick yourself an explosion which talks about being "fake", such as "FakeForceBall250", and look at what it has after double-clicking on it. At the top right, be sure it is using "Effects\FXNullExplosionArt.NIF". That "Edit" button next to it is not useful, just use your mouse to scroll the text to the right to see that it's got the right name.
If you found what you want, click cancel, and then, in the main GECK item list, rename it to what you want your explosion to be named, and then select Yes for creating a new object. For this example I'll call mine MyHappyExplosion. Double click on the new explosion that the GECK created for you (wherever it may have landed in the GECK's exploson list), and configure it from top down like this: ID ls already there, for Name pick whatever you care to see, Force is 0, Damage is 0, Radius - - pick how far away you want your refwalk to be able to detect to, 2000 is not a bad choice. IS Radius is 0.0. In the 4 checkboxes, click only Ignore LOS Check and Ignore Imagespace Swap. On the right, select Light as "None", select Enchantment as the object effect you made in step 4 (we had named it "ENCHMyExplosion" for this example). Set everything else below that as None/Silent/Never/ things like that. Then, click okay.
Now, you're done creating your refwalk explosion, but it won't work if you don't use it properly. To make it go off, you are probably going to use a script to do something like this.
player.placeatme MyHappyExplosion
I've been told by Cipscis that using placeatme for explosions does not cause savegame bloat so it's alright to use in this context. Normally you don't go around the wasteland dropping things using placeatme because they don't necessarily clean up well in the savegame,
To use this properly, you should:
- - only blow off your explosion in the vicinity of the player (the "loaded area").
- - once it's blown off, don't move the player immedietely out of the area. Explosions like this seem to take time to get their work done. Use a timer in your script if necessary to force the player to stay where he is for a while, maybe 30 - 60 frames, something like that, I don't know how long is needed for sure.
- - if you are using a scripted item such as the example "MyHappyBoxItem". It may be the case that you are using some "gamemode" code in your item's script instead of just one "onadd" block. Do not move the player out of the loaded area while you're expecting gamemode code on your item to be running. Give all the scripts time to complete their operations (whatever your operations may be). Even if you think you see it work once or twice after moving the player out of the area, don't expect gamemode code to run reliably like that.This is not related to if the mob has "low level processing" enabled. If this doesn't match up well with the process you're making, change the process in a way that causes the mob to be in the loaded area at the critical times.
A note about moveto and refwalk explosions -
don't confuse problems with moveto not doing what you expected with a problem with your refwalk explosion, item scripts, and timing. If you think your refwalk operations are messing up, stop the game at critical times using your console and test for the presence of your item, etc. For example on followers - - some of the caviats regarding moving followers around are seperate from what makes a refwalk explosion work.
------------------------------------------------
Hopefully I didn't forget anything or mix up anything in this process. Anyhow, there it is.