A lot of code lines to determine what people can do and not do. There in lies a problem. for my old java server build at least. It seems to obsolete the ability to provide for an permission rank that lets people have more as they progress. In the concept a miner1 could not mine precious metals but basic metals such as iron. The permission group could be used to turn it on.
Posts by angriff
A new update is now available, introducing seasons and more!
Latest hotfix: 0.8.0.1 (2024-12-20)
Latest hotfix: 0.8.0.1 (2024-12-20)
-
-
Ok I think maybe I should be creating and reading group name in the permission files. It is not set in the default.json. I was expecting it to come out of the file name like before.
group
info
Determines the "group name" that should be shown in the player list. Other than that, this permission has no relevance
Question is the group is just the group name not the file.name (Default or Default.json)?
-
Player getActiveAreaPermission() gets the area permission permission of someone assigned to the area (from permissions/areas)
Player getPlayerGroup() gets the players permission(from permissions)
Area getPlayerPermission() should get a players default permissions to an area( from permissions/area the permissions set as an areas default permission. for some reason always returns null)
they all return a string of the permission name.
also, when a player spawns the area and its permissions will return null until the player has moved. i get around this buy on spawn adding .05f to the spawn position. gets just enogh movement to get the info
Interesting tactic to move the player on spawn. Maybe the area defaults are only set when in the area. Did you do the experiment in a defined Area? Area groups are going to change as the players move around the map. There is a method to read the current and old permissions as well as the area permissions. I guess you could check to see if there has been a change with a not-null check.
That brings up that area permissions must be overriding regular permissions and would interfere with specialized class permissions assigned at spawn. Could an area permission grant specialized powers over standard permissions while in the area, I would guess, Yes. You could not have fly rights, for example, in the main world but be granted them in an area and vice versa. A players home area could be set to not allow PVP while he is in his area as owner while being able to kill those that visit.
If I remember correctly there was a db that you could edit to set a players permission group by hand edit. Is there still a Db with players IDs and such? I did not find it on my fast search only the definitions db.
-
With permission groups changing in Unity and the advent of Areas and groups I am having a little difficulty detecting what group a player is in. I have an old Java routine that parsed the name of the group and decided certain extra keys to map and routines that could be run by them in my code. Also embedded in the permission group name was a number that I could read and again provide for some extra routines they could run. The problem is the currently I cannot seem to know what group the guy is in if he is moving around areas. Mind you this is not an attribute inside the file but the name itself I was trying to read such as farmer1, farmer2 etc. The file itself was a standard permission file but has different attributes turned on or off as sort of an advancement reward. But now I am getting a bunch of [StringOutOfBounds Exceptions(0,-1) out of bounds for length 0 ] and Preconditions for several lines when I thought it would run properly. No Errors in Compile.
The routine does this onPlayerSpawnEvent() and runs just once to determine the players job. Should I set an player attribute when I read this? I wish there was a permissions name in the permissions.
Any Thoughts or examples?
currclass=player.getPermissionGroup();
String pclass = currclass.substring(0, currclass.length() - 1);
String lastChar = currclass.substring(currclass.length() - 1)
lvl1 = Short.parseShort(lastChar);
PS I am still troubleshooting this as some of the issue is that this maybe expecting Admins to be in a group also. It just is not clear to me where these errors are coming from. Maybe a null detection?
-
FYI. If I am in GM 1 Creative Mode and I try to remove some rocks, I get a constant error message that I cannot remove Rock from this area and then the rock is removed every time I click. This is an area that was created by myself prior to installing the Plug in. I have to be in Creative mode (GM 1 F5) to remove in this area created prior to the installs.
-
I was looking at some old plugins and I had a routine that told you the moon phase and gave players more power under a full moon. This seems to be no longer an option in Unity.
-
So sad... Netbeans lost my project and the old files are corrupted.
Managed to reconstruct it off an older version. Not as slow since I had already looked everything new up.
-
The Javadoc contains an example about that
Basically you need to provide a bitmask of the Layers you want to include in the raycast. Do not use the layers directly, instead create a bitmask with the Layer.getBitmask() method. Other players have the Layer "REMOTEPLAYER", so getting the bitmask or performing the raycast would look like this:
Ok thanks, I read the JAVDOC but it appeared I would have had to go through several layers of looking, getting the Id (which I was not sure of for another player), getting the name and identifying it that way. The .RemotePlayer seems more like the old .Players. Thanks again.
and for the readers dont forget to;
import net.risingworld.api.utils.Layer;
-
Trying to identify that a player is looking at another Player or NPC and then act upon information from the result. I used player raycast(CollisionType.PLAYERS, I cant seem to find the Replacement in the new API?
-
This works with RW areas so they are unaffected, or if your question is for areas already made using older versions, then again yes its backwards compatible
That works I just have a new Unity server set up but some areas are already set up. Thanks.
-
Thanks for doing this Yahgiggle. One question before I install and try it out. Does this routine interfere with areas that are already set up on the server to protect Admin structures?
-
OH drat I just missed it in the API, Sorry, you have to add color = and turn it off /color
player.sendTextMessage("<color=#FF0000>This is a red text</color>");
-
take a look at this New Plugin UI ant this New API vs. old API
Ya I did see that.. but this font color used to work directly in the message statement.
-
Nevermind I got this to work and likely it was the problem of Properties being set to Java8 or that it tried to pull in the old RisingworldAPI933 that was in the old Netbeans project I was modifying.
I do have a question on chat colors. Can you still imbed them in chat statements?
player.sendTextMessage("[#cc0000] Checking");
What did it change too? Can you force the chat screen open to show messages. Seems when I send them they are not showing unless I hit T.
-
So to Give a player something I was trying to put it into their equipped hand slot but I keep getting a lossy conversion error with the getQuckslotFocu. I was using the item id (not def) because it allowed for slot
This was giving back the player some like leather, which had to be in his hands when he was making it, if the routine was not able to make what he was buying for some reason like full inventory.
player.getInventory().addItemToSlot((short)178, 0, 10, inventory.getQuickslotFocus(), Inventory.SlotType.Quickslot);
additemtoslot calls for an int for slot number. Are they returned in long or short from getQuickslotFocus()? The API is not clear to me what precision format is returned from getQuickslotFocus().
-
Oh I thought that was why you left gaps in the item number list for additions and changes. I used the item numbers in my older JAVA day routines. Thanks for the pointers.
-
This happens if in your project settings (rightclick on the project -> properties -> sources) the "Source/Binary format" is is set to JDK 8. The new Plugin API uses Java 20, so you should change the Source/Binary format to JDK 20 accordingly
Cool. I did use an older project and was trying to convert it. What about the Profile and Encoding setting?
-
When I compiled a Netbeans project I got these warning. Can anybody explain. It still worked.
warning: [options] bootstrap class path not set in conjunction with -source 8
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
-
I am trying to put something in a players hands during an interaction with a sign. The old ID I had for a saddle was 900. Is there are list of the ID numbers anywhere or do I have to make a routine and look at them one by one. Maybe I need to look at a SQLdatabase? If so point me in the right direction. Thanks.
-
Hey James1bow, I want to truly thank you. I finally go it to work. Not exactly sure what fixed it (except the big else to nowhere mistake) as I did several things but I took your basic outline and with a slight modification got my (essentially a hello world type exercise) routine to work. It is one of the aspects of this community that I have always loved.
Now to get the more complicated routines converted.