PDA

View Full Version : [ADDED] Grouping items / putObject



Huffel
01-15-2017, 06:46 AM
I think scripting access to the existing Group function (G) key would be very appreciated. Currently you can only get cards in a deck with scripting by dropping them on top.
Suggestion for a combined function for decks and bags: Container.putObject(Object to put into the container, [index]) + maybe a putObjectSmooth variant to give us the option to teleport something into a container or make it fly there.

Additional benefits would be:

No trouble with collisions (like the group function)
If you can specifiy the position of the card in the target deck it would allow players to put cards underneath decks without them getting destroyed (currently placing a card at the bottom of a deck: place card and drop deck on top of it -> deck gets a new guid and the deck name is lost)

Tanners
02-18-2017, 04:37 AM
Wanted to bump this thread, because while the putObject() function is great, we're still lacking a group() function.

group() can be implemented using putObject() for most scenarios, but if the entire set is of single entities (i.e a set of single cards) it is impossible to group them all and also return a reference to the newly created Object reliably.

Possible solutions are either a full implementation of group() as occurs when pressing "G" in game, or change the return value of putObject() to the object which is being stacked into.

dzikakulka
02-20-2017, 09:17 AM
@Tanners
While it is duct take and could use proper methods (like a lot of things atm), I worked around that having some "dud" two-card stack hidden away and kept reference to. When I need to work on decks, I clone it, scale it to the size of cards I'll be working on and putObject stuff into it.

It also made actual scripts on decks waaaay easier (sometimes possible at all) with two dud cards so when I deal cards, deck is not destroyed when card-before-last is drawn. I can work on it and deploy every single useful card then destroy the two-dud-cards deck.

Tanners
02-20-2017, 09:39 AM
@Tanners
While it is duct take and could use proper methods (like a lot of things atm), I worked around that having some "dud" two-card stack hidden away and kept reference to. When I need to work on decks, I clone it, scale it to the size of cards I'll be working on and putObject stuff into it.

It also made actual scripts on decks waaaay easier (sometimes possible at all) with two dud cards so when I deal cards, deck is not destroyed when card-before-last is drawn. I can work on it and deploy every single useful card then destroy the two-dud-cards deck.

This is a really interesting idea. I'll have to try that.