PDA

View Full Version : Object.clone needs a callback



Banbury
08-02-2017, 02:20 PM
Object.clone needs a callback just like spawnObject. Otherwise it's mostly useless.

Or coroutines need parameters.

MrStump
08-02-2017, 02:50 PM
Just an fyi, you can work around coroutines not having parameters.

function funcName(parameter)
function funcName_routine()
print(parameter)
coroutine.yield(0)
return 1
end
startLuaCoroutine(Global, "funcName_routine")
end

Clone having a calllback would be useful. As would being able to disable the "object spawning" noise as a variable (like what spawnObject could benefit from). I agree it is something that, at some point, could be improved.

Banbury
08-02-2017, 03:15 PM
That works? I'll try that tomorrow.

One of the things, that I find off-putting with scripting in Tabletop Simulator, is, that nothing works as I would expect it to work.

Thanks, anyways.

maximo1984@ymail.com
08-04-2017, 08:24 AM
Flirting with trying to duplicate a card deck taken out of a bag so that if cards are accidently deleted from this deck (as always happens in TTS), the deck will retain its integrity. I'll have to agree with Banbury, nothing ever expects to work as you think it would.

Question: Most online Lua tutorials have nothing to do with TTS. Where do you guys figure all this stuff out?

Banbury
08-04-2017, 08:38 AM
Three days of experimenting and then asking stupid questions on the forum. That's how I do it.

Seriously, I'm a software developer with some experience and TTS still leaves me stumped with simple stuff like that.

MrStump
08-04-2017, 01:31 PM
@maximo, I've made a short series of guides specifically geared towards reaching Lua basics specifically for TTS, with the things I think people will need to use the most. Links to the 2 guides (and the final Functions guide with a collection of useful functions) can be found linked here (http://www.berserk-games.com/forums/showthread.php?1990-Scripting-Examples).

@Banbury, there is definitely a learning curve. Certain things require an understanding of how certain things happen (like how decks form, when they do, why they don't sometimes, etc). The forums are always willing to help of course =)

Banbury
08-04-2017, 01:48 PM
@Banbury, there is definitely a learning curve. Certain things require an understanding of how certain things happen (like how decks form, when they do, why they don't sometimes, etc). The forums are always willing to help of course =)
It's more of an unlearning curve. :) I constantly have to work around TTS' limitations. Full featured LUA is a powerful language. But TTS strips away the best parts.

But thanks for the help.

Flolania
08-05-2017, 12:14 AM
Probably a good idea. You wouldn't want to join a server to play a game and find your hard drive wiped.

Banbury
08-05-2017, 03:16 AM
Probably a good idea. You wouldn't want to join a server to play a game and find your hard drive wiped.

I'm not talking about missing libraries. It's basic stuff like the badly implemented coroutines, that irritate me. Or that every object has its own instance of LUA and can't interact with other objects normally. Or that I can't modularize my code and therefore can't reuse code between objects.

dzikakulka
08-05-2017, 08:13 AM
We could really use dofile/loadfile (even if it could only access other scripts present in TTS, not the whole filesystem) and some simple web requests (e.g. POST). Debug library maybe? I think we're constrained a little too much for what safety requires at the moment.

Banbury
08-05-2017, 08:28 AM
We could really use dofile/loadfile (even if it could only access other scripts present in TTS, not the whole filesystem) and some simple web requests (e.g. POST). Debug library maybe? I think we're constrained a little too much for what safety requires at the moment.
My thoughts, too. I have already tried to talk with Berzerk Games about it, but they keep ignoring it.

MrStump
08-05-2017, 09:09 AM
Just because a suggestion has not been filled does not mean it was ignored. There are 2 devs who put out updates every couple of weeks and in that time, 3-5+ suggestions for major feature changes are made on this forum alone. They can't all get filled, but that never means its time won't come in the future.

The best you can do is to state a clear usage case for WHY you want a feature, how it would improve TTS, etc. The original post to this thread was a good example, showing a clear usage and solutions that would fix it. =)