Hello everyone,
I use 2.72 Ags.
In my game I have 10 executable files (1.exe, 2.exe, 3.exe, etc.)
From file a.exe I wish to make a random one the 10 executable files,
then
RunAGSGame ( Random.......... , 0, 51);
but I do not know how to activate the function Random.
thanks for your help
You could do something like this (untested):
RunAGSGame (String.Format("%d.exe",Random(9)+1),0,51);
Thanks Gilbet V7000a, it works!
Just to clarify what Gilbot did there, he took advantage of AGS's "String formatting (http://www.adventuregamestudio.co.uk/manual/StringFormats.htm)" functions. Searching the forums, BFAQ, manual, etc. for something along the lines of "insert variable into string" should definitely yield multiple results. Although not specifically centered around RunAGSGame or Random this is one of the most commonly asked questions in the forums.
It's always good to get an answer, but just for your own info (and for those reading it as well), it's even better to find the answer yourself! ;) I'm not trying to play moderator or anything (albeit exactly what I'm doing...8)) just trying to give you the heads up that you should definitely check your available resources. The forum search as well as a link to the AGS Wiki are included at the top of the forums. In the Wiki you will find the BFAQ and a searchable version of the AGS manual online (of course the CHM help file in your AGS folder can always be searched locally). The manual in the wiki is partially updated as of AGS 3.0, so some of the newer functionality isn't there yet, but always good for a look.