Posts by Minotorious

    well this plugin allows you to create portals from one location to another, so yes you can create a portal that takes any player who steps on it to an underground dungeon or temple.


    But it has nothing to do with the gotospawn command. If the gotospawn command gets you killed from dropping just stand at the ground and type setspawn in the console that will reset the target of the setspawn command and you will no longer get teleported to midair but instead to that position. If you have fly mode on you cannot drop so there is really no way you can die in fly mode unless you are in lava.

    Ok so I place the box then create the area. It opens to everyone that is assigned that area, correct? This means that I have to add everyone to the area not just some new user that logs on? I want a new user that logs on while I am not on my server to get some basic things in the box. Also I want to have random things for them to find in other boxes in areas I create not just the broken houses with boxes that are generated by the game.

    As I said you place the box and then create the area. This way EVERY user no matter if they are added to the area or not can take from the box. This is a small bug this script has and you can exploit to make community chests :) (We have them in our server too in the welcome centre)

    Methods like:


    .getAllNPCsInArea(Area)
    .getAllConstructionsInArea(Area)
    .getAllObjectsInArea(Area)
    .getAllVegetationsInArea(Area)
    .getAllBlocksInArea(Area)


    etc. if anyone can think of anything else, could be useful for some more intricate plugin applications :)


    PS: @yahwho posted it here as well for @red51 to see and let us know if such methods can be added.

    I know that NPCs do respawn in general but no idea about the specifics, maybe @red51 could write a small post here or a small info thread detailing the basics around current NPC spawning mechanics.


    You can spawn more via plugin or in game console (by hand).


    I would do it via plugin and define areas where e.g. there must always be 10 pigs, 10 cows, and 20 chickens then have a timer (every half hour or so) to check all NPCs and if a sufficient number is inside my defined areas, if not it would spawn more randomly inside the areas (make sure the areas are not too high because the NPCs would fall to their death on spawn :P ). Unfortunately there is no .getAllNPCs method for areas so you would have to play some dirty tricks and count all the NPCs from the server (getAllNpcs(Collection<Npc>) - Method in interface net.risingworld.api.World) and check if their position is in your area by .isPointInArea() probably.


    Now that you brought it up having methods in the World interface like .getAllNPCsInArea(Area) .getAllConstructionsInArea(Area) .getAllObjectsInArea(Area) .getAllVegetationsInArea(Area) etc. might be usefull for some plugin applications :)

    I am not sure what you are saying? You place the box then create area? I thought areas prevented them from being opened? you have to name each player .. I want to make like a dungeon chest that anybody can open.

    I am saying exactly what you understood.


    If you place a box and then create the area (i.e. there was NO area when the box was placed) then anyone can take and ofc place things from/in that box.


    But noone can destroy the box.

    /list friends


    8023098235768907230572 last known name Bob (ID: 1)
    8237592385682375872387 last known name Jane (ID: 2)


    /remove friend 2

    A small thing that just came to mind when using on the fly IDs, if I have the following list:


    Minotorious 1
    Bob 2
    yahwho 3
    Rick 4
    Jane 5


    and then I want to remove two friends e.g. Bob and Rick and I do /remove friend 2 then what ID does Rick have afterwards? retain the number 4 till I disconnect from the server or does he become number 3 because Bob is now gone?


    I would definitely use the Server unique IDs to avoid such confusion or make sure the on the fly IDs remain constant at least until the player retypes /list friends.

    It's all built using nothing but stock items. I don't use any special rotations for arches etc

    Hadn't noticed this before you mentioned it :O


    Amazing that you can make something like that with the basic block shapes and without it looking like a minecraft monstrosity :P , very nice work keep it up and post more pictures once you have built it up :)

    I've already written that part of the program using the UID for owner and friend. So I'll have to leave it as it is (far too much on my plate to rewrite code that already works). I was just trying to work out how someone could easily remove a friend.

    Well if it works ofc don't change it :D There are always at least 10 ways to do everything so whichever way you like the most is the best for you :) (so long as it is not 100 times slower than another way but that is not the case here ;) )

    Your point 2 sounds good to list the friends and then possibly have a "shortcut ID" created on the fly to remove the friend from the list, rather than the user having to type in the whole UID.

    I would use the serverIDs to remove players from my list but an ID created on the fly as long as it remains constant for the time required to read the /list commadn output and type the /removefriend command sounds good too.



    Something like,


    /list friends


    8023098235768907230572 last known name Bob (ID: 1)
    8237592385682375872387 last known name Jane (ID: 2)

    I wouldn't include the steam ID in the /list command's output but that is just personal taste :D

    General question but why do you want to implement an in-server friend list? Isn't the steam one sufficient? I understand that standalone users cannot benefit from the steam one but still think it is too much effort with no real benefit for most users.


    Or is the in-server friend list benefiting your users in some way? Like adding custom waypoints to the map where their friends are or having a compass or an arrow point to the direction a friend is at?


    If I had to implement an in-server friend list I would do it this way:


    1) /addfriend Name (when friend player is online)
    This would save in my own database the server unique ID of the player. My db would look like this:


    Int primary key autoincrementID of player who added the otherID of player who was added
    11015
    21510


    meaning player with server ID 10 (e.g. Minotorious) has added player with server ID 15 (e.g. yahwho) as their friend. (you can add a confirm command before this is saved to the db for the other player e.g. once I use /addfriend yahwho you get a chat message and need to type /confirm for the entry to be added to the db. Then ofc the reverse entry would be added too see line 2 above of you adding me as a friend)


    2) /friendlist or /listfriends
    shows all friends of a player querying the world db for their current names using the Server UDs from my DB.


    e.g steps: query my db for all IDs (in column 3 above) that have my number as the ID who added them (column 2 above), then query the world db for each of the numbers to get the name, and finally output the results.


    e.g. output in chat:


    Friend List:
    Name ID
    Minotorious 10
    yahgiggle 5
    red51 2
    etc.


    3) /removefriend ServerID (serverID obtained easily from /friendlist or /listfriends)
    using an sql query removes the friends from my db without the need to obtain the player names or get mixed up with changed names and try to figure out when they were changed.


    Hope this helps :)

    A possibility would be to store the uid together with the friends name in your table when you add the friend. Then you can retrieve the uid even when the friend is not logged in.

    the only problem with using the name is that the player can change it at will now :/


    Unless you check it every time someone logs in and change your db names accordingly


    For example i may add John as a friend but then need to remove Rick because John has changed his name to Rick in the meantime

    i would suggest you save the friend list as the server unique id numbers, then to get the names of the players you can sql query the world db for the player with that number then your remove friend command can be something like:


    /Removefriend serverID

    hmm another thought what if you use absolute positions to place it? what happens then does it move on different resolutions? (though in the non relative case you might have problems with different screen sizes giving different positions :/ worth a try if you got time :D )