Jump to content

Assigning values to MiscObjects, not visible prices.


Recommended Posts

Thanks. I'm an idiot because all I had to do was change the float properties to int properties to avoid all this,

My next issue is confusing, it should be so straightforward,

When a used fuse is placed it is assigned a random number between 0 and 2. Then assigned a value depending on the random result. But what I am getting is that no matter what the random number is it always triggers the same condition, not the one it is supposed to. I'll link a video in which I will only place blue fuses that have a value of 20. The already installed blue fuse cannot be removed as this gives the player a clue to its value, so the total value should be 60%, 3 x blue fuses + the random value of the used fuse.

https://onedrive.live.com/?auth=1&cid=B60C11D037429D8E&id=B60C11D037429D8E%2152292&parId=B60C11D037429D8E%21191&o=OneUp

 

 

Function WhichUFuse()

debug.notification("Used Fuse Check.")

Int iRand = Utility.RandomInt(0, 2)
RndNum.SetValue(iRand as Int)

If RndNum.GetValue() == 0 && (My_GVfuseColorSlot1.GetValue() == 4)
Slot1Value = 0
debug.notification("Slot 1 Fuse Is A Dud.")
EndIf

If RndNum.GetValue() == 1 && (My_GVfuseColorSlot1.GetValue() == 4)
Slot1Value = 10
debug.notification("Used Fuse Value 10.")
EndIf

If RndNum.GetValue() == 2 && (My_GVfuseColorSlot1.GetValue() == 4)
Slot1Value = 12
debug.notification("Used Fuse Value 12.")
EndIf

debug.notification("Random = " + iRand + " Used Fuse Value = " + Slot1Value)

; next 2 lines are from a different part of the script but added here so you can see the math
FuseValueTotal = Slot1Value + Slot2Value + Slot3Value + PreInstallFuseValue
Debug.Messagebox("Power ="+ FuseValueTotal + "%")

EndFunction

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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