Jump to content

Replacing items with statics via scripting


FiftyTifty

Recommended Posts

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.

 

Couldn't move it to me using the console so I couldn't check, but I don't think I can activate through the player anyway, as it does not have a mesh.

 

How do I use the ScriptWait command?

Link to comment
Share on other sites

  • Replies 43
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Script wait command ... are you serious ?

 

A timer would do it.

 

As if someone would spend the time to code a command for a script to wait ... but then it still needs a timer input. wait is an npc function , not for a script. Scripts don't wait around like npc's do ... hehe.

Link to comment
Share on other sites

I think you may actually need a mesh. I'm not as sure of that as I was about the name thing, but I think I ran into this problem before and needed a mesh. And it needs to have collision if it's related to the problem I'm remembering. Just grab any model and give it a null texture in the GECK. Pix and I made a marker version that you can see in the editor but not in-game, but you shouldn't need that here. Edit: Not completely worthless, but when I'm in a rush, sometimes I get stupid ideas in my head and then say stupid things following from that. If the OnActivate block is now printing, you obviously don't need a mesh. But it may be nice to have one for debugging.

 

I'm thinking I may have been wrong about the logic behind using ScriptWait here, because I used it for something like this, but the activator was already in the cell (spawned it as soon as the player enters), so it's not exactly the same. Edit: Wait, I'm an idiot. Now that the script is running, you do need the ScriptWait line to wait for the misc items to be ready to be moved (or at least you want to try it).

 

Any time you want your script to wait a couple of frames, you just do a line that says ScriptWait <number of frames you wish to wait>. In this case, you'd use it right after your misc item gets placed near the player. But it doesn't work in UDFs, which is what the activator allows us to circumvent. It doesn't work in result scripts, either, but that's not quite relevant here.

 

And Mktavish, the ScriptWait command is cool because it doesn't require a GameMode block and it's faster to type it in. Additionally, it counts frames instead of seconds, which is usually a detriment in my experience but could be an advantage in some situations.

 

 

-----------------------------------------------------------------------------------------------------------------------------

I wrote this before I remembered that you do want the ScriptWait line. I'll leave it for posterity:

-----------------------------------------------------------------------------------------------------------------------------

For now, I would just try activating it in-game by walking up to it and pressing E, just to make sure that aspect works. If it does, I would brute-force it with a GameMode block on the activator as I mentioned earlier. Just gate it with a variable or something, but it should work if walking up to it and activating it works.

 

Edit: Another way to do this rather hacky is a script effect cast on the player. This should work anyway, but if you feel like trying that, it's there.

Edited by EPDGaffney
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...