Calling Replacing Actor's Script

Post » Thu May 03, 2012 8:32 pm

I m trying to combine CM dialogs to my mod.
The problem is that i have to make the one of the two staring scripts as a user function.
Then I shall use Call "Script" and Begin Function .... to call this.
But my scripts have other Begin ... commands and machine cannot combile properly the mod.
It there any way to completelly replace the Script of an Actor and load an other in him?

Example:
When my Actor is not following he/she uses MyCustomScript
but...
When i tell him to follow, i want it to remove that script and load CMpartners script.

Is this possible?
User avatar
Mr.Broom30
 
Posts: 3433
Joined: Thu Nov 08, 2007 2:05 pm

Post » Thu May 03, 2012 3:45 pm

I don't recall seeing a command that specifically lets you swap out scripts attached to objects, but if there was such a command it would undoubtedly be OBSE. I somewhat doubt there is one. What you can do is Call a script on a reference and it will act as if it were attached to that reference while the called script executes, which I imagine would accomplish the same thing. I can't tell you how well that would work with an actor ref, however, since I've never tried it myself.

[Edited]

I'm also unsure how you would block the actor's attached script from running. You'll probably have to override the default CM scripts with your own modified versions so you can switch them off, for instance with a flag variable. Of course, if you're already overriding the CM scripts you might as well just build your own code right in. Much less hassle all the way around.

Anyway, good luck with your project :)
User avatar
Beulah Bell
 
Posts: 3372
Joined: Thu Nov 23, 2006 7:08 pm

Post » Thu May 03, 2012 10:27 pm

Thanks a lot man
User avatar
Yama Pi
 
Posts: 3384
Joined: Wed Apr 18, 2007 3:51 am

Post » Thu May 03, 2012 6:12 pm

http://cs.elderscrolls.com/index.php/SetScript is designed to do what you want . . . or not (as it is Beta).
User avatar
Damian Parsons
 
Posts: 3375
Joined: Wed Nov 07, 2007 6:48 am


Return to IV - Oblivion