Random number in Quest 5

peter edwards
03 Jan 2013, 00:54
I would like to run a script at random times during a game. Can this be done?
Also, is there a way to move an object to the player's location, but not into his inventory?
Any advice would be welcome.

guzmere
03 Jan 2013, 07:01
Not sure about the random number, but to move an object to the players location you can use
Move [object] [ object] to [expression] [player.parent] this will move the object to the players location. Just replace word object with your own object, the second object I mean. Have fun. Terry :D :D :D :D

Pertex
03 Jan 2013, 09:11
peter edwards wrote:I would like to run a script at random times during a game. Can this be done?
Also, is there a way to move an object to the player's location, but not into his inventory?
Any advice would be welcome.


You can add a turnscript. This script is called after every input and you can call the random function there to check if the script should be executed or not.

peter edwards
03 Jan 2013, 11:30
Many thanks, Terry. Works perfectly! By the way, did you manage to fit the jewel into the socket?

Thanks also to you, Pertex, for your reply. Forgive my ignorance - I'm new to Quest - but I can't seem to find the random function. Am I missing something right in front of my eyes?!

guzmere
03 Jan 2013, 11:36
Crikey I forgot all about it! Nearly finished Dark Mirrors so will get back to it. Yes I did fit the jewel thanks. Terry :D :D :D :D

Pertex
03 Jan 2013, 12:27
no problem. Choose "set a variable or attribute" in the script adder in the gui. Then you can choose random number in the combobox

set variable [testvar] = [random number] between ....

peter edwards
03 Jan 2013, 15:00
Many thanks, Pertex. All well now!