Random

Shadowalker
20 Dec 2004, 07:55
Wow, sorry I've been posting so many questions lately. I just looked back and saw lots of posts are my questions! :oops: Anyway, I know you guys really like them, so I decided to be nice and post another one. lol Basically, I was downloading some more games yesterday, (Which, by the way, someone please come out with a good one, and soon; they all suck!) and I got one called Casino. It was horrible, but I opened up the code and and saw that the author had a "Random" procedure goin on. I didn't know you could do random things! (Such as have the game choose a character to start off with, etc.) So I tried to experiment, but I couldn't get it to work. How do I do it? (In QDK, please.) I tried to do what they did; Which was

"Set Numeric variable Random---(To) $rand$(1;13)

or something like that. Then I assigned a character to 1, to 2, and so on. Then I did by the STARTUP SCRIPT that if the variable "Random" is equal to "1", then make /whatever object i made blahblahblah/ available. If 2,...and so on. It didn't work. What did I do wrong?

Also, are there any other codes like the random one that anyone can tell me? (ones that I won't find out on my own.) For example, when I first started QDK, I didn't even know I could type #object#, or #text#, referring to whatever is applicable there. I only learned that from opening up peoples games. Anyway, if anyone has any helpful tips, it'd be much appreciated. Thanks a ton---

P.S. Since I stumbled onto this QDK stuff by mistake not too long ago, I've learned to love it. It's awesome, and I LOVE programming games. (Would enjoy playing it too if there were any decent games) Anyway, I'm just wondering who the core audience is, (Though I've noticed a lot of programmers on here) and how many people are followers.

Anonymous
20 Dec 2004, 09:26
Hi ebayfan

The correct syntax for generating a random number is:

$rand(a;b)$


Where a is the lower boundary and b is the upper. Therfore $rand(4;16)$ will generate a random number between 4 and 16= easy-peasy!

There are plenty of useful functions in Quest (plenty of handy string manipulation ones in particular) and plenty of useful system string variables you can read / test.

Open the Quest documentation and you'll see all you need to know :-)

Al (MaDbRiT)

steve the gaming guy
20 Dec 2004, 15:02
ebayfan414 wrote:I was downloading some more games yesterday, (Which, by the way, someone please come out with a good one, and soon; they all suck!)


It's good to see that you've played ALL the games in the archive and were able to judge that they ALL suck. I agree, most of them do suck because some people don't take the time to make certain options/commands available and there are those who don't check their spelling and grammar, etc...
So what happened to your sex game?

steve the gaming guy
20 Dec 2004, 16:04
Anonymous wrote:
There are plenty of useful functions in Quest (plenty of handy string manipulation ones in particular) and plenty of useful system string variables you can read / test.

Open the Quest documentation and you'll see all you need to know :-)

Al (MaDbRiT)


After searching in the Help documentation, I found only one instance of the word "random" which basically says what you said about the random function returning a random number between the lowest and highest number.
What if you wanted to have the returned number appear in a variable? I created a test where I pulled the lever on a slot machine and it gave me $rand(10,100)$ dollars. I wanted the returned number to appear in a variable but because I set up the variable with the same random function, it puts a random number in the description after I pull a lever and then I get a different random number in the variable itself.
"You won 51 dollars" and the variable shows "Total Dollars: 88"
I know why it doesn't work. I just don't know how to fix it.

Anonymous
20 Dec 2004, 19:59
Steve

You need to do something like this:

set numeric <spin;$rand(10;100)$>

msg <Congratulations, you won %spin% dollars.>
set <totalcash;%totalcash% + %spin%>

i.e. call the random function only once, assign the result to a numeric variable and then work with that numeric variable :-)

Al (MaDbRiT)

Anonymous
21 Dec 2004, 05:43
Cool, yes that works!

steve the gaming guy 8)

Shadowalker
21 Dec 2004, 21:57

It's good to see that you've played ALL the games in the archive and were able to judge that they ALL suck.


lol yup, they all do. Actually, I played a lot of them. But I guess maybe there might be a good one hiding out there somewhere.

So what happened to your sex game?


Actually, I'm still workin' on it. It's not nearly done yet, though. However, I stopped making it this week, because I wanted to experiment with the random function, so I'm creating a short "random" game. You wanna here the funny thing about it? (Well here it is even if you don't lol)

I created a test where I pulled the lever on a slot machine


I can't believe someone wrote that! Because the game I'm creating is not a typical game; It's just playing a slot machine and a cup-and-pea game, and maybe i'll add in a few more. So after I finish that, (which should be about 2 or 3 days) i'll resume the sex game. Also, I wanted to know, is it "allowed" to put pictures in the game? (as in REAL pics-sex ones) Cause originally I was going to, but now i'm not sure. I don't want some kid getting it and...using it. Though if they really want it they can get it anywhere else on the net. But my stronger reason is that after all, this IS a TEXT game, so maybe I should leave it all up to your imagination! Opinions, anybody?

paul_one
22 Dec 2004, 10:07
You can put pictures in - although I think you should put the one's with pictures in a password-protected .zip or .rar and then give out the password to people who ask for it - so you have some control over the pictures (anyone who is smart enough to get a .zip password cracker and use it probably can find the pics elsewhere).

I like the game Luridii-something-or-other... Part 1.
Shame the author didn't stick around and make parts 2 and 3... I liked part 1 although it was short, and wasn't the easiest to use.

steve the gaming guy
22 Dec 2004, 18:02
ebayfan414 wrote:

I created a test where I pulled the lever on a slot machine


I can't believe someone wrote that! Because the game I'm creating is not a typical game; It's just playing a slot machine and a cup-and-pea game, and maybe i'll add in a few more. So after I finish that, (which should be about 2 or 3 days)


Yeah, I was pretty excited about the random thing working. I had seen someone make a text game MANY years ago on an Apple computer and they used a random sequence as if you were using a ten-sided die on a roleplaying game to attack. It was pretty interesting. You can do the same thing with the $rand$ function.
As far as the slot machine, that was the first random thing that popped in my head. Pretty cool stuff...

I was being sarcastic about the sex game. Since you said that all the games sucked, I was just suggesting that a sex game isn't a good way to break into the community since the only sex game made so far was a real stinker (for the most part)

Overall, I repeat, the reason why games are bad is because not enough time was put into them. My first game took me a good amount of time but because it was my first game, there were still programming errors in it. The game is still playable but there were errors.
I am working on about 4 games at the same time right now. The biggest one (and closest to completion) has taken me several months so far. I have asked many questions in this archive for help on it. You may have seen the desert question a month or so ago.
Anyway, from now on, I'm making extra sure that my games are good and playable with as little errors as possible before uploading here (as all game authors should anyway). (I realized that I use parentheses a lot!) :)

Shadowalker
26 Dec 2004, 08:12

I was being sarcastic about the sex game. Since you said that all the games sucked, I was just suggesting that a sex game isn't a good way to break into the community since the only sex game made so far was a real stinker (for the most part)


Oh, I see. Well, I understand where you're coming from, but I disagree. I don't think a game is "good" or "bad" based upon it's genre', but upon it's actual contents/game matter + quality. Anyway, you are right about that game; It sucked. I assume you're talking about "enter" or something like that? But I am still creating my sex game. I want to point out though that it's not strictly a sex game; That is to say, to all the people who aren't interesting in playing a game where all you do is type fu** her and her and..., my game is not like that. It's an actual plot, with a storyline. Think of it as a regular game with a sexual theme/motif'. It's not nearly done, as I've said, but I'm working on it.

Actually, I've put it on pause again because I'm making a map for the game. You might wonder why making a map would take so long, but it's because I've thought of a cool way to make one. (Or at least I think so.) Opinions would be appreciated. What I'm doing is I have the game "The Sims," and I recreated the house from my game into the Sims world. I'm designing the whole house to make it look real...I'm adding furniture, decorating with wallpaper, tiles, themes, etc. Then I'm going to save pictures of rooms as .jpg, or whatever, and I haven't decided the exact method, but it's going to be something like this; Either you will have a map, and when you look/examine it, you will get a pic of the room you are in, or a menu, choosing the room you want to see. Or, I might have a dummy object in each room titled SEE ROOM or something like that, and looking/examining that will give you a pic of the room.

Originally, I started to design the house in a program called 3-d home architect, but it was too time consuming. I got the idea to do this "visual map" thing when I was playing one quest game or another, and the room descriptions were (as they normally are) horrible. I thought that even though this is, I know, a TEXT game, it still might be fun to SEE it sometimes. Anyway, it also makes it more fun for me, as game author, to create.

As for the "slot machine" game I was talking about earlier, I finished it, but I'm not going to release it, because it only contains a slot machine game, a cup and pea game, and a few characters. I don't think anyone here would find it entertaining to just "examine" the slot machine, win or lose some money, and get a message, "Play again? Yes/No? " and do that over and over again. So unless I add more games, (which, later, I might) it won't be released.

The idea to add the "sex" pics to a password-protected zipped folder was a good one. However, I'm in the process of deciding if I should remove the pics from the game alltogether.

Alex
26 Dec 2004, 16:13
Just to point out, if there are pictures in it then it's certainly going nowhere near the Quest Games Archive...

007bond
26 Dec 2004, 23:13
You could try making a map in a program called "The Room Arranger". If you want I can send you the installation file. It's quite good and has a range of objects along with the ability to create the zaniest rooms.

Shadowalker
27 Dec 2004, 08:18
Well, I really don't need another 'room creator' program. The ones I have are fine, and I enjoy using them. However, I always like trying out new software, so sure, why not? Send it along! Although I almost surely won't be using it for the game I'm making; I'm already almost done using the "Sims" as the "House maker."

007bond
27 Dec 2004, 10:43
OK, i'll PM you about it. Check your inbox.

EagleWing
27 Dec 2004, 14:06
007bond wrote:You could try making a map in a program called "The Room Arranger". If you want I can send you the installation file. It's quite good and has a range of objects along with the ability to create the zaniest rooms.


I wouldn't mind having a look at something like that, 007. Any chance of you sending me a copy, please.

Frank

Elexxorine
29 Dec 2004, 17:27
dito :D

007bond
30 Dec 2004, 07:19
ok. PM me your emails and i'll send it along. oh, and ebayfan, sorry I haven't sent it yet, my internet screwed up and stopped working just as i was attaching the file. i'll send it once the other two pm me their emails.

Shadowalker
31 Dec 2004, 00:56
Sure, no prob. Thanks.