Kurosama24 Posted February 11, 2014 Share Posted February 11, 2014 Hi,while trying to mod Morrowind and adding mining, I ended up on a problem:I tryed to use the "Random, 100" function to use different parts.The Problem is, that the only result of the function will be 0. It worked for a while, until I added a few variables.The script:Begin PF_Minewall_straightshort xPosiStaticshort yPosiStaticshort zPosiStaticshort xPosishort yPosishort zPosishort PF_rndshort doneIf ( done == 0 ) Set xPosiStatic to GetPos X Set yPosiStatic to GetPos Y Set zPosiStatic to GetPos Z Set xPosi to GetPos X Set yPosi to GetPos Y Set zPosi to GetPos Z Set done to 1EndifIf ( OnActivate == 1 ) If ( done == 1 ) Set done to 2 EndifEndifIf ( done == 2 ) Set PF_rnd to Random, 100 Set yPosi to yPosiStatic - 64 If ( PF_rnd >= 0 ) If ( PF_rnd < 20 ) PlaceItem "in_moldcave2_s_00", xPosi, yPosi, zPosi, 0 Set done to 3 Endif Elseif ( PF_rnd >= 20 ) If ( PF_rnd < 40 ) PlaceItem "in_moldcave2_s_01", xPosi, yPosi, zPosi, 0 Set done to 3 Endif Elseif ( PF_rnd >= 40 ) If ( PF_rnd < 60 ) PlaceItem "in_moldcave2_s_02", xPosi, yPosi, zPosi, 0 Set done to 3 Endif Elseif ( PF_rnd >= 60 ) If ( PF_rnd < 80 ) PlaceItem "in_moldcave2_s_03", xPosi, yPosi, zPosi, 0 Set done to 3 Endif Elseif ( PF_rnd >= 80 ) If ( PF_rnd < 95 ) PlaceItem "in_moldcave2_s_04", xPosi, yPosi, zPosi, 0 Set done to 4 Endif Elseif ( PF_rnd >= 95 ) If ( PF_rnd < 100 ) PlaceItem "in_moldcave4_s_00", xPosi, yPosi, zPosi, 0 Set done to 5 Endif EndifEndifIf ( done == 3 ) Set yPosi to yPosiStatic + 256 PlaceItem "PF_in_moldcave2_s_end", xPosi, yPosi, zPosi, 0 Set done to 6 DisableEndifIf ( done == 4 ) Set yPosi to yPosiStatic + 256 Set zPosi to zPosiStatic - 128 PlaceItem "PF_in_moldcave2_s_end", xPosi, yPosi, zPosi, 0 Set done to 6 DisableEndifIf ( done == 5 ) Set yPosi to yPosiStatic + 1024 PlaceItem "PF_in_moldcave2_s_end", xPosi, yPosi, zPosi, 0 Set done to 6 DisableEndifEndI don't know, what to do, can anybody help me?Thank'sKuro Link to comment Share on other sites More sharing options...
Recommended Posts