Pass mouse click locations to the server.



  • Ok, so I can create a database in a room to hold the data for building the entire base over time, I can show (With room visuals) where the potential structures will go when eventually built. I can edit the data base, either manually through the memory editor, or through script... thus updating the database before the structure is built.

    What I CAN'T do is click on a room visual to highlight it, then click on an empty tile to tell my code to update that structure's build location.

    Obviously, this can't be done in real time, as the script only runs one pass each tick. But a variable like "Game.mousePos" could be added that contains the last position clicked in the last tick's cycle. It would be null if no click was sent during that time.



  • @smokeman I think this game about automation everything. I am do not like idea to past mouse position to the server. If you want you can use flags for this.



  • You can make the game about automating everything, or not. That's up to you. As described, if you don't want to know there clicking happened, ignore the variable.



  • @smokeman I am try to tell you that you can do what you want by using flags. https://bencbartlett.wordpress.com/2018/02/06/screeps-2-interior-design/


  • TMB

    On the same line, I would enjoy being able to create custom user interfaces. In the meantime, flags are the way to quickly pass data to the script.
    You don't need to have the script rely entirely on flags: in my script creeps eats up any flag that bear their name, and only store its position in memory to know what they must do. You could place a flag named extension, have the script detect it, plan the building, then delete it so you can place another flag.

    @Flyasd1 What you did there is amazing ! I had been thinking about doing something similar, but never got even started. How did you manage to reproduce the look of structures with such fidelity ?



  • @estecka This is not mine. This is @Muon.



  • Screeps isn't a realtime game.
    It is virtually impossible to grant your request without major changes.
    That said you could write your own client extensions to allow this via the console.
    But that would more of a hack and probably work very similar to the flags.



  • I would like clicks to be passed to the screeps bot, so that the bot can see which building/creep you have highlighted, and create additional visuals that show extra information about that creep/building. For example, destination, mission, what's it waiting for etc etc



  • @wtfrank hm passing a "selected" to the game for building visuals actually sounds like a reasonable request.
    Could be an array in the game object.


  • Dev Team

    @mrfaul Passing selected in a very easy task on top of Screeps-SC, but I must say that processing selection is often overrated. I implemented it at the early game stage then dropped it in a couple of weeks after implementation. But if you really feel you need it, as said, it's not hard to implement it by yourself.