Tabletop Simulator

Tabletop Simulator

Not enough ratings
Scripting Example - BlackJack
   
Award
Favorite
Favorited
Unfavorite
Number of Players: 1, 2, 3, 4
Assets: Scripting
Tags: 4+
File Size
Posted
Updated
95.933 KB
Feb 10, 2016 @ 10:42am
May 9, 2016 @ 12:49pm
13 Change Notes ( view )

Subscribe to download
Scripting Example - BlackJack

Description
A basic game of BlackJack showcasing how the new mod scripting works.

API and Scripting documentation can be found on the Berserk Games website: http://berserk-games.com/knowledgebase/scripting/

All feedback and suggestions regarding scripting and the API are welcome and should be posted on our official forums. http://www.berserk-games.com/forums/showthread.php?1869-Scripting-Features-amp-Improvements

Topics covered in this example:
Default events: onload, onPlayerChangedColor
Spawning custom models
Deleting objects
Taking items from infinite bags
Changing variables of Lua scripts belonging to other objects
Dealing cards
Scripting Zones
Detecting objects in Scripting Zones
Adding 3D UI buttons to objects
Lua Coroutines
38 Comments
AquaBlast Sep 25, 2022 @ 12:38am 
uh.. nice "demonstration" of scripting but models fail to load and the hit button completely disappears. so it's not even possible to compare the script's normal behavior to the script's code.:steamthumbsdown:
「CM」Yamui Dec 24, 2020 @ 3:33pm 
Where do i put my chips? Sometime it counts, sometimes not. it doesnt have split or double, it doesnt detect blackjacks..

nice start, but needs work
Mikeware Sep 21, 2016 @ 11:13pm 
The example doesn't seem to properly detect chips in the latest version. Did something change?
notFluffypinkbunny Jul 10, 2016 @ 11:29am 
For all the people who found bugs, Congrats, this is a scripting EXAMPLE. I am using it to learn the scripting without breaking a harder game. Once you find a bug, FIX IT. There now you have a new game that you fixed, and can make your own games.
Mr_Lit Jun 30, 2016 @ 4:43am 
is there a way that i can get the cards to be added for my on the table for each player? I thought i saw that somewhere but not entirely sure! Thanks!
Slamakans Feb 19, 2016 @ 8:27am 
Thank you for this.
Raven Feb 18, 2016 @ 12:23pm 
Bug: system will take player's bet as a loss when there is a push/tie. the rule is the bet should be returned to the player when there is a push/tie.
olly! Feb 16, 2016 @ 10:21am 
@ReMixx
I would suggest having a "start game" button instead of starting the game automatically. The button is removed after clicking on it and reloading would not break the current game setup. The other way would be to disable onload script on game load.
Dan  [author] Feb 16, 2016 @ 10:02am 
@olly!
Yes for now. Scripting is still in beta while we work out these things. Thanks for your feedback!
olly! Feb 16, 2016 @ 9:21am 
@ReMixx
Will I have to clean up before each save? That sounds kinda bothersome.