Jump to content

Spells using OBSE functions


CBMFreak

Recommended Posts

Hi.. i have problems with 2 thing mainly in my mod... text input when using a spell and constrolling collision...

 

First... using obse text input from a spell...

 

scriptName PHRenameActor

int button

int state

string_var userText

string_var msgUser

 

;begin OnEquip

begin ScriptEffectStart

if (IsTextInputInUse == 0)

OpenTextInput "Type stuff (max 20 chars) | Finished" 0 20

set state to 1

endif

end

 

begin menuMode

if (state)

set button to GetButtonPressed

if (button == 0) ; user has finished

set userText to GetInputText

CloseTextInput

set state to 0

 

let msgUser := "You typed, " + userText + "!!!"

MessageBox $msgUser

SetActorFullName userText

 

else

UpdateTextInput

endif

endif

end

 

This spell script should let me type a name for an actor.. show a message box with the name and finally name the actor that is selected... but it seems that the menuMode code is never executed?

 

Second.. Collision...

 

Is it possible to create a mount that has no collision... ie. making a ghost horse that can ride through walls and solid objects?

Is it possible to create a spell that makes the player a ghost and then disables collision for the player while the spell lasts? I *kinda* succeded in the ghost effect by using google... It disappears rather fast though...

 

scn PHGhostEffectScript

 

float timer

 

begin ScriptEffectStart

player.saa 0.01

pms ghosteffect

set timer to 1

;Increment timer

;set timer to timer + GetSecondsPassed

end

 

begin ScriptEffectUpdate

set timer to timer + GetSecondsPassed

end

 

begin ScriptEffectFinish

if ( timer > 159 ) ;effect ends (need to restore body to normal)

player.saa 1

sms ghosteffect

endif

end

 

This script gives the player a ghost effect but it wears off rather quickly despite that the spell duration and script timer are both 160 seconds... ??

 

Any help would be greatly appriciated...

 

Regards from CBMFreak.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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