argghhh now that's exactly the sort of thing that makes perfect sense only AFTER you find it out (like most of the code stuff lol) many thanks--
ok here's the entire code
with a test to check if it's working which sadly it isn't
- Code: Select all
randomize
Dice = int(rnd*(1-11+1))+1
If Dice = 1 Then
Lord_Farley = 1
ElseIf Dice = 2 Then
Lady_Farley = 1
ElseIf Dice = 3 Then
Bishop_Tracepe = 1
ElseIf Dice = 4 Then
Archie_Borld = 1
ElseIf Dice = 5 Then
George_Cant = 1
ElseIf Dice = 6 Then
Margarie_Sene = 1
ElseIf Dice = 7 Then
Cisile_Frankes = 1
ElseIf Dice = 8 Then
Billingsgate = 1
ElseIf Dice = 9 Then
Sir_Margrete_Hill = 1
ElseIf Dice = 10 Then
Advocate_senior = 1
Else
Mary_Cant = 1
End If
If Lord_Farley = 1 Then
Message "Lord Farley."
ElseIf Lady_Farley = 1 Then
Message "Lady Farley."
ElseIf Bishop_Tracepe = 1 Then
Message "Bishop Trancepe."
ElseIf Archie_Borld = 1 Then
Message "Archie Borld."
ElseIf George_Cant = 1 Then
Message "George Cant."
ElseIf Margarie_Sene = 1 Then
Message "Margarie Sene."
ElseIf Cisile_Frankes = 1 Then
Message "Cisile Frankes."
ElseIf Billingsgate = 1 Then
Message "Billingsgate."
ElseIf Sir_Margrete_Hill Then
Message "Sir Margrete Hill."
ElseIf Advocate_senior = 1 Then
Message "Advocate Senior."
Else
Message "Mary Cant."
End If
the Mary Cant message is the only one displayed on screen 100% of the time (after many many tests --randomisation aint what it used to be)
surely the info has had time to be passed to the variables or do i need to create a timed event to hold the message giving the code time to run/ is so how would i cram all that into a timed event code
nope dun work i removed the message section from the code and added it to a hot spot---giving the code time to have run (???) Mary Cant is the only message ever displayed (the default ELSE option in the code in effect)
so the code isn't working no randomisation is taking place at all--
the variables are in GLOBAL --
and so it goes ever on....
i've tried the Dice variable as a variant and an integrer to be sure and wrritten the code like this to make sure all the variables are set to 0 before the code runs
- Code: Select all
Lord_Farley = 0
Lady_Farley = 0
Bishop_Tracepe = 0
Archie_Borld = 0
George_Cant = 0
Margarie_Sene = 0
Cisile_Frankes = 0
Billingsgate = 0
Sir_Margrete_Hill = 0
Advocate_senior = 0
Mary_Cant = 0
randomize
Dice = int(rnd*(1-11+1))+1
If Dice = 1 Then
Lord_Farley = 1
ElseIf Dice = 2 Then
Lady_Farley = 1
ElseIf Dice = 3 Then
Bishop_Tracepe = 1
ElseIf Dice = 4 Then
Archie_Borld = 1
ElseIf Dice = 5 Then
George_Cant = 1
ElseIf Dice = 6 Then
Margarie_Sene = 1
ElseIf Dice = 7 Then
Cisile_Frankes = 1
ElseIf Dice = 8 Then
Billingsgate = 1
ElseIf Dice = 9 Then
Sir_Margrete_Hill = 1
ElseIf Dice = 10 Then
Advocate_senior = 1
Else
Mary_Cant = 1
End If
no randomisation occurs or it is not being passed to the globals or it is not being passed to the message display section (on a hot spot)
- Code: Select all
If Lord_Farley = 1 Then
Message "Lord Farley."
ElseIf Lady_Farley = 1 Then
Message "Lady Farley."
ElseIf Bishop_Tracepe = 1 Then
Message "Bishop Trancepe."
ElseIf Archie_Borld = 1 Then
Message "Archie Borld."
ElseIf George_Cant = 1 Then
Message "George Cant."
ElseIf Margarie_Sene = 1 Then
Message "Margarie Sene."
ElseIf Cisile_Frankes = 1 Then
Message "Cisile Frankes."
ElseIf Billingsgate = 1 Then
Message "Billingsgate."
ElseIf Sir_Margrete_Hill Then
Message "Sir Margrete Hill."
ElseIf Advocate_senior = 1 Then
Message "Advocate Senior."
Else
Message "Mary Cant."
End If
i'm not trying to be a clever dick here (i'm trying to write a game) but this is exactly the sort of thing that makes the learning curve so unnecesarily difficult---it will inevitably be something extremely basic and simple (the above code is extremely basic and simple)
but as has been my experience over and over again with all codeing formats getting hold of this simple information is difficult--put it in the help where it belongs --experienced coders know this simple stuff--what goes where --correct format for naming variables-- learners like me shouldn't need to beg for this information nor sit there trail and erroring untill you lose all enjoyment and enthusiasm completely--
why doesn't the above code work?-- it ought to work --it's dead simple--
so's the answer --it's just i can't find the answer anywhere--
and it's exactly the sort of stuff a newbie (like myself) would be trying to use-- simple randomisations-- nothing fancy just a small step up from the non scripted default actions-- and with code work it's that first step up that's the most challenging--
this place needs a VB code forum desperately--if there was a VB forum here i no doubt would have stumbled across the answer contained in the code snippets posted by other folks and or answers given to other newbies asking similar questions--