Results 1 to 3 of 3

Thread: Help with scripting problem.. WAIT FUNCTION.

  1. #1

    Help with scripting problem.. WAIT FUNCTION.

    Hi there... I have a issue that needs some kind of fix... but I am not sure how and was wondering if you guys might have an idea.

    In my Beta Lord of the Rings LCG mod -

    I use trash bags to send cards to the correct discard pile automatically. This is all working.. but as the card pool is used by players to make their decks, I needed a way to determine what cards are from what player. This is done by a "setup" script that looks at every card in a zone (where they place the deck before pressing setup) and renaming it carName_PlayerNum... now the trash bags can search of "PlayerNum" and send the cards to the correct place.

    It dose this by dealing every card in the deck "up" into the air.. once it is a "card" I can rename it and then it falls to the ground.

    The problem is that after this dose this I use a wait(x) function to then deal out the cards for the opening hand, and some other player setup stuff. While this works fine, I have had reports that people with older and slower computers are getting errors as the wait function is not waiting long enough before triggering the rest of the script. Basically what is happening is that the script it trying to deal cards, before the deck is fully formed.. so erroring..

    TL;DR - Any ideas on a better way I can rename cards inside a deck? Or... Dose anyone know a way to use wait timers, that will work on all systems.. maybe using some kind of "while==ture" thing.. so it only moves along once it is finished?

    Also, there seems to be an issue..if I press the buttons to fast then they error.. likee maybe you can not have two wait timers running at the same time? Anyone know what that is about?
    My Boardgame uTube chan - Tragic's Table Top
    BGG Guild of BoardGame uTubers - Tube Tables

  2. #2
    Join Date
    Jan 2014
    Next patch will have a built in Wait class that should make this really easy.

  3. #3
    awesome! I use wait functions in like nearly all my mods!

    I did work out aq kinda work around for this.. no idea if it is any good.. but it seems to work cording to some users who first told me of the problem...

    Basically I have just added a "tall" zone... this zone stops before the deck and gose up in the air.. decks in this game can be any size but a minimum of 50 cards.. I have set up the zone so it is just above a 100 card deck.. I doubt anyone will ever make a deck that big. People usually use 50 card decks.

    Anyway, the code is super simply.. it simply tests the #zone.getObjects() count so... while it has more than 0, it waits... meaning that no matter how slow the computer is it will now only do the 2nd part of the set up once all the cards have fallen out of the "tall" zone.. and into a deck...

    while #getObjectFromGUID(deckcolume).getObjects() ~= 0 do
    My Boardgame uTube chan - Tragic's Table Top
    BGG Guild of BoardGame uTubers - Tube Tables

Similar Threads

  1. more "wait function confusion" (OneLivesLeft?)
    By Tragic in forum Scripting
    Replies: 1
    Last Post: 02-17-2018, 02:44 PM
  2. Question about OneLivesLeft's Wait Code....
    By Tragic in forum Scripting
    Replies: 2
    Last Post: 01-05-2018, 08:24 PM
  3. No longer need to wait after spawning an object?
    By Kalazor in forum Scripting
    Replies: 2
    Last Post: 08-16-2016, 02:47 PM
  4. Wait X Frames until deck completes? :D
    By se7en in forum Scripting
    Replies: 5
    Last Post: 04-25-2016, 04:13 PM
  5. Can't wait to play!
    By darkknifer in forum General Discussion
    Replies: 1
    Last Post: 02-12-2014, 11:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts