NexusComa Posted January 1, 2019 Posted January 1, 2019 From what I understand (take this with a grain of salt) ...It's best not to rely on a variable to hold a value based off a gather call. ie: The same problem you get when you call the player as a variable thentry to use that variable from a call that needs to gather it's data. I can't explain whyit could be a limitation of the language or the game setup ...In any case sometimes you do need to gather that data directly. Case and point: this IF statement will never fail. But if you use GetCasterActor() in both parts it will from time to time fail.Notice getcasteractor is used directly but when pulling the datafor the IF statement the direct form would be game.getplayer. If(Game.GetPlayer().HasSpell(PolymorphSpell)) HasBeastflag=(1) Else GetCasterActor().AddSpell(PolymorphSpell)EndifIt would seem with longer scripts the direct forms are the way to go.Again I may be way off ... but also have made scripts with well over1000 lines that will not work at all unless this form of the calls are used.Some games that use many many scripts to maintain the game seem to suffer from this.At some point some script is using the same data you are so direct calls are needed.Again who knows why ... this defies programming and has to be a result of design.In short: If it's not working as expected try a more direct call to get your data.
Rizalgar Posted January 1, 2019 Author Posted January 1, 2019 I thank you for your reply, sir! I'll keep that in mind. Now if only I could figure out why a script calling a function from another script keeps compiling with "aktarget is not defined... blah blah..."
NexusComa Posted January 1, 2019 Posted January 1, 2019 Set up a fake one (a place holder of sorts) in that script then call the real one from the other script.
Rizalgar Posted January 2, 2019 Author Posted January 2, 2019 That, my good man, is what I did. Thank you, though
Recommended Posts