Jump to content
  • 0

Anyone want to make Roulette script?


Peopleperson49

Question


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

I had a PM request (still perfer people just use the forums for requests as intended) to make a roulette game. Since games are my speciality I'm going to do it anyway. I'm not talking about the rock, paper, scissors roulette. A real roulette game. So I put this challenge out to the other great scripters here such as Annie, Euphy, GMOcean, Emistry, Xantara, or anybody else interested (including KeyWorld). Now its a bit unfair because I do specialize in these type of scripts, but lets see what we can all do with it! Either way I'm going to start working on mine tomorrow, so if you interested please post and let me know.

I in a week if somebody has submitted something along with mine I will post them here and let people vote on it. An actual voting topic would be nice (if somebody else wants to make one), but I have no clue on how to make those. This is intended to be for the players so overall coding isn't as important as realism, detail, game play, dialog formatting. Basically what ever makes it fun and interesting to play. Thanks to goddameit for the link. Roulette Wiki

Peopleperson49

------------------------------------------------------------------------------------------------------------------

Submitted Scripts:

Peopleperson49 roulette script found here under Roulette.rar.

Edited by Peopleperson49
Link to comment
Share on other sites

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

Roulette is a simple game to learn. You have a large wheel which is spun clockwize, and a small ball is thrown into it counter-clockwize. In the wheel are 18 red slots, 18 black slots, and 1 green slot. Where the ball stops determines the winner.

mes "Roulette is one of the easiest casino games to learn. Betting is simple, the game is fast-paced and the environment is rookie-friendly.";
mes " ";
mes "There are 37 colored slots on the roulette wheel. The colors of the slots alternate between red and black with one green slot.";
mes "Red slots contain the numbers 1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, and 36.";
mes "Black slots contain the numbers 2, 4, 6, 8, 10, 11, 13, 15, 17, 20, 22, 24, 26, 28, 29, 31, 33,and 35.";
mes "Green slot contains the number 0.";
mes "Gamblers must lay all bets down before the ball is dropped. Multiple bets can be made on the same slot.";
mes "In each round, the dealer spins the wheel and tosses a small ball the opposite direction on the outer edge.";
mes "After the ball drops in one of the slots, the dealer will call out the winning number.";
mes "When you bet on a single number, this is called a straight up bet. You win if and only if your number comes up on the spin.";
mes "You can bet on all numbers of a single color of red or black. However, all color bets lose if zero comes up on the spin.";
mes "You can bet on all numbers of a even or odd nature. However, all even or odd bets lose if zero comes up on the spin.";
mes "You can bet on all high value numbers (numbers between 19 and 36. However, all high number bets lose if zero comes up on the spin.";
mes "You can bet on all low value numbers (numbers between 1 and 18. However, all low number bets lose if zero comes up on the spin.";
mes "You can bet on all numbers of a single group. Group 1 are numbers between 1 and 12. Group 2 are numbers between 13 and 24. Group 3 numbers are numbers between 25 and 36. However, all color bets lose if zero comes up on the spin.";
mes "You can bet on all numbers of a single column. Column 1 are numbers 1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, and 34. Column 2 are numbers 2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, and 35. Column 3 numbers are numbers 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, and 36. However, all color bets lose if zero comes up on the spin.";

they can bet on number 0 ? and how they win ? /hmm any limitation to choose the number between 0 ~ 37 ?

anyway i think it's better to update the script info in the topic you have created...

i will give it a try if i figure out how to script this..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

Yes they can do a straight bet on 0. You bet on the specific number, group, column, color, high/low, or even/odd. You can make as many seperate best as you wish. Cool. I would suggest you youtube roulette since it will be better for you to see it. I will update that thanks.

Peopleperson49

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  205
  • Reputation:   19
  • Joined:  10/12/12
  • Last Seen:  

Just add all possible bet-combinantion into different arrays, means the "red", "black", "close-to-0", "column 1-2-3", "even", "odd" and so on.

Then, make an array that store every single bet of each player, and a parallel two other arrays which store the name of the player who did that bet and the bet amount.

Then, for every bet, check if the corrispondent array contains the winning number, if so, reward the player.

Delete all arrays in the end, and start back again.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

I have already started working on it for myself. Why not make a script and join the challenge? Next Monday I will post them all here and let people judge which one they like the best. However, if I am the only one with a script I guess I keep it to my self for a while longer. Well except for the guy that originally requested me to make one, lol.

Peopleperson49

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

was wondering....could it be an exploit where player bet on all number to win.... /hmm

since i never played this game in real life...so i dont know the actual gameplay ...

i know how it's look like..but i dunno the gameplay...the rule...or etc...gonna research more ~ >.<

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

Nope. Because they pay out different amounts. For example. There are 36 black/red numbers. A straight bet pays out 35:1. So betting on all numbers would just win you your money back. All black/red numbers bets only pay 1:1 so winning your money back. Group/column bets pay 2:1. It would be a lot of pointless bets.

Peopleperson49

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  205
  • Reputation:   19
  • Joined:  10/12/12
  • Last Seen:  

Posted · Hidden by Arcenciel, December 10, 2012 - No reason given
Hidden by Arcenciel, December 10, 2012 - No reason given

I have already started working on it for myself. Why not make a script and join the challenge? Next Monday I will post them all here and let people judge which one they like the best. However, if I am the only one with a script I guess I keep it to my self for a while longer. Well except for the guy that originally requested me to make one, lol.

Peopleperson49

Seems just like you can't make it by your own, and are waiting us to do it for you. Formal requests would be way better.

Won't accept any challenge anyway. This post shouldn't even stay here in scripting requests imho.

Link to comment

  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

Posted (edited) · Hidden by AnnieRuru, December 7, 2012 - flaming
Hidden by AnnieRuru, December 7, 2012 - flaming

I think what you failed to realize is that the people I included in the challenge are the high level moderators and managers. If Monday comes and I don't have anything to show for then they are going to notice and not be happy about it!!! Even if they don't get involved they are not stupid and will know! Tell you what pm me your email address and you can verify what I have already done. Then you can post again that I am serious. I have nothing to hide, I plan on putting it in my script collect later anyway. I just don't want to give it out until my challenge is over. Look at my script collection, I can script!

Peopleperson49

Edited by Peopleperson49
Link to comment

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  205
  • Reputation:   19
  • Joined:  10/12/12
  • Last Seen:  

Posted (edited) · Hidden by AnnieRuru, December 7, 2012 - flaming
Hidden by AnnieRuru, December 7, 2012 - flaming
I think what you failed to realize is that the people I included in the challenge are the high level moderators and managers.

Script Request Rules. Make it a request if you want to post it here, so the very first one can do it and the others will just check and optimize it.

If you want to ask Moderators or Developers only, PM them or open up a thread in the appropriate section.

This post shouldn't even stay here in scripting requests imho.
Look at my script collection, I can script!

To me still sounds a "I don't want to do it, do it for me!". Also, being able to script doesn't mean make a script work. A collection of useless statements, a bad use of variables and script commands end up into a bad script or useless server runtimes that slow down the process; that's not being able to script. Try to rewrite better and optimize your Releases first, believe me. :)

Edited by Ryokem
Link to comment

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  379
  • Reputation:   304
  • Joined:  11/10/11
  • Last Seen:  

There are some reasons why I don't reply to this topic.

The main reason is because you didn't mention me in your first post ! *joke*

Seriously, I don't know well the rules so I can't really figure out how it works. It doesn't seem like a complex script but more like a boring script (to code) but the main reason is mostly because the result in-game will not be impressive : just a NPC dialog/menu like all casinos NPC.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  161
  • Reputation:   31
  • Joined:  12/06/11
  • Last Seen:  

I assume this wouldn't be too hard, as all you would need to be able to do is a player to create a bet, and get a random number, Colour of the numbers in an array, and something else in roulette (something where you have a 1/3 chance to win, not sure what it was called).

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

Its not really a hard script to make, but making it fun and engaging ingame is the real challenge. It was requested for me to script it to be realistic. If you go to youtube you can watch people play the game. As for Ryokem you have already made the point that your not interested, please don't stray from the topic because you cannot do it yourself. Again when Monday comes if I have nothing to show it won't be you I have to answer to! Contribute or not, its all for fun but don't take away from everybody else. KeyWorld half the fun is taking a boring dialog scirpt and making a cool game out of it. That was the whole challenge...

Peopleperson49

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  205
  • Reputation:   19
  • Joined:  10/12/12
  • Last Seen:  

Posted · Hidden by AnnieRuru, December 7, 2012 - flaming
Hidden by AnnieRuru, December 7, 2012 - flaming
The main reason is because you didn't mention me in your first post ! *joke*

Don't worry, he added you haha! Damn I feel so jealous now! XD

@Peopleperson:

The problem is not if I'm interested or not. Well anyway, get it yourself, can't spare too much time about this.

And back my advice: try to rewrite your released scripts in a proper way instead of starting strange challenges.

Now its a bit unfair because I do specialize in these type of scripts, but lets see what we can all do with it!
This made me laugh.
Link to comment

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

first of all,

there's no such things as a challenge ... lol

a script showdown is just something to learn each other scripter's technique

and so there's no winner, or a best script

a best script is actually differ from each individual ...

for example, sometimes I made a script too overly complicated ... and I failed in explanations how to let user edit my script...

( sometimes .. people don't want my overly complicated solutions and prefer to pick emistry's solution because his script has more readability )

and sometimes, I even asked back the user that I want to add extra features for it ... while it looks cool to me, but the user doesn't want them ... etc

script request section is indeed a place to request for a script

and WE the scripters take that questions as a challenge to our scripting ability

but the special things about script request section is :-

when more than 1 scripters provides a solution -> it also means there's more than 1 solutions to that question,

that is the time when we learn each other individual's techniques

which makes scripting request section a very fun place to browse

however ...

but making it fun and engaging ingame is the real challenge.
An actual voting topic would be nice (if somebody else wants to make one)
I won't allow this

I want to join in this fun, but I want to remind there's no competition to this

I might post up my solutions, emistry might wants to try this too ( he seems to be very interested )

but there's no best script

this topic is a valid one ... but I will not allow voting session ..

just take this topic easy ... everyone are welcome to try ... everyone are welcome to help criticize ...

seems there's 3 person wants to pick this up ... me, emistry and peopleperson49

when we have posted up our solutions, we'll welcome anyone and criticize our script to help us improve our scripting technique

and maybe, after compare out each one of our scripts

we might even combine our scripts into 1 ? <--- this is where the fun starts XD

EDIT: after we all post our scripts, we'll start to rip each other techniques and learn from each others XD

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  205
  • Reputation:   19
  • Joined:  10/12/12
  • Last Seen:  

Posted · Hidden by AnnieRuru, December 7, 2012 - flaming
Hidden by AnnieRuru, December 7, 2012 - flaming

Nooooo Annie, you spoiled out all the fun D: Also, let him believe he is the best, as he said lol.

Link to comment

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

Posted · Hidden by AnnieRuru, December 7, 2012 - flaming
Hidden by AnnieRuru, December 7, 2012 - flaming

lol, the best script is actually differ from each individual

I've already made my own ladder algorithm script,

but if keyworld does it ... he might create another one for his own

I already advised emistry he should create his own ladder algorithm, shuffling algorithm and sorting algorithm... 1 day will find it useful

and this kind of algorithm script ... every person always using different kinds of formula for it

we can only 'agree' using this formula, but no such things as it is the 'best' formula

... except ... when it comes to efficiency and shortest run-time though

I make a reminder again,

currently we got 3 challengers wants to write this script

... and based on my experienced of script request discussion... in the end ... we'll combine our 3 scripts together ... its always like that

so no such things as mine script better than emistry ... like that ... because at the end we've combine our methods together anyways

Link to comment

  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

Posted · Hidden by AnnieRuru, December 7, 2012 - flaming
Hidden by AnnieRuru, December 7, 2012 - flaming

Thanks Annie. I look foward to your script. I never meant this to be a negative thing in anyway! I'm pretty sure that you can script much better than me and so can a lot of other people. If you posted this topic some would think it was just to show off. Me on the other hand I just like to see how the same script can be created in different ways and still make it fun ingame to play. As long as a script dosn't negatively affect the server, the real test of a script is how the people playing like it. That to me is the challenge. Its also good to for new people to be able to take the same work and compare the styles them between people, allowing them to see different styles to learn from.

Peopleperson49

Link to comment

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  205
  • Reputation:   19
  • Joined:  10/12/12
  • Last Seen:  

Posted (edited) · Hidden by AnnieRuru, December 7, 2012 - flaming
Hidden by AnnieRuru, December 7, 2012 - flaming
... and based on my experienced of script request discussion... in the end ... we'll combine our 3 scripts together ... its always like that

so no such things as mine script better than emistry ... like that ... because at the end we've combine our methods together anyways

Mine are always better! haha! <3 you Annie, you know xD

Totally agree with Annie anyway. There is no uch competition, and no need to show individual abilities as well. Teaching and learning is different from the aim of this thread tho.

Thanks Annie. I look foward to your script. I never meant this to be a negative thing in anyway! I'm pretty sure that you can script much better than me and so can a lot of other people. If you posted this topic some would think it was just to show off. Me on the other hand I just like to see how the same script can be created in different ways and still make it fun ingame to play. As long as a script dosn't negatively affect the server, the real test of a script is how the people playing like it. That to me is the challenge. Its also good to for new people to be able to take the same work and compare the styles them between people, allowing them to see different styles to learn from.

Peopleperson49

About this, you should then ask to us how we would script something you've already done, just to let you know some tricks to use to speed up and optimize your scripts, not challenging each others individually.

Edited by Ryokem
Link to comment

  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

I hadn't scripted it before I started this topic. But comparing overall scripts is much different. I really like Annies idea of possibly combinding features. Had I done what you suggested that would have never came about. Anyways this is the last I'm going to post (bicker) about it until Monday. Thanks for you reply.

Peopleperson49

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

erm..actually i am quite interest with the idea ... but might not test it until i have my mathematic test by 2moro...and still dunno able to squeez out some time to try this yet because might have to spend my time to rush another school project ~

and i do agree with Keyworld...if a script too much of dialog...i feel boring too >.<

but the best thing is...watching annie and keyworld...or other member keep posting their script...xD

eventually...i can learn alot from them....that's why i would like this to join ....

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  205
  • Reputation:   19
  • Joined:  10/12/12
  • Last Seen:  

Posted · Hidden by ToastOfDoom, December 7, 2012 - Preempting flaming
Hidden by ToastOfDoom, December 7, 2012 - Preempting flaming

but the best thing is...watching annie and keyworld...or other member keep posting their script...xD

I really doubt Key-kun will post any script made by him but some few optimizations of whoever will post a script on here.

Link to comment

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  161
  • Reputation:   31
  • Joined:  12/06/11
  • Last Seen:  

For the heck of it, I'll join in as well whenever I'm done with my college work.

Changed my user name^

Edited by Jeroen
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  44
  • Reputation:   48
  • Joined:  11/19/11
  • Last Seen:  

Don't think i'll get around to actually writing the script but here is the model i'll use for calculating if a player had won.

Don't read if you still want to think about it and figure out your own method.

I'm someone that optimises scripts to do as little as possible during 'runtime' (when a player or event triggers the script, etc) at the expense of a longer initialisation and bigger memory footprint. To me one NPC with lots of variables is cheaper than having to do alot of math every time someone clicks the NPC. So my most ideal endpoint would be to calculate how if you won and how much you won in a single line of code (which is what this model lets you do).

Looking at the rules you can see that there are 11 different types of bets. Every single type of bet has a certain amount of combinations that be can be placed.

0: Straight up: 37 bets
1: Split: 57 bets
2: Street: 12 bets
3: Corner: 22 bets
4: Trio: 2 bets
5: Line (double street): 11 bets
6: Column: 3 bets
7: Dozen: 3 bets
8: Low/High: 2 bets
9: Red/Black: 2 bets
10: Odd/Even: 2 bets

Total: 153 (I may be wrong..still fuzzy on rules of 0 and 0 combinational bets)

This means every single bet can be represented using a single integer. However then you need to build extra lookup arrays to figure out what bet matches to what index and in reverse so for my model i'm gonna use two (one for 'bet type' and the other for 'bet index')

In the game of roulette every roll on the wheel has a fixed set of winners therefore you can build a lookup array/table of the roll number to match with the bets that won.

Once the arrays are built (within OnInit) you can figure out if a certain player has won using this.

<payout> = Payouts_<roll_num>_<bet_type>[<bet_index>];

<payout> is the multipler you apply to the bet. If the payout is 0 then they lost.

No need to clear and rebuild the table since it's never gonna change.

As for building this so called table. 37 rolls X 153 bets = 5661 entries. Writing this out by hand probably isn't a good idea (you will probably make a mistake). I would just write something in C# or something to just simulate the board and generate the table entries for me but i'm sure there's other ways to do it.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

Posted · Hidden by ToastOfDoom, December 7, 2012 - Preempting flaming
Hidden by ToastOfDoom, December 7, 2012 - Preempting flaming

but the best thing is...watching annie and keyworld...or other member keep posting their script...xD

I really doubt Key-kun will post any script made by him but some few optimizations of whoever will post a script on here.

Somehow I missed this post before, but why do you have to be a dick? I more than expect me and KeyWorld both to get shown up by Annie and the others, but atleast the both of us are willing to try and have fun doing it! All your doing is bashing, but won't back anything you say. Even if the worst script is brought to the table, it will still be better than your nothing. Also other people read these messages and if they see people that they look up to for help (which includes you) bashing on each other then they might get a negative taste in their mouth for when they get more advanced and could have helped others themselves.

Peopleperson49

Link to comment

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  44
  • Reputation:   48
  • Joined:  11/19/11
  • Last Seen:  

Posted · Hidden by AnnieRuru, December 8, 2012 - moderated
Hidden by AnnieRuru, December 8, 2012 - moderated

I'm gonna preemptive this and tell everyone to take a chill pill. You know who you are. This is not a competition.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...