Jump to content

script: RegisterForUpdate am i save?


h4n4

Recommended Posts

It is better for simple effects. If you want your spell do one thing if the player has sun damage, and something else if the player does not have sun damage, then an update chain might be better. If the spell is only going to be on or off then conditions are probably better.

so conditions for: on/off, yes/no

update chains for: a/b

got it

Edited by h4n4
Link to comment
Share on other sites

Theoretically if you wanted to avoid the update chain you could do a second spell/ability with its own effects using the opposite conditions as the first. That way as one finishes the other would start. I've never done it but it sounds plausible.

Link to comment
Share on other sites

Theoretically if you wanted to avoid the update chain you could do a second spell/ability with its own effects using the opposite conditions as the first. That way as one finishes the other would start. I've never done it but it sounds plausible.

im not sure but that doesnt sound that much "cleaner". I really dont know how the performance of the game is influenced by both options. atm its just to say "ohoh i dont use scripts in my mod" but i dont care about that. In most cases its silly

 

arnet condotions basically update chains that are just run by the game itself instead an external script?

Edited by h4n4
Link to comment
Share on other sites

There are some good reasons to avoid scripts. But if you're making an ability with multiple effects and 3, 4, 5 conditions or more for each effect, you're probably better off just scripting it. Especially if you want to pass variables back and forth between the effects or something complex like that. It's probably not worth the hassle. Conditions can be checked by the game engine every second without consuming script resources, which is a good practice (remember that your mod probably isn't the only one running an update block). But unless your update block is truly massive it's probably not something to get overly concerned about.

Link to comment
Share on other sites

There are some good reasons to avoid scripts. But if you're making an ability with multiple effects and 3, 4, 5 conditions or more for each effect, you're probably better off just scripting it. Especially if you want to pass variables back and forth between the effects or something complex like that. It's probably not worth the hassle. Conditions can be checked by the game engine every second without consuming script resources, which is a good practice (remember that your mod probably isn't the only one running an update block). But unless your update block is truly massive it's probably not something to get overly concerned about.

well 20 lines every 5 seconds.. oh well

 

on the variables thing: i was playing around with that. Do i have to declare all vars i want to use in multiple scripts as globals or how can i pass them form one magic effect to another?

Link to comment
Share on other sites

You have to declare them as properties and then add the magic effect as a script property. I'll probably just confuse you if I try to explain it. Check the wiki, here:

 

http://www.creationkit.com/Variables_and_Properties#Getting_Properties_of_a_Quest_Script

oh ok. That seems intresting. ill keep that i mind for more advanced stuff. You dont know how you can pass a var to a Nif file by any exident? i was looking for that a few days ago... probably something completly different

Edited by h4n4
Link to comment
Share on other sites

  • Recently Browsing   0 members

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