Jump to content

Unusual but related scripting questions


HerrBaron

Recommended Posts

 

thc1234,

 

Working on something like this as we speak; I was trying to stay away from NVSE (Not because I don't like it, NVSE is terrific; I was just hesitant to introduce it into my codebase if I could think of another way to do it...). I'll post back as soon as I get it working, and let you know how it worked out! BTW, isn't PlaceAtMe only useable with form id's, not persistent references, like, say, BooneREF or VeronicaREF? Since there's only one of these each in-game, wouldn't you be creating copies of them, and bloating the game saves?

 

You're right; they are ALL pervs; you should SEE what they get upto in that tent when my back is turned! :P

 

-HB

 

PlaceAtMe should have been MoveTo & GetIsTeammate should have been GetPlayerTeammate. I'll never again post late night after coming from pub.

Anyways glad You solved it!

 

alho if I may say how does performance of filling list with all Actors from entire game looks ? - (2048 cells seems like overkill lol - yeah non-persistent references are unloaded, so it's not really that much of overkill)

also why did You use "follower" condition in load cycle instead of in fill list cycle ?

Edited by thc1234
Link to comment
Share on other sites

thc1234,

 

Working on something like this as we speak; I was trying to stay away from NVSE (Not because I don't like it, NVSE is terrific; I was just hesitant to introduce it into my codebase if I could think of another way to do it...). I'll post back as soon as I get it working, and let you know how it worked out! BTW, isn't PlaceAtMe only useable with form id's, not persistent references, like, say, BooneREF or VeronicaREF? Since there's only one of these each in-game, wouldn't you be creating copies of them, and bloating the game saves?

 

You're right; they are ALL pervs; you should SEE what they get upto in that tent when my back is turned! :P

 

-HB

 

PlaceAtMe should have been MoveTo & GetIsTeammate should have been GetPlayerTeammate. I'll never again post late night after coming from pub.

Anyways glad You solved it!

 

alho if I may say how does performance of filling list with all Actors from entire game looks ? - (2048 cells seems like overkill lol - yeah non-persistent references are unloaded, so it's not really that much of overkill)

also why did You use "follower" condition in load cycle instead of in fill list cycle ?

 

hahahah! It's the thought that counts! :)

 

Nonononononono! 2048 is the SIZE of the cell, not the number of cells, it's a couple of kilometers, and I rarely get 7-8 actors. the 200 specified is the type of reference (ACTOR) and that limits it pretty effectively.

 

Best to ya buddy! oh, and almost forgot; Merry Christmas!

 

-HB

Link to comment
Share on other sites

* The trick above won't work with pre-loaded furnitures : It seems neither MoveTo nor SetPos are allowed with furniture objects unless they are spawned with the PlaceAtMe function.

Try using this, but create a new door. I am not sure what they mean by Pre-Loaded furnitures. Try it wil This door I know it doesn't fit, but will work for testing.

Thanks, Interfero; found something similar on the GECK wiki, but oddly, the door I'm using won't move consistently, only sometimes... pretty odd. Even tried using SetPos instead of MoveTo; no joy.

What is meant by "pre-loaded furnitures" are Furniture objects that are placed in the editor. Unless they are created dynamically at run-time (with PlaceAtMe) SetPos and MoveTo have no effect on them. Statics are the same, but I don't think Doors have this problem (EDIT: just checked, and no they don't).

 

To get the havok collision to update properly after moving (fixed) objects, Disabling then Enabling should be enough, but depending on what's going on you may need to wait a frame between those commands. Also, if you use "Enable 0" instead of just "Enable" you should be able to avoid the fade-in effect in most cases.

 

 

 

For an NVSE check, you can do something like:

...

At the risk of jinxing it, doing NVSE checks may get A LOT easier (and work better) relatively soon. Keep your fingers crossed.

Link to comment
Share on other sites

* The trick above won't work with pre-loaded furnitures : It seems neither MoveTo nor SetPos are allowed with furniture objects unless they are spawned with the PlaceAtMe function.

Try using this, but create a new door. I am not sure what they mean by Pre-Loaded furnitures. Try it wil This door I know it doesn't fit, but will work for testing.

Thanks, Interfero; found something similar on the GECK wiki, but oddly, the door I'm using won't move consistently, only sometimes... pretty odd. Even tried using SetPos instead of MoveTo; no joy.

What is meant by "pre-loaded furnitures" are Furniture objects that are placed in the editor. Unless they are created dynamically at run-time (with PlaceAtMe) SetPos and MoveTo have no effect on them. Statics are the same, but I don't think Doors have this problem (EDIT: just checked, and no they don't).

 

To get the havok collision to update properly after moving (fixed) objects, Disabling then Enabling should be enough, but depending on what's going on you may need to wait a frame between those commands. Also, if you use "Enable 0" instead of just "Enable" you should be able to avoid the fade-in effect in most cases.

 

 

 

For an NVSE check, you can do something like:

...

At the risk of jinxing it, doing NVSE checks may get A LOT easier (and work better) relatively soon. Keep your fingers crossed.

 

Hey, HugePinball! Fancy seeing you here; I'm actually getting ready to install the NV version of your Feng Shui; have it sitting in my downloads ready to go!

 

Thank you for the above; didn't know about the 0 flag on the Enable function; I'll have to give it a try. One question, probably a stupid one; when you say "wait a frame", how would you do that in a GameMode block? set a flag and return?

Link to comment
Share on other sites

One question, probably a stupid one; when you say "wait a frame", how would you do that in a GameMode block? set a flag and return?

Basically something like that, yes. I'd probably set up an if/else block, so using that given example it would be something like:

 

if DoEnable == 0
myObject.Disable
myObject.MoveTo myMarker
set DoEnable to 1
Return	;only needed if there is more code after this if/else block
elseif DoEnable == 1
myObject.Enable 0
set DoEnable to 2
endif

 

Obviously that may have to be changed around a bit depending on how you're using it, but the idea just not to do both commands in the same script iteration.

Link to comment
Share on other sites

One question, probably a stupid one; when you say "wait a frame", how would you do that in a GameMode block? set a flag and return?

Basically something like that, yes. I'd probably set up an if/else block, so using that given example it would be something like:

 

if DoEnable == 0
   myObject.Disable
   myObject.MoveTo myMarker
   set DoEnable to 1
   Return    ;only needed if there is more code after this if/else block
elseif DoEnable == 1
   myObject.Enable 0
   set DoEnable to 2
endif

 

Obviously that may have to be changed around a bit depending on how you're using it, but the idea just not to do both commands in the same script iteration.

 

Thanks! Great stuff. One of the first things I learned when I started to pick up TES scripting is that any resemblance to a "real world" programming or scripting language is purely incidental. Although this does seem to be a form of State Machine, right?

 

I've not done enough TES scripting to have learned the finer points, so this tip is another for my notes! :thumbsup:

Edited by HerrBaron
Link to comment
Share on other sites

At the risk of jinxing it, doing NVSE checks may get A LOT easier (and work better) relatively soon. Keep your fingers crossed.

I patiently await.

 

By the way, what do you mean by "At the risk of jinxing it"?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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