raymix Posted August 28, 2015 Report Share Posted August 28, 2015 hmm, won't that some times give me a number below the _min value?say for instance, if(random floor _min) returned 1 and (random floor _max)returned 31 + 3 / 2 = 2. ya?That's impossible, the example is used to calculate average value, it can never be less than min and more than max. You simply add the given values together first and then divide by amount of values used.In your own result:(1+3) / 2 = 4 /2 = 22 > 1 (min)2 < 3 (max)If you want pure randomness between min max then: _rnd = random floor 10; //0 - 10 _rnd = (random floor 20) - 10 // -10 - 10 Link to comment Share on other sites More sharing options...
Xzempt Posted August 28, 2015 Author Report Share Posted August 28, 2015 (edited) You're saying that'll never return a value below 5 or above 10? (_min _max)sorry for the quote, can't seem to get rid of it. lolDisregard this, I see what you're saying now. Sometimes I am slow rofl Edited August 28, 2015 by Xzempt Link to comment Share on other sites More sharing options...
Xzempt Posted August 28, 2015 Author Report Share Posted August 28, 2015 I was under the impression it was first radomizing a number between 0 and _min then randomizing a number between 0 and _max, adding them then dividing by 2. thanks for the clarification. Link to comment Share on other sites More sharing options...
raymix Posted August 28, 2015 Report Share Posted August 28, 2015 Just like in math back at school, in programming stuff inside parenthesis is calculated first, otherwise multiplication and division takes priority. Use it to your advantage when you need to calc values before commands are executed (and to avoid syntax errors)2 + 6 / 2 = 5(2 + 6) / 2 = 4 Link to comment Share on other sites More sharing options...
Xzempt Posted September 2, 2015 Author Report Share Posted September 2, 2015 (edited) I'm not sure the correct terminology here, so bear with me a moment. I need this script to execute multiple times. For instance, say I need it to execute every 600 seconds. Can you perhaps point me in the direction i need to go?One more thing, What command am I looking for to give me a message on the right of my screen like some of these other mission scripts do? Edited September 2, 2015 by Xzempt Link to comment Share on other sites More sharing options...
IT07 Posted September 2, 2015 Report Share Posted September 2, 2015 Hi Xzempt,If you want a script that repeats infinitely you can use this:while {true} do { //do something uiSleep 600; }About those messages you mentioned: do you mean those black boxes with text? If so, this:https://community.bistudio.com/wiki/hintUnless you want a hint without a sound, then you will need this:https://community.bistudio.com/wiki/hintSilent Link to comment Share on other sites More sharing options...
Xzempt Posted September 2, 2015 Author Report Share Posted September 2, 2015 Don't the hints show in the middle of the screen? I don't know if you're familiar with blck_eagls AI missions but it gives a message on the right side of the screen saying something about a Bandit Patrol has been spotted in a near by sector. That's the kind of message I'm looking to use Link to comment Share on other sites More sharing options...
raymix Posted September 2, 2015 Report Share Posted September 2, 2015 Why don't you give Hint a try instead of waiting on a forum reply? :) Link to comment Share on other sites More sharing options...
Xzempt Posted September 3, 2015 Author Report Share Posted September 3, 2015 I haven't been waiting on a forum reply. I know I can use structured text in the hint I just don't know if it's possible to move the hint from the middle of the screen... Link to comment Share on other sites More sharing options...
raymix Posted September 3, 2015 Report Share Posted September 3, 2015 (edited) You are thinking of dynamic text, Hint appears on top-right corner of the screen.Or you can always make your own little dialog, resize and place it where you want. This can be done using RscTitles, cutRsc and RscStructuredText.Jump in a single player Editor, press ESC and choose GUI editor, play around with it. F1 shows you all the shortcuts, when saving out using ctrl + s save it as config entry, it will appear in your clipboard.Then simply add your exported dialog to description.ext (inside existing rscTitles if exists):RscTitles { mydialog { idd = -1; duration = 9999; onLoad = "uiNamespace setVariable ['myDialogDisplay',_this select 0]"; controls { myBox: RscStructuredText { idc = 5001; //x y z }; }; }; };ThencreateDialog "myDialog"; _display = uiNamespace getVariable "myDialogDisplay"; _ctrl = _display displayCtrl 5001;Now that you have access to control you made, the rest of magic you can do is here: https://community.bistudio.com/wiki/Category:Command_Group:_GUI_Control Edited September 4, 2015 by raymix syntax spelling TolH 1 Link to comment Share on other sites More sharing options...
Xzempt Posted September 3, 2015 Author Report Share Posted September 3, 2015 Thanks raymix. I appreciate all your input so far. You too IT07. IT07 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now