IPB


Welcome Guest ( Log In | Register )

 Forum Rules Forum Rules
 
Reply to this topicStart new topic
> 'Random' command problem!, It won't randomize!!!!
SGJackson
post Aug 6 2010, 20:42
Post #1


Member
***

Group: Members
Posts: 131
Joined: 22-May 10
Member No.: 7,651



Hallo!
I'm trying to use the command "random" but it won't work! it just keeps skipping to the last option without randomizing!

Look at this:

CODE
_start = random 4
? _start < 1 : goto "Start1"
? _start < 2 : goto "Start2"
? _start < 3 : goto "Start3"
? _start < 4 : goto "End"
#start1
hint "the random picked 1!"
#start2
hint "the random picked 2!"
#start3
hint "the random picked 3!"
#End
hint "the random ended the fun!"


Well, it keeps jumping to the 4th option! ("the random ended the fun")

My mission is VERY dynamic (unless that's the idea) and without a random command?!?! ohmy.gif

Thanks to all!
 
Quote Post
D@V£
post Aug 6 2010, 23:52
Post #2


Gee, I wish we had one of them doomsday machines.
Group Icon

Group: Moderators
Posts: 2,037
Joined: 13-November 06
From: Wales
Member No.: 155



Your script should look more like:
CODE
_start = random 4
? _start < 1 : goto "Start1"
? _start < 2 : goto "Start2"
? _start < 3 : goto "Start3"
? _start < 4 : goto "End"
#start1
hint "the random picked 1!"
goto "FileEnd"
#start2
hint "the random picked 2!"
goto "FileEnd"
#start3
hint "the random picked 3!"
goto "FileEnd"
#End
hint "the random ended the fun!"
#FileEnd


After a goto command all lines under the marker will be executed, even if they've got another marker before them. In the case of "Start1", it'd give the first hint, then the second, then the third, then the fourth, faster than the engine would display them, so only the last would appear.


--------------------
The Rules - Nothing too complicated, follow these and we'll have no problems.
Moderation Feedback Thread - Tell everyone how much you hate me love me secretly fear that Mark is watching you while you sleep. secretly wish that Mark is watching you while you sleep.
Site Issues Thread - Complain about site issues here. We might even fix them!
Community Chatter Thread - Furthest Mud-sling gets a free subscription to "JdB Monthly".

QUOTE(Major Mike Shearer)
We can categorically state that we have not released man-eating badgers into the area.
QUOTE(Brace Belden)
A machine gun is like a woman, I don’t understand it, I’m afraid of it, and one day I’ll accidentally be killed by one.
 
Quote Post
SGJackson
post Aug 7 2010, 00:36
Post #3


Member
***

Group: Members
Posts: 131
Joined: 22-May 10
Member No.: 7,651



Ohhhhhhh!

Right when i say it it all came to me smile.gif

Thanks as always Dave!
 
Quote Post

Fast ReplyReply to this topicStart new topic
3 User(s) are reading this topic (3 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 25th April 2024 - 08:19