[plugin]BlockPlacer (world edit replacement oO)

  • I'm going to record a video, that way you can point out what I'm doing wrong. :(


    hi


    first /selectarea is also part of the protection script so even if you don't have block placer installed you can still select an area
    oO but by how there is no feedback when you enter into the chat /delete my guess is you have not added the block placer plugin to your plugins folder, because even if it did not delete your beams you should have got error something went wrong or all construction removed, messages in chat


    whats your server name i can come and take a look but your also need to add me as a admin for me to test it out

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png
  • plugins don't get left hanging they are much like a book, they read down every page till they hit what they are looking for so in aother words when you type /select the program will search all the scripts till it finds /select and then run that line of code then stop till the next command has been asked say/delete con

    I am not so sure: each plug-in listening for player chat commands is notified when a chat command is issued. And each plug-in will (presumably) check if it is a command it is interested in.


    So, each plug-in recognising a "/select" command will do whatever that command means to it.

  • I am not so sure: each plug-in listening for player chat commands is notified when a chat command is issued. And each plug-in will (presumably) check if it is a command it is interested in.
    So, each plug-in recognising a "/select" command will do whatever that command means to it.

    That is what I'm getting at... You will have two plugins responding to the command when you only expect one to respond. If the plugins use "unique" commands, like "/we select" or "/bpselect" (block placer) or "/apselect" (area protection), then you won't run into the potential issue of multiple plugins responding to the same command. Same with "/delete", IMO, should be something like "/bpdelete" or "/bp delete", etc.

  • Hmmm. So only one of the plugins will respond to the /select command? Which one? What I'm getting at is if someone else does a plugin using the /select command. It seems that coders should pick "non-generic" commands to avoid conflict.

    conflicts are always a real thing that could happen, but saying coders should pick "non-generic" commands to avoid conflict, is not right, you should be saying
    coders should check there commands to avoid conflict, i checked and the commands had not been used so i used them, this was to keep the script as simple to use as possible.

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png
  • I am not so sure: each plug-in listening for player chat commands is notified when a chat command is issued. And each plug-in will (presumably) check if it is a command it is interested in.
    So, each plug-in recognising a "/select" command will do whatever that command means to it.

    yes and is why i said two things will happen, but in the case of /select /selectarea /select area they all do the same thing, they bring up the area selecting tool oO

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png
  • coders should check there commands to avoid conflict, i checked and the commands had not been used so i used them, this was to keep the script as simple to use as possible.

    This is feasible even down the road when there are maybe 100's of plugins? If I were coding, I would rather just use something that I'd be pretty sure is unique, but that's me.


    Say I write a plugin 3 months from now and don't take the approach of using a unique name for selecting from a player list (like /playerselect) and I use /select. My plugin will respond with a list of players over the top of your plugin kicking off the "selecting tool" and actually mess up both the plugins. If you had originally used something like "/bpselect" that would not happen.

  • This is feasible even down the road when there are maybe 100's of plugins? If I were coding, I would rather just use something that I'd be pretty sure is unique, but that's me.

    maybe if someone else use's the same commands as i do, and you happen to install there plugin, and then get conflicts, you should let that other coder know that they need to change there script commands because those commands had been taken by the block placer plugin first. lol

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png
  • yes and is why i said two things will happen, but in the case of /select /selectarea /select area they all do the same thing, they bring up the area selecting tool oO

    1) "/selectarea" is definitely a different command than the other two, as event.getCommand().split(" ")[0].equals("/select") will not match it; the other two might end up behaving differently or not according to the way each treats further words after the first.


    2) Are we sure that only one instance of the area selecting tool would be created or there will be several?


    3) Even if they share the same area selecting tool, once the selection completed, each will carry on its own processing of that area; not necessarily what the user may want...


    This is similar to the problem with Java package names (which should ideally be unique world-wide) or with GUID (which are by definition "Globally Unique"). In both cases, some heuristics has been found to manage the problem. It should be much easier in a much more limited domain, like RW chat commands. I am not sure that picking the first string coming to mind and not yet used by another plug-in is such a heuristics...

  • I thought the command for BP plugin is "/select area" (with a space). While the one for AP is "/selectarea" (no space). Shouldn't the only plugin responding be the BP plugin?

    the command /select or /selectarea or /select area is used by more than one script, portals is another one too, IDK what command he used to bring up the selection tool, but what i do know is the command /delete con will output a message in chat if the BP plugin is installed, if no massage then i guess something has gone wrong or the script has not even been installed.

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png
  • 1) "/selectarea" is definitely a different command than the other two, as event.getCommand().split(" ")[0].equals("/select") will not match it; the other two might end up behaving differently or not according to the way each treats further words after the first.
    2) Are we sure that only one instance of the area selecting tool would be created or there will be several?


    3) Even if they share the same area selecting tool, once the selection completed, each will carry on its own processing of that area; not necessarily what the user may want...


    This is similar to the problem with Java package names (which should ideally be unique world-wide) or with GUID (which are by definition "Globally Unique"). In both cases, some heuristics has been found to manage the problem. It should be much easier in a much more limited domain, like RW chat commands. I am not sure that picking the first string coming to mind and not yet used by another plug-in is such a heuristics...

    several instance's of the selection tool running at once oO i don't think it works like that, but ill ask red51 as thats a good point,
    , saying picking the first string coming to mind is a little rude Miwarre its almost saying i was lazy lol but the tru fact is the frist thing i picked was /bp
    but after all the problems with world edit and users typing the wrong thing like / weplace block /weplace block etc i decided adding /bp to the mix would case more problems than it solves.

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png
  • Ok, I am officially confused. I thought the commands "/selectarea", "/select area", "/select" and even "/selectportal" would all be 4 separate commands and the plugins/scripts would only respond to their corresponding one.

  • if it turns out that two instance's of the selection tool does run, then i will redo my script to include /pb or maybe we should hold a vote lol if im out voted ill suck it up and add it lol

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png
  • saying picking the first string coming to mind is a little rude Miwarre

    Sorry, I didn't intend to be rude; direct maybe yes, but not rude; if it sounded like this, I apologise.

    Quote

    but after all the problems with world edit and users typing the wrong thing like / weplace block /weplace block etc i decided adding /bp to the mix would case more problems than it solves.

    This may be a point.


    If it is of any relevance or usefulness, when I still used chat commands for the various functions of my plug-ins, I decided to use a common prefix, which was usually the name of the plug-in (or an acronim for it), reducing the possibility of conflicts ("/gps sethome", "/gps gohome", etc), but still not ruling them out definitely and so, I gave the possibility to change the prefix via plug-in settings, in case another one use (now or in the future) the same string as a prefix or a command.


    Now, I moved everything to GUI, but there is still the (single) command to call up the main GUI entry point; in any case, for this, I still give the possibility to customise it.

  • Sorry, I didn't intend to be rude; direct maybe yes, but not rude; if it sounded like this, I apologise.

    This may be a point.
    If it is of any relevance or usefulness, when I still used chat commands for the various functions of my plug-ins, I decided to use a common prefix, which was usually the name of the plug-in (or an acronim for it), reducing the possibility of conflicts ("/gps sethome", "/gps gohome", etc), but still not ruling them out definitely and so, I gave the possibility to change the prefix via plug-in settings, in case another one use (now or in the future) the same string as a prefix or a command.


    Now, I moved everything to GUI, but there is still the (single) command to call up the main GUI entry point; in any case, for this, I still give the possibility to customise it.

    i was going to add GUI but decided that the game will have that built into it fully at some point anyway so no point to it. like i said above, if it turns out that two instance's of the selection tool does run, then i will redo my script to include /pb i have messaged red and im now waiting for a reply

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png
  • ok red51 reply was this


    red51: basically the game just has "one" selection tool. not sure about lua but if you call "player.enableAreaSelectionTool()" in the plugin api multiple times, nothing will happen (just the selection tool gets enabled). which methods do you call exactly?
    Yahgiggle: i use player.enableAreaSelectionTool()
    Yahgiggle: this is what i expected but didint know 100% cheers
    red51: yeah you can basically call this method multiple times, it doesn't matter

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png
  • Ok, I am officially confused. I thought the commands "/selectarea", "/select area", "/select" and even "/selectportal" would all be 4 separate commands and the plugins/scripts would only respond to their corresponding one.

    in code you can have lots of commands that do 100% the same thing


    because its goes like this


    if (cmd[0].equals("/select")){
    player.enableAreaSelectionTool();
    player.sendTextMessage("select area tool now enabled");
    }


    if (cmd.length == 2){
    if (cmd[0].equals("/select")){
    if (cmd[1].equals("area")){
    player.enableAreaSelectionTool();
    player.sendTextMessage("select area tool now enabled");
    }
    }
    }


    if (cmd[0].equals("/selectarea")){
    player.enableAreaSelectionTool();
    player.sendTextMessage("select area tool now enabled");
    }




    all 3 commands = player.enableAreaSelectionTool() <----------- this is the real command as such

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png
  • hi
    first /selectarea is also part of the protection script so even if you don't have block placer installed you can still select an area
    oO but by how there is no feedback when you enter into the chat /delete my guess is you have not added the block placer plugin to your plugins folder, because even if it did not delete your beams you should have got error something went wrong or all construction removed, messages in chat


    whats your server name i can come and take a look but your also need to add me as a admin for me to test it out

    But I have the blockplacer installed, in the same folder as the other plugins. Single player mode.


    Steam\steamapps\common\RisingWorld\plugins\BlockPlacer\BlockPlacer.jar


    Is it in the wrong folder?

  • But I have the blockplacer installed, in the same folder as the other plugins. Single player mode.
    Steam\steamapps\common\RisingWorld\plugins\BlockPlacer\BlockPlacer.jar


    Is it in the wrong folder?


    ok i just tested it in single player and it works fine


    when you use /delete con in single player or on a server even if the command does not delete anything you get an output of Deleted all Construction
    in the chat box, you did not get this so i noted in your video that you have used your programmable keys to save this command, try doing another video but this time type the command don't use the shortcut key you have made.

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png

  • ok i just tested it in single player and it works fine


    when you use /delete con in single player or on a server even if the command does not delete anything you get an output of Deleted all Construction
    in the chat box, you did not get this so i noted in your video that you have used your programmable keys to save this command, try doing another video but this time type the command don't use the shortcut key you have made.

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!