Jump to content

Replacing items with statics via scripting


FiftyTifty

Recommended Posts

Oh? Never used that one, Mktavish. Kind of never knew it existed. That's quite a find.

 

What ? no mention of me using the new wiki in links :ohmy:

 

Sheesh , now I have no motivation to do the extra work , except fear of chastisement :armscrossed: .

 

Hehe LOL :tongue:

Link to comment
Share on other sites

  • Replies 43
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

If you want to activate an activator and use its OnActivate script block, you need to set the flag and I believe specify the action ref. So, your Activate line becomes:

    AAAFyTyActivatorFreezeItemsRef.Activate Player 1

Activate without the flag will activate the item the way its form type would normally respond to being activated if the item had no attached script, which for doors means opening or closing, items means picking up, and for activators is actually nothing. Which is why nothing happened.

 

Unfortunately that didn't fix it. The script attached to the activator is not run.

Link to comment
Share on other sites

That's honestly just weird. Try attaching a GameMode block to the activator with a bDoOnce check and make it just keep activating itself until it actually works and then flip the bool. Or maybe have the GameMode block start off with a ScriptWait. I've had to force things like that before and it did work. Don't remember the specifics, but maybe that would work here.

 

Edit:

This line couldn't be crashing it somehow, could it? Change it to Let to get an error message in the console if it is.

set refMarker to AAAFyTyNPCDummyRef
Edited by EPDGaffney
Link to comment
Share on other sites

I just made static items with the meshes of normal ingestibles.

And they're absolutely static.

That's great. What I think I remember happening was trying to keep an item static in mid-air using this method, and that it worked until I left the cell and returned, at which point it was on the ground. The cell may or may not have reset at that point. But even then, if I'm remembering that right, it should work for laying something neatly on a table or something like that.

Link to comment
Share on other sites

 

That's honestly just weird. Try attaching a GameMode block to the activator with a bDoOnce check and make it just keep activating itself until it actually works and then flip the bool. Or maybe have the GameMode block start off with a ScriptWait. I've had to force things like that before and it did work. Don't remember the specifics, but maybe that would work here.

 

Edit:

This line couldn't be crashing it somehow, could it? Change it to Let to get an error message in the console if it is.

set refMarker to AAAFyTyNPCDummyRef

 

 

Nah, that line isn't messing anything up. It worked fine prior to moving the script to the activator, and changing it to let doesn't make any difference.

Link to comment
Share on other sites

I think that using MoveTo could be delaying the activator's ability to accept activation, as it takes a couple of frames to process, which is reproducing the PlaceAtMe problem if that's the case. That's why I said you could add a GameMode block to your activator that keeps attempting to activate itself until it actually works, because there's no reason that it shouldn't work, apart from stupid little hitches like what I think this is.

 

SetPosEx is the fastest function to move something somewhere (far as I know at least), so you could try it that way as well. But I don't think you need it in the cell anyhow. I know I've run OnActivate scripts on objects that weren't even in the same worldspace and had them work fine, but it could depend on the function or maybe even form type.

 

Another debug you could try is simply activating the activator manually. Just drop it in the cell and press E on it to see what it does.

 

Just remembered a weird one. I think your activator needs to have a fecking name or it won't work. You probably didn't give it one cos you didn't want the rollover text I'm guessing?

Link to comment
Share on other sites

Might be a stupid mention , but what if you change that prefix since "AAA" is so common ?

 

And make sure you toggle that archive invalidation , in case you hadn't tried it yet.

 

One last thought ... try a run with making it into an .esm

Link to comment
Share on other sites

I think that using MoveTo could be delaying the activator's ability to accept activation, as it takes a couple of frames to process, which is reproducing the PlaceAtMe problem if that's the case. That's why I said you could add a GameMode block to your activator that keeps attempting to activate itself until it actually works, because there's no reason that it shouldn't work, apart from stupid little hitches like what I think this is.

 

SetPosEx is the fastest function to move something somewhere (far as I know at least), so you could try it that way as well. But I don't think you need it in the cell anyhow. I know I've run OnActivate scripts on objects that weren't even in the same worldspace and had them work fine, but it could depend on the function or maybe even form type.

 

Another debug you could try is simply activating the activator manually. Just drop it in the cell and press E on it to see what it does.

 

Just remembered a weird one. I think your activator needs to have a fecking name or it won't work. You probably didn't give it one cos you didn't want the rollover text I'm guessing?

 

Aye, giving a name to the activator allows it to run the script. But the issue still persists; some MISC item objects aren't moved by the script after being placed at the player.

Link to comment
Share on other sites

Does it work if you activate the activator manually by pressing E on it (or A on a controller)?

 

I didn't see a ScriptWait in your script. I believe you're going to need that. If you've never used it, object scripts count frames and quest scripts count in the interval the quest processing delay is set to. You'll just need a couple of frames if this is the problem. Start with a big number anyway, just for testing, and work down. In my experience, I first started with 20 and it felt responsive as well as working reliably, but you can start bigger or smaller if you like.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...