GithubHelp home page GithubHelp logo

otacademy / rme Goto Github PK

View Code? Open in Web Editor NEW
37.0 7.0 21.0 6.89 MB

OTAcademy fork of Remere's Map Editor repository.

Home Page: https://discord.gg/OTAcademy

License: Other

CMake 0.38% C++ 98.73% C 0.74% Shell 0.08% Python 0.06%
2d mapeditor mmorpg

rme's Introduction

What is this?

This is a map editor for game servers that derivied from OpenTibia server project.

It is a fork of a Map Editor created by Remere.

You can find an engine compatible with OTBM format at OTAcademy, OTLand, OpenTibiaBR or other OT communities.

Visit OTAcademy discord if you are looking for support or updates.

I want to contribute

Contributions are very welcome, if you would like to make any changes, fork this project or request commit access.

Please, if you would like to contribute anything, documentation, extensions or code speak up!

Bugs

Have you found a bug? Please create an issue in our bug tracker

Other Applications

Download

You can find official releases at this repository releases page.

Compiling

Required libraries:

  • wxWidgets >= 3.0
  • Boost >= 1.55.0

VCPKG libraries:

  • 32-bit : vcpkg install wxwidgets freeglut asio nlohmann-json fmt libarchive boost-spirit
  • 64-bit : vcpkg install --triplet x64-windows wxwidgets freeglut asio nlohmann-json fmt libarchive boost-spirit

Compile on Windows

Compile on Ubuntu

Compile on Arch Linux

Compile on macOS

rme's People

Contributors

dex-89 avatar emil92b avatar epuncker avatar kezuino avatar omarcopires avatar prawdziwy avatar zbizu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

rme's Issues

Make RME support different encodings from items.xml

For example if I have items.xml UTF-8 and item id 100 named ground it works ok

However, if I have items.xml UTF-16 (or any other encoding: ANSI, Windows-1252) and item id 100 named chão it will display blank item name and id:

2022-04-29 15_41_43-Search for Item

this will be very useful for projects that have Multilanguage support or just not using English at all

suggestion: export position

image
need to have export positionns when creating some shit for arena and stuff will save everyone million times
e.g annihilator tiles

participantsPos = {
Position(4786, 5199, 8), -- Player 1, this player should be the one to pull the lever
Position(3118, 1842, 7), -- Player 2
Position(3119, 1842, 7), -- Player 3
Position(3120, 1842, 7) -- Player 4
},

Compile error - Windows

When building on windows the following came up.

Compile settings:

  • Release
  • x64

Apart from installing the vcpkg's which are stated in the initial repo of RME there needs to be added another vcpkg called libarchive.
I have installed the following library:
.\vcpkg install --triplet x64-windows libarchive
After this action I could compile it to a further state.

Now I get the following in the output log:
1>Done building project "Editor.vcxproj" -- FAILED.

The error log shows me the following error directed to line 157 in event.h
Severity Code Description Project File Line Suppression State Error C2243 'static_cast': conversion from 'void (__cdecl MainMenuBar::* )(E &)' to 'void (__cdecl wxEvtHandler::* )(E &)' exists, but is inaccessible Editor C:\vcpkg\installed\x64-windows\include\wx\event.h 157

Anyone knows what I might have done wrong and what should be changed?

Linux build completely broken

Code doesn't build on Linux because of few errors and even missing cpp files in the Cmake. Is the CMake not maintained at all ? I've fixed the build as best as I could and I get the editor to start up, however, when opening a new empty map the program eventually crashes. I'm trying to debug it but no luck so far with even getting a trace (it crashes on some X11 error)

Here's my diff to even get you started on Linux, but please let me know if this fork is even supported or is it completely broken and abandoned.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d2f8d6b..71184fb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,6 @@
 cmake_minimum_required(VERSION 3.1)
 
 project(rme)
-
 if(NOT CMAKE_BUILD_TYPE)
 	set(CMAKE_BUILD_TYPE RelWithDebInfo)
 endif()
@@ -37,4 +36,4 @@ set_target_properties(rme PROPERTIES CXX_STANDARD 17)
 set_target_properties(rme PROPERTIES CXX_STANDARD_REQUIRED ON)
 
 include_directories(${Boost_INCLUDE_DIRS} ${LibArchive_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR})
-target_link_libraries(rme ${wxWidgets_LIBRARIES} ${Boost_LIBRARIES} ${LibArchive_LIBRARIES} ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${ZLIB_LIBRARIES})
\ No newline at end of file
+target_link_libraries(rme ${wxWidgets_LIBRARIES} ${Boost_LIBRARIES} ${LibArchive_LIBRARIES} ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${ZLIB_LIBRARIES})
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index 421e2c0..b44c665 100644
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -1,6 +1,7 @@
 set(rme_H
 ${CMAKE_CURRENT_LIST_DIR}/about_window.h
 ${CMAKE_CURRENT_LIST_DIR}/action.h
+${CMAKE_CURRENT_LIST_DIR}/add_item_window.h
 ${CMAKE_CURRENT_LIST_DIR}/application.h
 ${CMAKE_CURRENT_LIST_DIR}/artprovider.h
 ${CMAKE_CURRENT_LIST_DIR}/basemap.h
@@ -95,6 +96,8 @@ ${CMAKE_CURRENT_LIST_DIR}/templates.h
 ${CMAKE_CURRENT_LIST_DIR}/threads.h
 ${CMAKE_CURRENT_LIST_DIR}/tile.h
 ${CMAKE_CURRENT_LIST_DIR}/tileset.h
+${CMAKE_CURRENT_LIST_DIR}/tileset_window.h
+${CMAKE_CURRENT_LIST_DIR}/add_tileset_window.h
 ${CMAKE_CURRENT_LIST_DIR}/town.h
 ${CMAKE_CURRENT_LIST_DIR}/updater.h
 ${CMAKE_CURRENT_LIST_DIR}/wall_brush.h
@@ -106,6 +109,7 @@ ${CMAKE_CURRENT_LIST_DIR}/welcome_dialog.h
 set(rme_SRC
 ${CMAKE_CURRENT_LIST_DIR}/about_window.cpp
 ${CMAKE_CURRENT_LIST_DIR}/action.cpp
+${CMAKE_CURRENT_LIST_DIR}/add_item_window.cpp
 ${CMAKE_CURRENT_LIST_DIR}/application.cpp
 ${CMAKE_CURRENT_LIST_DIR}/artprovider.cpp
 ${CMAKE_CURRENT_LIST_DIR}/basemap.cpp
@@ -192,6 +196,8 @@ ${CMAKE_CURRENT_LIST_DIR}/templatemap854.cpp
 ${CMAKE_CURRENT_LIST_DIR}/templatemapclassic.cpp
 ${CMAKE_CURRENT_LIST_DIR}/tile.cpp
 ${CMAKE_CURRENT_LIST_DIR}/tileset.cpp
+${CMAKE_CURRENT_LIST_DIR}/tileset_window.cpp
+${CMAKE_CURRENT_LIST_DIR}/add_tileset_window.cpp
 ${CMAKE_CURRENT_LIST_DIR}/town.cpp
 ${CMAKE_CURRENT_LIST_DIR}/updater.cpp
 ${CMAKE_CURRENT_LIST_DIR}/wall_brush.cpp
diff --git a/source/graphics.cpp b/source/graphics.cpp
index 3c08d61..9b15a2c 100644
--- a/source/graphics.cpp
+++ b/source/graphics.cpp
@@ -1147,6 +1147,8 @@ void GameSprite::Image::createGLTexture(GLuint whatid) {
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, 0x812F); // GL_CLAMP_TO_EDGE
 	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SPRITE_PIXELS, SPRITE_PIXELS, 0, GL_RGBA, GL_UNSIGNED_BYTE, rgba);
 
+	printf("gfx: texture %u\n", whatid);
+
 	delete[] rgba;
 #undef SPRITE_SIZE
 }
diff --git a/source/light_drawer.cpp b/source/light_drawer.cpp
index 33122ef..c88f96c 100644
--- a/source/light_drawer.cpp
+++ b/source/light_drawer.cpp
@@ -143,8 +143,13 @@ void LightDrawer::clear() noexcept {
 }
 
 void LightDrawer::createGLTexture() {
+	texture = 0xdeadbeef;
 	glGenTextures(1, &texture);
-	ASSERT(texture == 0);
+	printf("tex: %u\n", texture);
+	auto code = glGetError();
+	fprintf(stderr, "OpenGL error: %d, %u\n", code, texture);
+
+	//ASSERT(texture == 0);
 }
 
 void LightDrawer::unloadGLTexture() {
diff --git a/source/map_drawer.cpp b/source/map_drawer.cpp
index 7cf6539..8ebf916 100644
--- a/source/map_drawer.cpp
+++ b/source/map_drawer.cpp
@@ -178,6 +178,13 @@ void MapDrawer::SetupGL() {
 	glPushMatrix();
 	glLoadIdentity();
 	glTranslatef(0.375f, 0.375f, 0.0f);
+
+	printf("SetupGL()\n");
+
+	GLuint texture = 0xdeadbeef;
+	glGenTextures(1, &texture);
+	auto code = glGetError();
+	fprintf(stderr, "OpenGL status: %d, %x\n", code, texture);
 }
 
 void MapDrawer::Release() {
@@ -1456,7 +1463,7 @@ void MapDrawer::WriteTooltip(Item* item, std::ostringstream& stream, bool isHous
 		stream << "text: " << text << "\n";
 	}
 	if (tp) {
-		Position& dest = tp->getDestination();
+		auto dest = tp->getDestination();
 		stream << "destination: " << dest.x << ", " << dest.y << ", " << dest.z << "\n";
 	}
 }
@@ -1870,7 +1877,7 @@ void MapDrawer::AddLight(TileLocation* location) {
 		return;
 	}
 
-	auto& position = location->getPosition();
+	auto position = location->getPosition();
 
 	if (tile->ground) {
 		if (tile->ground->hasLight()) {
diff --git a/source/old_properties_window.cpp b/source/old_properties_window.cpp
index ddbcd28..a7b27c4 100644
--- a/source/old_properties_window.cpp
+++ b/source/old_properties_window.cpp
@@ -771,7 +771,7 @@ void OldPropertiesWindow::OnClickOK(wxCommandEvent& WXUNUSED(event)) {
 				}
 			}
 
-			Outfit& newOutfit = Outfit();
+			auto newOutfit = Outfit();
 			if (podium) {
 				int newLookType = look_type->GetValue();
 				int newMount = look_mount->GetValue();
diff --git a/source/palette_brushlist.cpp b/source/palette_brushlist.cpp
index 9d555e3..3f5994d 100644
--- a/source/palette_brushlist.cpp
+++ b/source/palette_brushlist.cpp
@@ -255,7 +255,7 @@ void BrushPalettePanel::OnClickAddItemToTileset(wxCommandEvent& WXUNUSED(event))
 	if (!choicebook) {
 		return;
 	}
-	std::string tilesetName = choicebook->GetPageText(choicebook->GetSelection());
+	std::string tilesetName = choicebook->GetPageText(choicebook->GetSelection()).ToStdString();
 
 	auto _it = g_materials.tilesets.find(tilesetName);
 	if (_it != g_materials.tilesets.end()) {

Compilation bugs refered commit 83b3fbb

There are some bugs in the commit 83b3fbb, preventing compilation.

palette_brushlist.cpp

Error (active) E0020 identifier "wxID_ADD_TILESET" is undefined
Error (active) E0020 identifier "wxID_ADD_TILESET" is undefined
Error (active) E0020 identifier "wxID_ADD_ITEM_TO_TILESET" is undefined
Error (active) E0020 identifier "wxID_ADD_ITEM_TO_TILESET" is undefined

Suggestion

add conversion from otservbrmap(clientid) to academymap (serverid)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.