Jump to content

OBSE Input Scripting


shez11

Recommended Posts

I am trying to do a small TC for testing in education. A bit ambitious, I know but have done the world and several small quests.

Have been avoiding OBSE but have finally succumbed

I need to be able to test input of player against a quest variable. Is this possible and could some kind soul point me in the right direction?

What do I need to attach the OpenTextInput and GetTextInput to? My quest variable will be a float that I need to check against.

Any help or guidance or an existing tutorial/ mod that has used this would be great

Link to comment
Share on other sites

I am not quite sure if this is exactly what you wanted, but try this:

 

scn spellscript

float output
short textopen
string_var input

Begin MenuMode

if (textopen == -1)
	UpdateTextInput
endif

End

Begin ScriptEffectStart

let textopen := -1
OpenTexttextopen "Type in a number.  Only use numerals and decimal point.%r|Complete" 0 30

End

Begin ScriptEffectUpdate

if (textopen == -1)
	let textopen := GetButtonPressed
	Return
elseif (textopen == 0)
	let input := GetInputText
	CloseTextInput
endif

End

Begin ScriptEffectFinish

let output := sv_ToNumeric input
MessageEX "You typed %.4f." output

End

 

I've never tried putting a menumode block inside a spell script before, but on the CS wiki, it says that it works.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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