If you just want to calculate it once. Our EAH-Tool has a calculator in the Functions-Area. If you want to calculate it yourself... Well it seems complicated, but once you understood it, its easy. I paste you hear my excel sheet how I figured the whole thing out (took me quite a while ): Out of that you can build your own formula. Its not difficult at all. See that marked area as your Map. left is east, right is west. Up is north... (i know was mirrored, but took me long to track all). The numbers are the last digits of the area file. The numbers on the left the first digits. On the topü and left/right of that map, you see the coordinates in chunks of 500. Each area file contains an chunk of 500*500*500 In the middle you see a 0 that is also where the coordinate 0,0 is. From there its starts with area 0 and goes to the east always 1 further. (it stops with 7 since there is the green barrier (its the map of the planet). But it would go further until ~800000 and then count further in the same row from west to the middle. When reached middle (next to the 0) its already at an areafile 16777215. Now you go to the next row and do the same. If you go south you see that you start at the highest value possible. Norht south would meet one day in numbers, as east and west would do. If you just want to calculate a row further then add 16777216 for north or -16777216 for south. (Keep in mind though that below 0 comes this big number) Hope that helps. This calculation does not consider height... But it would be very similar to the whole thing. You will figure it out . Just go to empty space without area files and see which area files come up when you fly north / south and draw yourself such a map as I did. Here would be the code in VB: Code: Public Shared Function GetAreaFileName(Coordinates As clsCoordinates) As String Dim NSFaktor As Long = 16777216 Dim NorthSouthRow As Integer Dim EastWestRow As Integer Dim FileNumber As Long = 0 GetAreaFileName = "" Try 'North/South If Coordinates.NS >= 0 Then NorthSouthRow = Math.Floor(Coordinates.NS / 500) FileNumber = NorthSouthRow * NSFaktor Else NorthSouthRow = Math.Floor(Coordinates.NS * (-1) / 500) FileNumber = 281474959933440 - (NorthSouthRow * NSFaktor) End If 'East/West If Coordinates.EW >= 0 Then EastWestRow = Math.Floor(Coordinates.EW / 500) FileNumber = FileNumber + EastWestRow Else EastWestRow = Math.Floor(Coordinates.EW * (-1) / 500) FileNumber = FileNumber + NSFaktor - 1 - EastWestRow End If GetAreaFileName = Trim(Str(FileNumber) & ".area") Catch ex As Exception Log.Log_Exception(ex) End Try End Function
Q: I've created my DLL file and put it in the ...\Empyrion - Dedicated Server\EmpyrionDedicated_Data\Managed folder, then started my server but it doesn't appear to be loading. am I missing a step? A:
What am I doing wrong here? I'm just trying to get the Event_Player_Info to trigger and say "Data Received" but nothing happens. I log in and say something in chat and get "Data Sent" as an alert then Nothing... I imagine the part where it says "ci.playerId" (evaluates to an Int 28) is the part that is wrong but I cant figure it out. Code: case CmdId.Event_Player_Info: MessagePlayer("Data Received", 1); break; case CmdId.Event_ChatMessage: ChatInfo ci = (ChatInfo)data; GameAPI.Game_Request(CmdId.Request_Player_Info, (ushort)CmdId.Request_Player_Info, ci.playerId); MessagePlayer("Data Sent", 1); break;
You need to use ci.playerId as a parameter to 'Eleon.Modding.Id' That way it should work: GameAPI.Game_Request(CmdId.Request_Player_Info, (ushort)CmdId.Request_Player_Info, new Eleon.Modding.Id(ci.playerId)); /jmc
tried, doesnt work. program stops running when it hits that line. I dont get it, even whem I just type my playerId into that parameter it doesnt work. Code: GameAPI.Game_Request(CmdId.Request_Player_Info, (ushort)CmdId.Request_Player_Info, new Eleon.Modding.Id(28)); This doesn't work, it even prevents the chat message from displaying in the chat window
good idea. Class libraries cant be debugged directly is what it says when I run Visual Studio's Debugger though. um, I'll work on adding error coding when I get off work tonight.
I don't know, if it works with empyrion that way, but when i code AutoCAD Application modules, i can add the .exe as startup program for the .dll and the debugging usually works. Try adding empyrion.exe as startup program. Otherwise just use GameApi.Console_Write for basic debugging, to see what the values are before sending the GameAPI_Game_Request command. EDIT: If you use the empyrion.exe as startup program to debug the modl dll in visual studio, you would also have to set the Debug output path of the .dll to Empyrion's mod folder, so visual studio uses the same .dll the game does.
OMFG, Really?!?! Proto-Buff.dll was missing from the dedicated server DLLs folder that is what was causing the thing to fail
Q: Is it possible to connect a SQLite database to an API mod? A: No... my mod fails to load if I have even One reference to SQLite in it.
Thats not really true. But you might not be able to do it if you build a Mod directly connected to the game. As mentioned we suggest a TCP connection instead.
Q: Is there a way to construct an ItemStack[] ? A: Not Directly, as far as I can tell. There is a workaround though. copy your bag ItemStack[] to a variable then give yourself an Empty ItemStack[] then use Request_Player_AddItem to give yourself the items you want in the new ItemStack[] in their proper slots copy that bag ItemStack[] to another variable then restore your original bag ItemStack[] Why is this useful? Request_Player_ItemExchange requires an ItemStack[]
Why don't you just create a ItemStack array? Code: Eleon.Modding.ItemStack[] itStack = new Eleon.Modding.ItemStack[] { new Eleon.Modding.ItemStack(2053, 1) }; Just take a look at the example project. It has most Requests implemented