How do i do this?
dan88891
30 Sept 2012, 19:49I would really like to do this:
I want to create a game that has a murder and a suspect in there and a few innocent people. But i would like to mix them up each time.
And i would like to do the same with objects like some objects kill you but it randomizes each time.
Any ideas how i would do that?
I want to create a game that has a murder and a suspect in there and a few innocent people. But i would like to mix them up each time.
And i would like to do the same with objects like some objects kill you but it randomizes each time.
Any ideas how i would do that?

Chase
30 Sept 2012, 20:10You could just add each person/object to a list, then pick one at random.
Sorta like this.
Sorta like this.
wholist = NewObjectList ()
whatlist = NewObjectList ()
list add (wholist, MissScarlet)
list add (wholist, ColonelMustard)
list add (wholist, MrsWhite)
list add (wholist, ReverendGreen)
list add (wholist, MrsPeacock)
list add (wholist, ProfessorPlum)
list add (whatlist, Candlestick)
list add (whatlist, Dagger)
list add (whatlist, LeadPipe)
list add (whatlist, Revolver)
list add (whatlist, Rope)
list add (whatlist, Spanner)
index = GetRandomInt ( 0, ListCount ( wholist ) )
game.whodidit = ObjectListItem(wholist, index)
index = GetRandomInt ( 0, ListCount ( whatlist ) )
game.whatdidit = ObjectListItem(whatlist, index)

Pertex
01 Oct 2012, 06:26Careful!
index = GetRandomInt ( 0, ListCount ( wholist ) -1)
Chase
01 Oct 2012, 06:36Huh, is it really Inclusive?
I am used to (int)rand(4) = 0 to 3.
I am used to (int)rand(4) = 0 to 3.

sgreig
02 Oct 2012, 07:50dan88891 wrote:I would really like to do this:
I want to create a game that has a murder and a suspect in there and a few innocent people. But i would like to mix them up each time.
And i would like to do the same with objects like some objects kill you but it randomizes each time.
Any ideas how i would do that?
That sounds almost identical to my game Sleuth, which is in and of itself a remake of the 1980 game Sleuth by Eric N. Miller ( I remade it with permission.)
You should check it out! http://www.textadventures.co.uk/review/495/