Jump to content

Displaying value (0-9) from global variable on "oversized nixie tube"


Recommended Posts

Hello again!

 

You know those "oversized nixie tube" things, right?

These things: https://fallout.fandom.com/wiki/Oversized_Nixie_tube

They can display the numbers 0 to 9.

So I thought I could use them to display the values of some global variables.

I wanted it to work like this:

If I want to display a value, I "split" it up, like this:

VariableToDisplay = 1234 (GlobalVariable that has the full value that should be displayed)

Variable1 = 4 (controls what is displayed on the first digit)

Variable2 = 3 (contorls what is displayed on the second digit)

Variable3 = 2 ...

Variable4 = 1 ...

 

So each variable controls one "digit" of the display. I think I can do something like this without any problems.

But how do I get the tube to display the number?

I already have looked a bit, and there is no script attatched to the nixie-tube-activator.

if I open it up in the preview window, there is a thing called "GamebryoAnim" and under it is a list. If I click on the entrys in that list, the values get displayed in the preview window. So this seems to be what I want.

Now my question is, how can I "trigger" those "animations" from a script that gets attatched to each nixie-tube. And I would have to be able to "tell" it when to update the display.

Edited by YouDoNotKnowMyName
Link to comment
Share on other sites

Something like this ? To get going quickly: create a new activator paste the nixie .NIF archive file path into the model, add a new script and paste this in;

GlobalVariable   Property pMyModName_NixieNumberToDisplay Auto 
ObjectReference  Property pMyModName_NixieTube1 Auto
ObjectReference  Property pMyModName_NixieTube10 Auto
ObjectReference  Property pMyModName_NixieTube100 Auto

Event OnActivate(ObjectReference akActionRef) 

String[] NixieAnimations = New String[0]
NixieAnimations.Add("force0")
NixieAnimations.Add("force1")
NixieAnimations.Add("force2")
NixieAnimations.Add("force3")
NixieAnimations.Add("force4")
NixieAnimations.Add("force5")
NixieAnimations.Add("force6")
NixieAnimations.Add("force7")
NixieAnimations.Add("force8")
NixieAnimations.Add("force9")

fNnmber = pMyModName_NixieNumberToDisplay.GetValue()

Int   iDigit0    = (Math.Floor(fNnmber / 100)) as Int 
Float fRemainder = (fNnmber  - (iDigit0  * 100))
Int   iDigit1    = (Math.Floor(fRemainder / 10)) as Int 
Int   iDigit2    = (fRemainder - (iDigit1  * 10)) as Int

If (iDigit0 < 0)
iDigit0 = 0
EndIf
If (iDigit1 < 0)
iDigit1 = 0
EndIf
If (iDigit2 < 0)
iDigit2 = 0
EndIf

Bool bReturn
bReturn = pMyModName_NixieTube1.PlayAnimation("Reset")
bReturn = pMyModName_NixieTube10.PlayAnimation("Reset")
bReturn = pMyModName_NixieTube100.PlayAnimation("Reset")
bReturn = pMyModName_NixieTube1.PlayAnimation(asAnimation = NixieAnimations[iDigit0])
bReturn = pMyModName_NixieTube10.PlayAnimation(asAnimation = NixieAnimations[iDigit1])
bReturn = pMyModName_NixieTube100.PlayAnimation(asAnimation = NixieAnimations[iDigit2])
EndEvent
When you have dragged the tubes into the world you will need to set the script properties on one of them so it knows about the others. This could also be done with LinkedRefs but this was is easier to explain. Then when you press the tube with the script properties they will all update to show the number in the global which you can set from the console [ set MyModName_NixieNumberToDisplay to 999]
Link to comment
Share on other sites

Wow, ok ... Thanks for the quick answer!

 

What's with that link? It does not lead to YouTube as it says ...

Anyway ...

 

So I should put all of the above in a script and attatch that script to the "first" tube and then fill in the properties, right?

 

EDIT: The link works now!

Yes, exactly! Somehting like that ...

Edited by YouDoNotKnowMyName
Link to comment
Share on other sites

  • Recently Browsing   0 members

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