Skip to content

Scripting: Make your projected image / simularum cast spells via script

rion26rion26 Member Posts: 25
Hello there,

I would like to know how you can script your PI to actually cast some spells. All script actions I have tried seem to address the main character, so after PI has been cast if I tried for example...

IF
See(NearestEnemyOf(Myself))
HaveSpell(WIZARD_PRISMATIC_SPRAY)
THEN
RESPONSE #100
Spell(NearestEnemyOf(Myself),WIZARD_PRISMATIC_SPRAY)

...nothing would happen because the main character is stunned and can not perform any actions as long as the PI is active. so how would I get the above spell to be cast by the PI or by my simularum?

Thank you for sharing your knowledge!



Comments

  • BlucherBlucher Member Posts: 110
    edited March 2014
    It's a little tricky (and requires some scripting knowledge), but it's not very complicated.

    Basically, your character(s) "see" a valid (unchanged) simulacrum (or PI, summoned creature, or whatever) and changes its script. The simulacrum (using the new script) then makes itself invalid to prevent further changes (the way I chose was to change its internal "specifics" value) and carries on with its business using its new script.

    I will attach my old "GB" scripts to this post as an example, if possible. Look for "// Simulacrum AI Change" in GB-Mage.baf and "// Prep" near the top of GB-SMag.baf for the script blocks actually doing what you want here.

    Bear in mind these scripts are well over 12 years old, and I could improve them in so many ways, but I don't have the motivation. You could even use them in game as far as I know, though they are very much tailored to my preferences (or at least were). Also, the string references would probably have to be updated if using them in the EEs...
  • rion26rion26 Member Posts: 25
    Many Thanks, helped me a lot!
Sign In or Register to comment.