Page 3 of 4 FirstFirst 1234 LastLast
Results 51 to 75 of 98

Thread: We haven't forgotten about scripting! What do you guys want to see?

  1. #51
    Quote Originally Posted by SmileyChris View Post
    I'd like a Player.team read/write property.
    This has a +1 from me. Please add this or a setTeam() function. "Hearts", "Spades", "Clubs", "Diamonds".
    Last edited by Mark; 08-03-2016 at 08:15 PM.

  2. #52
    Quote Originally Posted by Mark View Post
    This has a +1 from me. Please add this or a setTeam() function. "Hearts", "Spades", "Clubs", "Diamonds".
    Code:
    Player[ 'Red' ].changeTeam( 'Hearts' )
    changes Red to hearts team.

    all of the teams can be done this way to include a 'none' to remove the team status.

  3. #53
    Quote Originally Posted by Eskander View Post
    Code:
    Player[ 'Red' ].changeTeam( 'Hearts' )
    changes Red to hearts team.

    all of the teams can be done this way to include a 'none' to remove the team status.
    Yeah I figured that out by looking in the Scripting changelog. It's funny how some of this stuff isn't documented...

  4. #54
    I have 2 new points I'd like to add to the list:
    • onFlip() event that triggers when a player flips an object
    • Tooltips for buttons

  5. #55
    Please either make hotseat players behave more like online players, or make it so people can set up phantom players and switch between them. This would help testing new script changes a lot.

    Thanks!

  6. #56
    you can already set the variables and functions on the script... make a function and set it to a variable and use Global.setVar() and you can change the script on the fly

    functions are just variables in lua like everything else

  7. #57
    Join Date
    Sep 2016
    Posts
    219
    Quote Originally Posted by dig65 View Post
    FYI scripting zones are objects, have guids, can be spawned, moved, rotated, scaled, etc.
    Is this even true? Scipting Zones aren't in the list of Spawnable Objects: [url]http://berserk-games.com/knowledgebase/spawnable-objects/[/url]

    I haven't seen any examples of spawning scripting zones.

  8. #58
    Join Date
    May 2016
    Posts
    1,072
    Spawning scripting zones: [url]http://www.berserk-games.com/forums/showthread.php?2733-How-To-Use-Scripting-Zones[/url]

  9. #59
    Join Date
    Sep 2016
    Posts
    219
    Quote Originally Posted by MrStump View Post
    Spawning scripting zones: [url]http://www.berserk-games.com/forums/showthread.php?2733-How-To-Use-Scripting-Zones[/url]
    Thank you! This should really get added to the knowledge base.

  10. #60
    Just realized that I forgot to mention an onRest event in my first post in this thread. This would be very useful to create simple scripts with good performance.

  11. #61
    Join Date
    May 2016
    Posts
    1,072
    I don't know if you have it, but here is some code hat will activate script once an item has come to rest:

    Code:
    function onDropped()
        startLuaCoroutine(self, 'afterDrop')
    end
    
    function afterDrop()
        while not self.resting do
            coroutine.yield(0) -- Always yield 0 to resume
        end
        --code that runs once the object is resting goes here
        coroutine.yield(1) -- Yield anything other than 0 to break out
    end
    We could use code that activates on a clock timer hitting 0 as well. Right now, the only way to do it is constantly watch the states of the clock.

  12. #62
    Thanks for the reply MrStump. I know that this is a possible workaround and I have a solution in place (which I am currently reworking though) but an onRest event would be much easier to use:
    In my case I want to use it to react on a dice result when all rolled dice are resting. The problem is not so much knowing when the die becomes resting but knowing when it starts moving. Dice can be picked up, dropped, rolled (R-key), number can be set directly, hit by other objects, manipulated by scripts (e.g. your holy roller), i.e. there are no specific events to catch all of that. The only reliable event to detect manipulated dice I found is onCollisionStay from which I start checking when the dice become resting.
    With onRest I could just react on dice that have been moved by any means and are now stationary.

  13. #63
    Join Date
    Mar 2016
    Posts
    182
    I know getting assetbundles into the API is on the list, so I just want to reinforce the priority for having a getCustomAssetbundle and setCustomAssetbundle so can decode and encode their properties and spawn them via scripting. Thanks!!

  14. #64
    I'd like to be able to group decks without using physics.

  15. #65
    Join Date
    May 2016
    Posts
    1,072
    Highlight decks and press G to group them into a single deck.

    If you are looking for a scripting solution that lets you put objects into a container, yes, that's a current request.

  16. #66
    Quote Originally Posted by MrStump View Post
    Highlight decks and press G to group them into a single deck.

    If you are looking for a scripting solution that lets you put objects into a container, yes, that's a current request.
    This is a scripting sub-forum and a scripting related request thread.

  17. #67
    Well, in fairness - stuff gets put in unrelated forums and threads all the time. He just wanted to be sure he was answering the question you intended to ask.

  18. #68
    Events for keyboard and mouse input would be super useful.

  19. #69
    Please add the ability to add scripted contextual buttons to objects.

  20. #70
    I readily admit that some of the new added functionality is looking awesome. Really wish a few of the long outstanding requests for deck/stack handling improvements would get some attention.

    Especially decks as a persistent container that will only be destroyed after the last card/tile is removed, and a put function to add/insert to a specific position. This is pretty basic stuff that baffles me on how long it's been ignored.

  21. #71
    In general, more callbacks would be nice.

    Specifically, I'd really like one for when an object is taken out of a bag (called on the bag, tho one for the removed object would be nice too) and one for when an object is copied/pasted. Preferably receiving both one that's run on the original and a global one that receives the original as a parameter (both would receive the copy, and probably the player who did the copying).

    Also, updating the documentation so that it includes everything is a must, imo.

  22. #72
    Join Date
    Sep 2016
    Posts
    219
    An update to my list, to remove the more ridiculous ones and those that have been fulfilled by asset bundles. Note: I deleted my previous posts.

    • Snap point spawning/manipulation via code - I think several people have pointed this one out, and it would be extremely useful for me personally.
    • Ability to move objects into containers without physics - I personally don't really need this, but many others have requested it and it's easy to see why.
    • Player turn control - Not crucial for me since I have already coded my own turn system, but it would be nice to have for those that actually intend to use the built-in one.
    • Ability to make any object glow - Would be extremely useful to highlight objects of interest for the user. Currently, this effect can sort of by achieved by setting the color tint, but that doesn't work for all objects. Plus, it isn't very obvious. Added in 8.5. Thanks!
    • New events: onFlip(), onRotate() - For when F or Q/E are used. Also there needs to be an event when an object is dropped from a container with alt-right-click. Either add to onDropped or make a new event.
    • Tooltips on buttons - Isn't this the one case where you definitely do want tooltips?
    • 2D GUI control - Currently, if I want a contextual button based on the situation, I spawn a button near the object that the player was most recently interacting with. It would be nice to just be able to put the button on the screen, similar to how the current "End Turn" button does.
    • Autosave control - Random autosaves cause a significant FPS spike. Would be nice to be able to control the exact time that they occur so that it fits into the flow of the game.
    Last edited by Sancho; 01-14-2017 at 10:27 PM.

  23. #73
    Join Date
    Jan 2014
    Posts
    998
    When you say autosaves are causing FPS spikes do you mean the ones that happen every ~10 seconds for rewind or the one that happens every couple of minutes that is written to the disk?

  24. #74
    Join Date
    Sep 2016
    Posts
    219
    Quote Originally Posted by Knil View Post
    When you say autosaves are causing FPS spikes do you mean the ones that happen every ~10 seconds for rewind or the one that happens every couple of minutes that is written to the disk?
    I'm thinking the ones that happen every 10 seconds for rewind (there is no message printed to the chat log when they happen), and I admit I should understand how they work better before I suggest a fix. Part of the problem could be that i'm generating dozens of objects and deleting them routinely.

    EDIT: Let me try to see if I can reproduce the problem when I turn off that feature and I'll get back to you.

  25. #75
    Join Date
    Sep 2016
    Posts
    219
    Ok I verified that it wasn't caused by the temporary objects that I'm creating. Perhaps it deserves its own separate thread, but I get significant FPS spikes every 10 seconds whenever this happens.

Page 3 of 4 FirstFirst 1234 LastLast

Posting Permissions

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