Merge branch 'master' into Controls

Conflicts:
	planet/Objects.ocd/HUD.ocd/Controller.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Structure.ocd/Script.c
	src/gamescript/C4GameScript.cpp
	src/gui/C4GameMessage.cpp
	src/gui/C4Gui.h
	src/gui/C4GuiDialogs.cpp
	src/gui/C4GuiWindow.cpp
Controls
David Dormagen 2014-08-13 11:28:22 +02:00
commit 5722339e83
703 changed files with 12143 additions and 3107 deletions

6
.gitignore vendored
View File

@ -117,6 +117,7 @@ xcode/build
# Development files explicitely excluded
planet/nohg*
*.nohg*
# Eclipse project file
planet/.project
@ -134,8 +135,11 @@ planet/openclonk.sln
WindowsGamesExplorer.xml
# Mape
mape
./mape
mape-icons.h
tests/openclonk_unittest.sln
# Packed groups created directly in root path
/*.oc*

View File

@ -11,7 +11,7 @@
# To redistribute this file separately, substitute the full license texts
# for the above references.
cmake_minimum_required (VERSION 2.6.0)
cmake_minimum_required (VERSION 2.8.4)
project (openclonk CXX C)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
@ -48,63 +48,50 @@ CMAKE_DEPENDENT_OPTION(USE_GTK "Use GTK for the developer mode" ON "USE_X11" OFF
CMAKE_DEPENDENT_OPTION(USE_GTK3 "Use GTK3 instead of GTK2" OFF "USE_GTK" OFF)
CMAKE_DEPENDENT_OPTION(USE_COCOA "Use Apple Cocoa for the developer mode and the windows." ON "APPLE" OFF)
CMAKE_DEPENDENT_OPTION(USE_APPLE_CLANG "Use Apple Clang Compiler as C++ compiler." ON "APPLE" OFF)
if(APPLE)
SET(INITIAL_USE_OPEN_AL ON)
else()
SET(INITIAL_USE_OPEN_AL OFF)
endif()
option(USE_OPEN_AL "Use OpenAL to play sounds" ${INITIAL_USE_OPEN_AL})
option(WITH_AUTOMATIC_UPDATE "Automatic updates are downloaded from the project website." OFF)
# Remove obsolete options
unset(OC_BUILD_MULTIPROCESSOR CACHE)
############################################################################
# Check for compiler quirks and features
############################################################################
include(CheckCXXCompilerFlag)
if(CMAKE_COMPILER_IS_GNUCXX)
CHECK_CXX_COMPILER_FLAG("-std=gnu++0x" USE_GCC_STD_0X)
if(USE_GCC_STD_0X)
list(APPEND OC_CXX_FLAGS "-std=gnu++0x")
endif()
endif()
# ck 09-09-20: CMAKE_REQUIRED_FLAGS requires a string, not a list.
include(CheckCXXSourceCompiles)
foreach(FLAG ${OC_CXX_FLAGS})
set(OC_REQUIRED_FLAGS "${OC_REQUIRED_FLAGS} ${FLAG}")
endforeach()
# ck 10-09-04: Reset CMAKE_REQUIRED_FLAGS after having done the C++0x checks
# otherwise they are used for C library checks as well and the C compiler bails
# out because it does not understand -std=gnu++0x
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_FLAGS ${OC_REQUIRED_FLAGS})
include(RequireCXXSourceCompiles)
if (NOT USE_APPLE_CLANG)
REQUIRE_CXX_SOURCE_COMPILES("#include <memory>\nint main() { std::unique_ptr<int> a; std::shared_ptr<int> b; }" HAVE_C11_SMART_PTRS)
endif()
CHECK_CXX_SOURCE_COMPILES("void f(struct D&&); int main() { return 0; }" HAVE_RVALUE_REF)
CHECK_CXX_SOURCE_COMPILES("int main() { void *d = nullptr; }" HAVE_NULLPTR)
CHECK_CXX_SOURCE_COMPILES("int main() { static_assert(true, \"\"); }" HAVE_STATIC_ASSERT)
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
# g++'s libstdc++ doesn't properly support <regex> until 4.8.1 (maybe later?).
# They ship a header that declares functions, but they don't ship an
# implementation for some things (like std::regex_iterator).
# This needs to test *linking*, not compilation; cmake does both at the same
# time, so the test below works.
CHECK_CXX_SOURCE_COMPILES("#include <regex>\nint main() { std::cregex_iterator ri; }" HAVE_WORKING_REGEX)
CMAKE_DEPENDENT_OPTION(USE_BOOST_REGEX "Use Boost.Regex even if the C++ runtime has a working implementation of <regex>" OFF "HAVE_WORKING_REGEX" ON)
# We link Boost statically because that makes it easier for us to distribute
# the resulting binary. Distributions have the ability to guarantee a certain
# version of the library exists on the system though, so they may prefer
# dynamic linking.
option(USE_STATIC_BOOST "Link Boost libraries statically" ON)
# Remove obsolete options
unset(OC_BUILD_MULTIPROCESSOR CACHE)
unset(USE_APPLE_CLANG CACHE)
############################################################################
# Check for compiler quirks and features
############################################################################
include(CheckCXXCompilerFlag)
include(CheckCXXSourceCompiles)
include(RequireCXXSourceCompiles)
CHECK_CXX_COMPILER_FLAG("-std=gnu++0x" USE_GCC_STD_0X)
if(USE_GCC_STD_0X)
list(APPEND OC_CXX_FLAGS "-std=gnu++0x")
endif()
# Convert the OC_CXX_FLAGS list to a CMAKE_REQUIRED_FLAGS string
foreach(FLAG ${OC_CXX_FLAGS})
set(OC_REQUIRED_FLAGS "${OC_REQUIRED_FLAGS} ${FLAG}")
endforeach()
set(CMAKE_REQUIRED_FLAGS ${OC_REQUIRED_FLAGS})
REQUIRE_CXX_SOURCE_COMPILES("#include <memory>\nint main() { std::unique_ptr<int> a; std::shared_ptr<int> b; }" HAVE_C11_SMART_PTRS)
CHECK_CXX_SOURCE_COMPILES("void f(struct D&&); int main() { return 0; }" HAVE_RVALUE_REF)
CHECK_CXX_SOURCE_COMPILES("int main() { void *d = nullptr; }" HAVE_NULLPTR)
CHECK_CXX_SOURCE_COMPILES("int main() { static_assert(true, \"\"); }" HAVE_STATIC_ASSERT)
# g++'s libstdc++ doesn't properly support <regex> until 4.9.
# They ship a header that declares functions, but they don't ship an
# implementation for some things (like std::regex_iterator).
# This needs to test *linking*, not compilation; cmake does both at the same
# time, so the test below works.
CHECK_CXX_SOURCE_COMPILES("#include <regex>\nint main() { std::cregex_iterator ri; }" HAVE_WORKING_REGEX)
CMAKE_DEPENDENT_OPTION(USE_BOOST_REGEX "Use Boost.Regex even if the C++ runtime has a working implementation of <regex>" OFF "HAVE_WORKING_REGEX" ON)
if(MSVC_VERSION GREATER 1499)
list(APPEND OC_CXX_FLAGS /MP)
list(REMOVE_ITEM OC_CXX_FLAGS_DEBUG /Gm)
@ -409,6 +396,8 @@ set(OC_CLONK_SOURCES
src/object/C4DefList.h
src/object/C4GameObjects.cpp
src/object/C4GameObjects.h
src/object/C4Id.cpp
src/object/C4Id.h
src/object/C4IDList.cpp
src/object/C4IDList.h
src/object/C4InfoCore.cpp
@ -477,19 +466,29 @@ set(OC_CLONK_SOURCES
set(MAPE_BASE_SOURCES
src/landscape/C4MapCreatorS2.cpp
src/landscape/C4MapCreatorS2.h
src/landscape/C4MapScriptAlgo.cpp
src/landscape/C4MapScript.cpp
src/landscape/C4MapScript.h
src/landscape/C4Material.cpp
src/landscape/C4Material.h
src/landscape/C4Texture.cpp
src/landscape/C4Texture.h
src/landscape/C4Scenario.cpp
src/landscape/C4Scenario.h
src/graphics/Bitmap256.cpp
src/graphics/Bitmap256.h
src/graphics/CSurface8.cpp
src/graphics/CSurface8.h
src/lib/C4NameList.cpp
src/lib/C4NameList.h
src/lib/C4Rect.cpp
src/lib/C4Rect.h
src/object/C4Id.cpp
src/object/C4Id.h
)
set(MAPE_SOURCES
src/mape/cpp-handles/c4def-handle.cpp
src/mape/cpp-handles/group-handle.h
src/mape/cpp-handles/group-handle.cpp
src/mape/cpp-handles/log-handle.h
@ -580,33 +579,10 @@ endif()
if(WIN32)
list(APPEND OC_SYSTEM_SOURCES
src/platform/C4CrashHandlerWin32.cpp
src/res/engine.rc
src/res/resource.h
)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/res/openclonk.manifest" "${CMAKE_CURRENT_BINARY_DIR}/openclonk.manifest" COPYONLY)
if(MINGW)
# cmake does not support compiling resources with MinGW
# natively, see http://www.cmake.org/Bug/view.php?id=4068.
# cross-compiler sets CMAKE_RC_COMPILER in toolchain file
if(NOT CMAKE_RC_COMPILER)
SET(CMAKE_RC_COMPILER windres)
endif()
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/engine_rc.o
COMMAND ${CMAKE_RC_COMPILER} -I${CMAKE_CURRENT_BINARY_DIR}
-i${CMAKE_CURRENT_SOURCE_DIR}/src/res/engine.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/engine_rc.o
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/res/engine.rc)
list(APPEND OC_SYSTEM_SOURCES
${CMAKE_CURRENT_BINARY_DIR}/engine_rc.o
)
else(MINGW)
list(APPEND OC_SYSTEM_SOURCES
src/res/engine.rc
)
endif(MINGW)
endif()
# source files specific to a GUI library
@ -753,6 +729,7 @@ include_directories(
# Check for required system headers
############################################################################
include(CheckIncludeFileCXX)
include(CheckIncludeFilesCXX)
CHECK_INCLUDE_FILE_CXX(direct.h HAVE_DIRECT_H)
CHECK_INCLUDE_FILE_CXX(io.h HAVE_IO_H)
CHECK_INCLUDE_FILE_CXX(locale.h HAVE_LOCALE_H)
@ -775,50 +752,12 @@ if(USE_CONSOLE)
CHECK_INCLUDE_FILE_CXX(readline/readline.h HAVE_READLINE_READLINE_H)
endif()
CHECK_INCLUDE_FILE_CXX(natupnp.h HAVE_NATUPNP_H)
# ck 09-09-20: The following headers require Xlib.h for things such as
# 'Bool' and 'Window' to be defined. Unfortunately, this doesn't exist
# as a CXX version (yet?).
include(CheckIncludeFiles)
CHECK_INCLUDE_FILES(X11/Xlib.h X11/extensions/Xrandr.h HAVE_X11_EXTENSIONS_XRANDR_H)
CHECK_INCLUDE_FILES(X11/Xlib.h X11/keysym.h HAVE_X11_KEYSYM_H)
CHECK_INCLUDE_FILE_CXX(iconv.h HAVE_ICONV)
if(HAVE_ICONV)
SET(ICONV_CONST ON)
endif()
include(CheckSymbolExists)
CHECK_SYMBOL_EXISTS(vasprintf stdio.h HAVE_VASPRINTF)
CHECK_SYMBOL_EXISTS(__mingw_vasprintf stdio.h HAVE___MINGW_VASPRINTF)
if(HAVE_ICONV)
CHECK_SYMBOL_EXISTS(iconv iconv.h HAVE_ICONV_WO_LINK)
mark_as_advanced(HAVE_ICONV_WO_LINK)
if(NOT HAVE_ICONV_WO_LINK)
FIND_LIBRARY( ICONV_LIBRARY NAMES iconv )
MARK_AS_ADVANCED( ICONV_LIBRARY )
endif()
endif()
if(HAVE_NATUPNP_H)
list(APPEND OC_SYSTEM_SOURCES
src/network/C4Network2UPnPWin32.cpp
)
else()
FIND_PACKAGE(Upnp)
SET(HAVE_UPNP ${UPNP_FOUND})
if(UPNP_FOUND)
list(APPEND OC_SYSTEM_SOURCES
src/network/C4Network2UPnPLinux.cpp
)
else()
list(APPEND OC_SYSTEM_SOURCES
src/network/C4Network2UPnPDummy.cpp
)
endif()
if(WIN32 AND NOT HAVE_NATUPNP_H)
include_directories(thirdparty/natupnp)
set(HAVE_NATUPNP_H TRUE CACHE BOOL "natupnp.h available" FORCE)
endif()
CHECK_INCLUDE_FILES_CXX("X11/Xlib.h;X11/extensions/Xrandr.h" HAVE_X11_EXTENSIONS_XRANDR_H)
CHECK_INCLUDE_FILES_CXX("X11/Xlib.h;X11/keysym.h" HAVE_X11_KEYSYM_H)
############################################################################
# Locate necessary libraries
@ -846,8 +785,10 @@ include_directories(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
find_package("Boost" 1.40.0 REQUIRED)
include_directories(SYSTEM ${Boost_INCLUDE_DIR})
include(FindThreads)
if(NOT WIN32)
if(CMAKE_SYSTEM MATCHES "Windows")
message(STATUS "Using Win32 threading.")
else()
find_package("Threads" REQUIRED)
SET(HAVE_PTHREAD ${CMAKE_USE_PTHREADS_INIT} CACHE INTERNAL "libpthread available")
endif()
@ -868,6 +809,36 @@ macro(FINDLIB lib)
mark_as_advanced(${lib})
endmacro(FINDLIB)
include(CheckCXXSymbolExists)
check_cxx_symbol_exists(vasprintf stdio.h HAVE_VASPRINTF)
check_cxx_symbol_exists(__mingw_vasprintf stdio.h HAVE___MINGW_VASPRINTF)
if(HAVE_EXECINFO_H)
check_cxx_symbol_exists(backtrace execinfo.h HAVE_EXECINFO_WO_LINK)
mark_as_advanced(HAVE_EXECINFO_WO_LINK)
if(NOT HAVE_EXECINFO_WO_LINK)
FINDLIB(EXECINFO_LIBRARY execinfo)
endif()
endif()
if(HAVE_NATUPNP_H)
list(APPEND OC_SYSTEM_SOURCES
src/network/C4Network2UPnPWin32.cpp
)
else()
FIND_PACKAGE(Upnp)
SET(HAVE_UPNP ${UPNP_FOUND})
if(UPNP_FOUND)
list(APPEND OC_SYSTEM_SOURCES
src/network/C4Network2UPnPLinux.cpp
)
else()
list(APPEND OC_SYSTEM_SOURCES
src/network/C4Network2UPnPDummy.cpp
)
endif()
endif()
if(USE_CONSOLE)
find_package(Readline)
include_directories(${READLINE_INCLUDE_DIRS})
@ -883,7 +854,7 @@ if(USE_GTK)
include_directories(${GTK3_INCLUDE_DIRS})
link_directories(${GTK3_LIBRARY_DIRS})
else()
pkg_check_modules(GTK REQUIRED "glib-2.0 >= 2.24" "gtk+-2.0 >= 2.20")
pkg_check_modules(GTK REQUIRED "glib-2.0 >= 2.28" "gtk+-2.0 >= 2.20")
include_directories(${GTK_INCLUDE_DIRS})
link_directories(${GTK_LIBRARY_DIRS})
endif()
@ -895,7 +866,7 @@ if (PKG_CONFIG_FOUND)
if (USE_GTK3)
pkg_check_modules(MAPE_GTK glib-2.0>=2.32 gthread-2.0 gtk+-3.0>=3.4 gtksourceview-3.0)
else()
pkg_check_modules(MAPE_GTK glib-2.0>=2.24 gthread-2.0 gtk+-2.0>=2.20 gtksourceview-2.0)
pkg_check_modules(MAPE_GTK glib-2.0>=2.28 gthread-2.0 gtk+-2.0>=2.20 gtksourceview-2.0)
endif()
endif()
if(MAPE_GTK_FOUND)
@ -904,21 +875,8 @@ if(MAPE_GTK_FOUND)
link_directories(${MAPE_GTK_LIBRARY_DIRS})
endif()
if(USE_OPEN_AL)
if(MSVC)
if(${FIND_LIBRARY_USE_LIB64_PATHS})
FINDLIB(OPENAL_LIBRARY NAMES OpenAL64)
else()
FINDLIB(OPENAL_LIBRARY NAMES OpenAL32)
endif()
endif()
FINDLIB(OGG_LIBRARY NAMES libogg_static libogg ogg)
FINDLIB(VORBIS_LIBRARY NAMES libvorbis_static libvorbis vorbis)
FINDLIB(VORBISFILE_LIBRARY NAMES libvorbisfile_static libvorbisfile vorbisfile)
if(NOT APPLE)
FINDLIB(ALUT_LIBRARY NAMES alut_static alut)
endif()
endif()
# Select an audio library
find_package("Audio")
############################################################################
# Precompiled header support, part 1 (pre-target)
@ -1004,9 +962,6 @@ add_executable(c4group
)
add_executable(netpuncher EXCLUDE_FROM_ALL
src/platform/StdScheduler.cpp
src/platform/StdSchedulerWin32.cpp
src/platform/StdSchedulerPoll.cpp
src/netpuncher/main.cpp
)
@ -1062,8 +1017,6 @@ src/lib/C4Real.cpp
src/lib/C4Real.h
src/lib/C4Random.cpp
src/lib/C4Random.h
src/object/C4Id.cpp
src/object/C4Id.h
src/script/C4Aul.cpp
src/script/C4AulDefFunc.h
src/script/C4AulExec.cpp
@ -1098,19 +1051,14 @@ target_link_libraries(openclonk
${FREETYPE_LIBRARIES}
${PNG_LIBRARIES}
${JPEG_LIBRARIES}
${ICONV_LIBRARY}
${EXECINFO_LIBRARY}
libc4script
libmisc
)
if(USE_OPEN_AL)
target_link_libraries(openclonk
${OPENAL_LIBRARY}
${ALUT_LIBRARY}
${VORBIS_LIBRARY}
${VORBISFILE_LIBRARY}
${OGG_LIBRARY}
)
if(Audio_FOUND)
target_link_libraries(openclonk ${Audio_LIBRARIES})
include_directories(${Audio_INCLUDE_DIRS})
endif()
if(MAPE_GTK_FOUND)
@ -1192,6 +1140,12 @@ if(MSVC)
set_property(TARGET openclonk APPEND PROPERTY LINK_FLAGS "/MANIFEST:NO")
endif()
# Suppress the console window for mape even though only a main() and not
# a WinMain() entry point is provided.
if(MINGW)
set_target_properties(mape PROPERTIES LINK_FLAGS -mwindows)
endif()
############################################################################
# Precompiled header support, part 2 (post-target)
############################################################################
@ -1305,6 +1259,15 @@ endif()
CHECK_INCLUDE_FILE_CXX(getopt.h HAVE_GETOPT_H)
find_package(ICONV)
if(ICONV_FOUND)
set(HAVE_ICONV true)
target_link_libraries(openclonk ${ICONV_LIBRARIES})
if(ICONV_IS_CONST)
set(ICONV_CONST "const")
endif()
endif()
# TinyXML
add_subdirectory(thirdparty/tinyxml)
target_link_libraries(openclonk tinyxml)
@ -1353,8 +1316,7 @@ if(USE_X11)
)
endif()
if(USE_COCOA)
#stupid fix: just link to iconv that way
TARGET_LINK_LIBRARIES(openclonk "-framework Cocoa -framework AppKit -framework Quartz -framework OpenAL -framework AudioToolBox -liconv")
TARGET_LINK_LIBRARIES(openclonk "-framework Cocoa -framework AppKit -framework Quartz")
endif()
if (WIN32)
# CMake is too incompetent to check whether these libraries can be linked to
@ -1376,36 +1338,6 @@ if (WIN32)
if(MAPE_GTK_FOUND)
target_link_libraries(mape winmm)
endif()
if(NOT USE_OPEN_AL)
find_package(FMod)
if(FMOD_FOUND)
set(HAVE_FMOD TRUE)
target_link_libraries(openclonk
${FMOD_LIBRARIES}
)
include_directories(${FMOD_INCLUDE_DIR})
else()
set(HAVE_FMOD FALSE)
endif()
endif()
else()
SET(HAVE_FMOD FALSE)
endif()
if(NOT HAVE_FMOD AND NOT USE_OPEN_AL OR USE_SDL_MAINLOOP AND NOT USE_OPEN_AL)
include(FindSDL)
SET(HAVE_SDL ${SDL_FOUND})
if(SDL_FOUND)
include_directories(${SDL_INCLUDE_DIR})
FINDLIB(SDLMIXER_LIBRARIES SDL_mixer)
if(SDLMIXER_LIBRARIES)
SET(HAVE_LIBSDL_MIXER ON)
endif()
target_link_libraries(openclonk
${SDL_LIBRARY}
${SDLMIXER_LIBRARIES}
)
endif()
endif()
if(HAVE_UPNP)
@ -1440,7 +1372,7 @@ endif()
if(CMAKE_COMPILER_IS_GNUCXX)
include(GccPchSupport)
option(USE_GCC_PCH "Use GCC precompiled headers" ON)
option(USE_GCC_PCH "Use GCC precompiled headers" OFF)
endif()
if(USE_GCC_PCH)
add_precompiled_header(libmisc src/C4Include.h)
@ -1512,6 +1444,7 @@ set(OC_C4GROUPS
Sound.ocg
System.ocg
Objects.ocd
Decoration.ocd
Arena.ocf
Parkour.ocf
Missions.ocf
@ -1519,14 +1452,12 @@ set(OC_C4GROUPS
Worlds.ocf
)
get_target_property(C4GROUP_LOCATION c4group LOCATION)
get_target_property(CLONK_LOCATION openclonk LOCATION)
foreach(group ${OC_C4GROUPS})
if (APPLE)
if (CMAKE_GENERATOR STREQUAL Xcode)
add_custom_command(TARGET openclonk
POST_BUILD COMMAND "/bin/sh" "${CMAKE_CURRENT_SOURCE_DIR}/tools/osx_pack_gamedata.sh"
"${C4GROUP_LOCATION}"
"$<TARGET_FILE:c4group>"
"${CMAKE_CURRENT_SOURCE_DIR}/planet/${group}"
# leave out third parameter here so the script can figure out Xcode-ish paths as usual
DEPENDS c4group
@ -1534,7 +1465,7 @@ foreach(group ${OC_C4GROUPS})
else()
add_custom_command(TARGET openclonk
POST_BUILD COMMAND "/bin/sh" "${CMAKE_CURRENT_SOURCE_DIR}/tools/osx_pack_gamedata.sh"
"${C4GROUP_LOCATION}"
"$<TARGET_FILE:c4group>"
"${CMAKE_CURRENT_SOURCE_DIR}/planet/${group}"
"${CMAKE_CURRENT_BINARY_DIR}/openclonk.app/Contents/Resources"
DEPENDS c4group
@ -1560,8 +1491,8 @@ if (NOT APPLE)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/openclonk.desktop DESTINATION share/applications)
# Install binaries
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/openclonk DESTINATION games/)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/c4group DESTINATION bin/)
install(TARGETS openclonk DESTINATION games)
install(TARGETS c4group DESTINATION bin)
else()
install(TARGETS openclonk
BUNDLE DESTINATION .
@ -1577,12 +1508,9 @@ endif()
find_program(MAKENSIS makensis PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS])
string(REPLACE / \\ C4GROUP_LOCATION ${C4GROUP_LOCATION})
string(REPLACE / \\ CLONK_LOCATION ${CLONK_LOCATION})
add_custom_command(
OUTPUT setup_openclonk.exe
COMMAND ${MAKENSIS} -NOCD -DSRCDIR=${CMAKE_CURRENT_SOURCE_DIR} -DPROGRAMFILES=$PROGRAMFILES "-DPRODUCT_NAME=${C4ENGINENAME}${C4VERSIONBUILDNAME}" "-DPRODUCT_COMPANY=${C4PROJECT}" "-DCLONK=${CLONK_LOCATION}" "-DC4GROUP=${C4GROUP_LOCATION}" ${CMAKE_CURRENT_SOURCE_DIR}/tools/install/oc.nsi "-XOutFile setup_openclonk.exe"
COMMAND ${MAKENSIS} -NOCD -DSRCDIR=${CMAKE_CURRENT_SOURCE_DIR} -DPROGRAMFILES=$PROGRAMFILES "-DPRODUCT_NAME=${C4ENGINENAME}${C4VERSIONBUILDNAME}" "-DPRODUCT_COMPANY=${C4PROJECT}" "-DCLONK=$<TARGET_FILE_DIR:openclonk>\\$<TARGET_FILE_NAME:openclonk>" "-DC4GROUP=$<TARGET_FILE_DIR:c4group>\\$<TARGET_FILE_NAME:c4group>" ${CMAKE_CURRENT_SOURCE_DIR}/tools/install/oc.nsi "-XOutFile setup_openclonk.exe"
MAIN_DEPENDENCY
${CMAKE_CURRENT_SOURCE_DIR}/tools/install/oc.nsi
DEPENDS

21
README
View File

@ -15,7 +15,7 @@ Additionally, OpenClonk depends on a number of third-party libraries:
- libjpeg-turbo (http://sourceforge.net/projects/libjpeg-turbo/files/)
- FreeType (http://www.freetype.org/)
- The OpenGL Extension Wrangler Library (http://glew.sourceforge.net/)
- FreeALUT (https://github.com/openclonk/freealut)
- FreeALUT (https://github.com/vancegroup/freealut)
- libogg and libvorbis (https://www.xiph.org/downloads/)
- Boost (http://www.boost.org/users/download/)
@ -32,17 +32,18 @@ Linux Specific
==============
For building OpenClonk on Linux, you need the following libraries in addition
to the ones listed above:
- libxpm
- libGL
- GTK+ 2.0 or 3.0 (http://www.gtk.org)
- libGL (http://www.mesa3d.org/)
- SDL 1.2 (http://www.libsdl.org/download-1.2.php)
- SDL_mixer 1.2 (http://www.libsdl.org/projects/SDL_mixer/release-1.2.html)
- libupnp
- libxrandr
Most distributions should provide these dependencies via their packaging
system. For Debian based distributions, you will need these packages:
build-essential cmake libx11-dev libxxf86vm-dev libxrandr-dev libxpm-dev
libglew-dev libgl1-mesa-dev libpng12-dev libsdl1.2-dev
libsdl-mixer1.2-dev libgtk2.0-dev libjpeg8-dev zlib1g-dev libboost-dev
(This list was compiled on Debian 7.0 "Wheezy". More recent distributions may
provide packages with a higher version number.)
build-essential cmake imagemagick libboost-dev libboost-regex-dev
libfreetype6-dev libgl1-mesa-dev libglew-dev libgtk2.0-dev libjpeg-dev
libpng-dev libsdl1.2-dev libsdl-mixer1.2-dev libupnp-dev libxrandr-dev
x11proto-core-dev zlib1g-dev
Windows Specific
================
@ -50,6 +51,4 @@ In addition to the libraries above, you will need one more if you want to
target Windows:
- OpenAL Soft (http://kcat.strangesoft.net/openal.html)
To create an installer, you will also need the Nullsoft Install System
(http://nsis.sourceforge.net/). makensis needs to be in the PATH, and
the DLLs used by openclonk must be in the build directory. To create the
installer, build the "setup" target.
(http://nsis.sourceforge.net/). To create the installer, build the "setup" target.

View File

@ -0,0 +1,101 @@
# - Check if the files can be included
#
# CHECK_INCLUDE_FILES_CXX(INCLUDE VARIABLE)
#
# INCLUDE - list of files to include
# VARIABLE - variable to return result
#
# The following variables may be set before calling this macro to
# modify the way the check is run:
#
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_INCLUDES = list of include directories
#=============================================================================
# Copyright 2003-2012 Kitware, Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the names of Kitware, Inc., the Insight Software Consortium,
# nor the names of their contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
macro(CHECK_INCLUDE_FILES_CXX INCLUDE VARIABLE)
if("${VARIABLE}" MATCHES "^${VARIABLE}$")
set(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
if(CMAKE_REQUIRED_INCLUDES)
set(CHECK_INCLUDE_FILES_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
else()
set(CHECK_INCLUDE_FILES_INCLUDE_DIRS)
endif()
set(CHECK_INCLUDE_FILES_CONTENT "/* */\n")
set(MACRO_CHECK_INCLUDE_FILES_FLAGS ${CMAKE_REQUIRED_FLAGS})
foreach(FILE ${INCLUDE})
set(CMAKE_CONFIGURABLE_FILE_CONTENT
"${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n")
endforeach()
set(CMAKE_CONFIGURABLE_FILE_CONTENT
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\n\nint main(){return 0;}\n")
configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.cxx" @ONLY IMMEDIATE)
set(_INCLUDE ${INCLUDE}) # remove empty elements
if("${_INCLUDE}" MATCHES "^([^;]+);.+;([^;]+)$")
list(LENGTH _INCLUDE _INCLUDE_LEN)
set(_description "${_INCLUDE_LEN} C++ include files ${CMAKE_MATCH_1}, ..., ${CMAKE_MATCH_2}")
elseif("${_INCLUDE}" MATCHES "^([^;]+);([^;]+)$")
set(_description "C++ include files ${CMAKE_MATCH_1}, ${CMAKE_MATCH_2}")
else()
set(_description "C++ include file ${_INCLUDE}")
endif()
message(STATUS "Looking for ${_description}")
try_compile(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.cxx
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILES_FLAGS}
"${CHECK_INCLUDE_FILES_INCLUDE_DIRS}"
OUTPUT_VARIABLE OUTPUT)
if(${VARIABLE})
message(STATUS "Looking for ${_description} - found")
set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if C++ files ${INCLUDE} "
"exist passed with the following output:\n"
"${OUTPUT}\n\n")
else()
message(STATUS "Looking for ${_description} - not found")
set(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if C++ files ${INCLUDE} "
"exist failed with the following output:\n"
"${OUTPUT}\nSource:\n${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
endif()
endif()
endmacro()

View File

@ -0,0 +1,143 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2009-2014, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.
#
# "Clonk" is a registered trademark of Matthes Bender, used with permission.
# See accompanying file "TRADEMARK" for details.
#
# To redistribute this file separately, substitute the full license texts
# for the above references.
# This module chooses an audio provider for use in OpenClonk.
macro(__FINDAUDIO_FINDOPENAL)
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(OpenAL "openal>=1.15.1")
pkg_check_modules(Alut "freealut>=1.1.0")
pkg_check_modules(OggVorbis "vorbisfile>=1.3.2" "vorbis>=1.3.2" "ogg>=1.3.0")
else()
if(MSVC OR APPLE)
find_path(OpenAL_INCLUDE_DIRS al.h PATH_SUFFIXES include/AL include/OpenAL include)
find_path(Vorbis_INCLUDE_DIRS vorbis/codec.h vorbis/vorbisfile.h PATH_SUFFIXES include)
find_library(Ogg_LIBRARY NAMES libogg_static libogg ogg)
find_library(Vorbis_LIBRARY NAMES libvorbis_static libvorbis vorbis)
find_library(Vorbisfile_LIBRARY NAMES libvorbisfile_static libvorbisfile vorbisfile)
if(OpenAL_INCLUDE_DIRS)
set(OpenAL_FOUND TRUE)
endif()
if(Vorbis_INCLUDE_DIRS AND Ogg_LIBRARY AND Vorbis_LIBRARY AND Vorbisfile_LIBRARY)
set(OggVorbis_FOUND TRUE)
set(OggVorbis_LIBRARIES ${Vorbisfile_LIBRARY} ${Vorbis_LIBRARY} ${Ogg_LIBRARY})
set(OggVorbis_INCLUDE_DIRS(${Vorbis_INCLUDE_DIRS}))
endif()
endif()
if(MSVC)
find_path(Alut_INCLUDE_DIRS alut.h PATH_SUFFIXES include/AL include/OpenAL include)
find_library(Alut_LIBRARY NAMES alut_static alut)
if(${FIND_LIBRARY_USE_LIB64_PATHS})
find_library(OpenAL_LIBRARY NAMES OpenAL64)
else()
find_library(OpenAL_LIBRARY NAMES OpenAL32)
endif()
if(NOT OpenAL_LIBRARY)
set(OpenAL_FOUND FALSE)
endif()
if(Alut_INCLUDE_DIRS AND Alut_LIBRARY)
set(Alut_FOUND TRUE)
set(Alut_LIBRARIES ${Alut_LIBRARY})
endif()
endif()
endif()
endmacro()
macro(__FINDAUDIO_FINDSDLMIXER)
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(SDLMixer "SDL_mixer>=1.2.12")
endif()
endmacro()
if(Audio_TK)
# Already chosen, don't do anything
elseif(USE_CONSOLE)
# Dedicated servers don't need audio output
set(Audio_TK "none")
set(Audio_FOUND TRUE)
else()
# Test for OpenAL
__FINDAUDIO_FINDOPENAL()
__FINDAUDIO_FINDSDLMIXER()
find_package("FMod")
if(OpenAL_FOUND AND (APPLE OR Alut_FOUND) AND OggVorbis_FOUND)
# Prefer OpenAL
set(Audio_TK "OpenAL")
elseif(SDLMixer_FOUND)
set(Audio_TK "SDL_Mixer")
elseif(FMOD_FOUND)
set(Audio_TK "FMod")
endif()
endif()
# Search for the libraries again. If the provider was selected automatically, this will be
# answered from cache; otherwise (because the user manually selected a provider) it will
# make sure the provider is available.
if(Audio_TK STREQUAL "OpenAL")
__FINDAUDIO_FINDOPENAL()
if(OpenAL_FOUND AND (APPLE OR Alut_FOUND) AND OggVorbis_FOUND)
set(Audio_FOUND TRUE)
set(Audio_LIBRARIES ${OpenAL_LIBRARIES} ${OggVorbis_LIBRARIES})
set(Audio_INCLUDE_DIRS ${OpenAL_INCLUDE_DIRS} ${OggVorbis_INCLUDE_DIRS})
if (NOT APPLE)
# Apple doesn't need freealut
set(Audio_LIBRARIES ${Audio_LIBRARIES} ${Alut_LIBRARIES})
set(Audio_INCLUDE_DIRS ${Audio_INCLUDE_DIRS} ${Alut_INCLUDE_DIRS})
else()
# but it uses the AudioToolBox framework
set(Audio_LIBRARIES ${Audio_LIBRARIES} "-framework OpenAL -framework AudioToolBox")
endif()
endif()
elseif(Audio_TK STREQUAL "SDL_Mixer")
__FINDAUDIO_FINDSDLMIXER()
if(SDLMixer_FOUND)
set(Audio_FOUND TRUE)
set(Audio_LIBRARIES ${SDLMixer_LIBRARIES})
set(Audio_INCLUDE_DIRS ${SDLMixer_INCLUDE_DIRS})
endif()
elseif(Audio_TK STREQUAL "FMod")
find_package("FMod")
if(FMOD_FOUND)
set(Audio_FOUND TRUE)
set(Audio_LIBRARIES ${FMOD_LIBRARIES})
set(Audio_INCLUDE_DIRS ${FMOD_INCLUDE_DIR})
endif()
elseif(Audio_TK STREQUAL "none")
set(Audio_FOUND TRUE)
set(Audio_LIBRARIES "")
set(Audio_INCLUDE_DIRS "")
endif()
if(Audio_FOUND)
string(TOUPPER "${Audio_TK}" Audio_TK_UPPER)
if(NOT Audio_FIND_QUIETLY)
message(STATUS "Using Audio toolkit: ${Audio_TK}")
endif()
elseif(Audio_TK)
message(FATAL_ERROR "User-requested audio provider not available.")
else()
set(Audio_FOUND FALSE)
set(Audio_TK "none")
string(TOUPPER "${Audio_TK}" Audio_TK_UPPER)
set(Audio_LIBRARIES "")
set(Audio_INCLUDE_DIRS "")
if(Audio_FIND_REQUIRED)
message(FATAL_ERROR "No audio provider was found")
else()
message(STATUS "Not enabling audio output.")
endif()
endif()

View File

@ -0,0 +1,62 @@
# - Try to find Iconv
# Once done this will define
#
# ICONV_FOUND - system has Iconv
# ICONV_INCLUDE_DIR - the Iconv include directory
# ICONV_LIBRARIES - Link these to use Iconv
# ICONV_IS_CONST - the second argument for iconv() is const
#
# This was mostly borrowed from Strigi. LyX also has a (quite
# different) FindICONV: the one in LyX does not check
# second_argument_is_const, but seems to have more fleshed-out support
# for WIN32. There may need to be some merging done.
# Tim Holy, 2008-05-07
include(CheckCXXSourceCompiles)
IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
# Already in cache, be silent
SET(ICONV_FIND_QUIETLY TRUE)
ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
FIND_PATH(ICONV_INCLUDE_DIR iconv.h
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/iconv.h
/Developer/SDKs/MacOSX10.5.sdk/usr/include/iconv.h
/usr/include
)
FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv libiconv2 c
PATHS
/Developer/SDKs/MacOSX10.4u.sdk/usr/lib
/Developer/SDKs/MacOSX10.5.sdk/usr/lib
/usr/lib
)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ICONV REQUIRED_VARS ICONV_LIBRARIES ICONV_INCLUDE_DIR)
IF(ICONV_FOUND)
set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
check_cxx_source_compiles("
#include <iconv.h>
int main(){
iconv_t conv = 0;
const char* in = 0;
size_t ilen = 0;
char* out = 0;
size_t olen = 0;
iconv(conv, &in, &ilen, &out, &olen);
return 0;
}
" ICONV_IS_CONST )
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_LIBRARIES)
ENDIF(ICONV_FOUND)
MARK_AS_ADVANCED(
ICONV_INCLUDE_DIR
ICONV_LIBRARIES
ICONV_IS_CONST
)

View File

@ -1,6 +1,3 @@
/* Activate DebugRecs */
#cmakedefine DEBUGREC 1
/* Generate minidumps on crash */
#cmakedefine HAVE_DBGHELP 1
@ -10,9 +7,6 @@
/* The backtrace function is declared in execinfo.h and works */
#cmakedefine HAVE_EXECINFO_H 1
/* Whether FMOD shall be used */
#cmakedefine HAVE_FMOD 1
/* Define to 1 if you have the <history.h> header file. */
#cmakedefine HAVE_HISTORY_H 1
@ -31,9 +25,6 @@
/* Define if you have a readline compatible library */
#cmakedefine HAVE_LIBREADLINE 1
/* Define to 1 if you have SDL_mixer. */
#cmakedefine HAVE_LIBSDL_MIXER 1
/* Define to 1 if you have the <locale.h> header file. */
#cmakedefine HAVE_LOCALE_H 1
@ -127,7 +118,7 @@
#cmakedefine HAVE_X11_KEYSYM_H 1
/* Define as const if the declaration of iconv() needs const. */
#cmakedefine ICONV_CONST
#define ICONV_CONST @ICONV_CONST@
/* compile without debug options */
#cmakedefine NDEBUG 1
@ -163,9 +154,6 @@
/* MP3 music */
#cmakedefine USE_MP3 1
/* OpenAL sound */
#cmakedefine USE_OPEN_AL 1
/* Define to 1 if SDL is used for the main loop */
#cmakedefine USE_SDL_MAINLOOP 1
@ -195,3 +183,10 @@
/* Use Apple Cocoa for the UI */
#cmakedefine USE_COCOA 1
/* Select an audio provider */
#define AUDIO_TK_NONE 0
#define AUDIO_TK_OPENAL 1
#define AUDIO_TK_FMOD 2
#define AUDIO_TK_SDL_MIXER 3
#define AUDIO_TK AUDIO_TK_${Audio_TK_UPPER}

View File

@ -2733,16 +2733,16 @@ msgstr "Der Wind bläst immer in die Richtung in die die Kanone geschoben wird."
#: sdk/script/fn/GetPlayerControlAssignment.xml:8(category)
#: sdk/script/fn/GetPlayerByName.xml:8(category)
#: sdk/script/fn/GetPlayerByIndex.xml:8(category)
#: sdk/script/fn/GetHomebaseProduction.xml:8(category)
#: sdk/script/fn/GetHomebaseMaterial.xml:8(category)
#: sdk/script/fn/GetBaseProduction.xml:8(category)
#: sdk/script/fn/GetBaseMaterial.xml:8(category)
#: sdk/script/fn/GetHiRank.xml:17(desc)
#: sdk/script/fn/GetCrewExtraData.xml:8(category)
#: sdk/script/fn/GetBase.xml:8(category)
#: sdk/script/fn/EliminatePlayer.xml:8(category)
#: sdk/script/fn/DoWealth.xml:8(category)
#: sdk/script/fn/DoPlayerScore.xml:8(category)
#: sdk/script/fn/DoHomebaseProduction.xml:8(category)
#: sdk/script/fn/DoHomebaseMaterial.xml:8(category)
#: sdk/script/fn/DoBaseProduction.xml:8(category)
#: sdk/script/fn/DoBaseMaterial.xml:8(category)
#: sdk/script/fn/CreateScriptPlayer.xml:8(category)
msgid "Player"
msgstr "Spieler"
@ -7043,49 +7043,49 @@ msgstr "Gibt die ID des aufrufenden Objekts zurück."
msgid "Creates a duplicate of the calling object."
msgstr "Erstellt ein Duplikat des aufrufenden Objekts."
#: sdk/script/fn/GetHomebaseProduction.xml:16(desc)
#: sdk/script/fn/GetBaseProduction.xml:16(desc)
msgid "Number of the player whose buying options you want to determine. The first player has the player number 0."
msgstr "Die Nummer des Spielers, dessen Kaufmöglichkeiten abgefragt werden sollen. Der erste Spieler hat die Nummer 0."
#: sdk/script/fn/GetHomebaseProduction.xml:21(desc)
#: sdk/script/fn/GetBaseProduction.xml:21(desc)
msgid "If specified, the function returns the number of objects of the given type which are resupplied to the player's home base. In this case index and category are ignored."
msgstr "Wenn angegeben, gibt die Funktion die Menge der Objekte zurück, die in der Heimatbasis des Spielers nachgeliefert wird. index und category werden hierbei ignoriert."
#: sdk/script/fn/GetHomebaseProduction.xml:27(desc)
#: sdk/script/fn/GetHomebaseMaterial.xml:27(desc)
#: sdk/script/fn/GetBaseProduction.xml:27(desc)
#: sdk/script/fn/GetBaseMaterial.xml:27(desc)
msgid "List index of the buyable item to check."
msgstr "Der Index der gesuchten Kaufmöglichkeit."
#: sdk/script/fn/GetHomebaseProduction.xml:33(desc)
#: sdk/script/fn/GetHomebaseMaterial.xml:33(desc)
#: sdk/script/fn/GetBaseProduction.xml:33(desc)
#: sdk/script/fn/GetBaseMaterial.xml:33(desc)
msgid "Category of buyable items you want to check."
msgstr "Die Kategorie der gesuchten Kaufmöglichkeit."
#: sdk/script/fn/GetHomebaseProduction.xml:38(desc)
#: sdk/script/fn/GetBaseProduction.xml:38(desc)
msgid "With id specified, the function returns how quickly objects of that type are resupplied to the player's home base. In this case index and category are ignored. If id is not specified, the function returns the id of the indicated type of objects of the specified category in the player's resupply list. This will return all object types from the resupply list, even if they are currently not being resupplied."
msgstr "Bei angegebenen id gibt die Funktion zurück, wie schnell die Menge der Objekte in der Heimatbasis des Spielers nachgeliefert wird. index und category werden hierbei ignoriert. Wird id nicht angegeben, liefert die Funktion den indizierten Objekttyp der entsprechenden Kategorie der nachgelieferten Objekte des Spielers. Der Objekttyp (id) taucht in der Liste auf und wird zurückgeliefert, selbst wenn zur Zeit keine Objekte dieses Typs nachgeliefert werden."
#: sdk/script/fn/GetHomebaseProduction.xml:42(text)
#: sdk/script/fn/GetBaseProduction.xml:42(text)
msgid "Gives a flintstone to the selected clonk of the first player if currently no flintstones are resupplied to the player's home base."
msgstr "Gibt dem ausgewählten Clonk des ersten Spielers einen Feuerstein, wenn in seiner Heimatbasis keine Feuersteine nachgeliefert werden."
#: sdk/script/fn/GetHomebaseMaterial.xml:16(desc)
#: sdk/script/fn/GetBaseMaterial.xml:16(desc)
msgid "Number of the player whose buying options to determine."
msgstr "Die Nummer des Spieler, dessen Kaufmöglichkeiten abgefragt werden sollen. Der erste Spieler hat die Nummer 0."
#: sdk/script/fn/GetHomebaseMaterial.xml:21(desc)
#: sdk/script/fn/GetBaseMaterial.xml:21(desc)
msgid "If specified, the function returns the number of objects of the given type which the player can buy at his home base. In this case index and category are ignored."
msgstr "Wenn angegeben, gibt die Funktion die Menge der Objekte zurück, die der Spieler in seiner Heimatbasis kaufen kann. index und category werden hierbei ignoriert."
#: sdk/script/fn/GetHomebaseMaterial.xml:38(desc)
#: sdk/script/fn/GetBaseMaterial.xml:38(desc)
msgid "With id specified, the function returns the number of objects of that type which the player can buy at his home base. In this case index and category are ignored. If id is not specified, the function returns the id of the indicated type of objects of the specified category buyable at the players home base. This will return object types which are generally buyable, even if currently no object of that type is available."
msgstr "Bei angegebenen id gibt die Funktion die Menge der Objekte zurück, die der Spieler in seiner Heimatbasis kaufen kann. index und category werden hierbei ignoriert. Wird id nicht angegeben, liefert die Funktion den indizierten Objekttyp der entsprechenden Kategorie der kaufbaren Objekte des Spielers. Der Objekttyp (id) taucht in der Liste auf und wird zurückgeliefert, selbst wenn zur Zeit keine Objekte dieses Typs verfügbar sind."
#: sdk/script/fn/GetHomebaseMaterial.xml:42(text)
#: sdk/script/fn/GetBaseMaterial.xml:42(text)
msgid "Returns the number of fire stones the first player can buy."
msgstr "Meldet die Anzahl Feuersteine, die sich der Erste Spieler kaufen kann (sofern er das benötigte Geld hat)"
#: sdk/script/fn/GetHomebaseMaterial.xml:45(text)
#: sdk/script/fn/GetBaseMaterial.xml:45(text)
msgid "Gives the notice \"The third buyable vehicle of this player is a ...\""
msgstr "Gibt die Nachricht \"The third buyable vehicle of this player is a ...\" aus"
@ -8503,43 +8503,43 @@ msgstr "Verändert den Punktewert eines Spielers."
msgid "Deducts 100 points from this player."
msgstr "Zieht dem Spieler 100 Punkte ab."
#: sdk/script/fn/DoHomebaseProduction.xml:16(desc)
#: sdk/script/fn/DoBaseProduction.xml:16(desc)
msgid "Number of the player whose home base resupply list you want to change."
msgstr "Spielernummer des Spielers, dessen Heimatbasismaterial-Nachlieferung verändert werden soll"
#: sdk/script/fn/DoHomebaseProduction.xml:21(desc)
#: sdk/script/fn/DoBaseProduction.xml:21(desc)
msgid "id of the object type you want to adjust."
msgstr "ID des Objekttyps, der schneller oder langsamer nachgeliefert werden soll."
#: sdk/script/fn/DoHomebaseProduction.xml:26(desc)
#: sdk/script/fn/DoBaseProduction.xml:26(desc)
msgid "Change of the resupply value (positive or negative)."
msgstr "Positive oder negative Veränderung der nachgelieferten Objektmenge"
#: sdk/script/fn/DoHomebaseProduction.xml:30(desc)
#: sdk/script/fn/DoBaseProduction.xml:30(desc)
msgid "Changes resupply speed of buyable objects at the home base."
msgstr "Verändert die Nachlieferung von kaufbaren Objekten in der Heimatbasis."
#: sdk/script/fn/DoHomebaseProduction.xml:34(text)
#: sdk/script/fn/DoBaseProduction.xml:34(text)
msgid "No more flintstones are resupplied for the first player."
msgstr "Feuersteine werden für den ersten Spieler nicht mehr nachgeliefert."
#: sdk/script/fn/DoHomebaseMaterial.xml:16(desc)
#: sdk/script/fn/DoBaseMaterial.xml:16(desc)
msgid "Number of the player whose home base material you want to change."
msgstr "Spielernummer des Spielers, dessen Heimatbasismaterial verändert werden soll"
#: sdk/script/fn/DoHomebaseMaterial.xml:21(desc)
#: sdk/script/fn/DoBaseMaterial.xml:21(desc)
msgid "id of the buyable object type you want to adjust."
msgstr "ID des Objekttyps, der mehr oder weniger oft kaufbar sein soll"
#: sdk/script/fn/DoHomebaseMaterial.xml:26(desc)
#: sdk/script/fn/DoBaseMaterial.xml:26(desc)
msgid "Change of the available amount (positive or negative)."
msgstr "Positive oder negative Veränderung der kaufbaren Objektmenge"
#: sdk/script/fn/DoHomebaseMaterial.xml:30(desc)
#: sdk/script/fn/DoBaseMaterial.xml:30(desc)
msgid "Changes availability of buyable objects at the home base."
msgstr "Verändert die Kaufbarkeit von Objekten in der Heimatbasis."
#: sdk/script/fn/DoHomebaseMaterial.xml:34(text)
#: sdk/script/fn/DoBaseMaterial.xml:34(text)
msgid "The player can now buy one flint more."
msgstr "Der Spieler kann sich jetzt einen Flint mehr kaufen."
@ -18652,8 +18652,8 @@ msgstr "Dieses Kommandozeilen-Programm dient zum Bearbeiten von Gruppendateien.
#~ msgid "BaseImage"
#~ msgstr "BaseImage"
#~ msgid "HomeBaseMaterial"
#~ msgstr "HomeBaseMaterial"
#~ msgid "BaseMaterial"
#~ msgstr "BaseMaterial"
#~ msgid "Vegetation"
#~ msgstr "Vegetation"
@ -18883,8 +18883,8 @@ msgstr "Dieses Kommandozeilen-Programm dient zum Bearbeiten von Gruppendateien.
#~ msgid "CorrosionRate"
#~ msgstr "CorrosionRate"
#~ msgid "HomeBaseProduction"
#~ msgstr "HomeBaseProduction"
#~ msgid "BaseProduction"
#~ msgstr "BaseProduction"
#~ msgid "Activate"
#~ msgstr "Activate"

View File

@ -134,6 +134,11 @@ Stand = {
<col><code>Plane</code></col>
<col>int</col>
<col>The Object's minor Z-Position. Negative values are behind the landscape, positive values before it. Use 1-399 for stuff behind Clonks, 401-999 for stuff before Clonks, and 1000+ for GUI objects.</col>
</row>
<row id="SolidMaskPlane">
<col><code>SolidMaskPlane</code></col>
<col>int</col>
<col>If the object moves and other objects are attached to its SolidMask, only objects in front of this plane are moved along with it. Defaults to Plane if zero.</col>
</row>
<row>
<literal_col>Placement</literal_col>

View File

@ -82,6 +82,16 @@
<literal_col>Put</literal_col>
<col></col>
<col>When the object puts another object into a container.</col>
</row>
<row id="DigOutObject">
<literal_col>DigOutObject</literal_col>
<col>object obj</col>
<col>When the object dug out another object that was stucked in solid material.</col>
</row>
<row id="DugOut">
<literal_col>DugOut</literal_col>
<col>object object_by</col>
<col>When the object was spawned from dug out material. The object might get removed afterwards if the material has Dig2ObjectCollect=2.</col>
</row>
<row id="Damage">
<literal_col>Damage</literal_col>
@ -449,6 +459,11 @@ func SaveScenarioObject(props)
<col>0</col>
<col>Object drawing mode (see <funclink>GetObjectBlitMode</funclink> and <funclink>SetObjectBlitMode</funclink>)</col>
</row>
<row id="defprops_MeshMaterial">
<literal_col>MeshMaterial</literal_col>
<col>GetID()->GetMeshMaterial()</col>
<col>Custom assignments of mesh materials (see <funclink>GetMeshMaterial</funclink> and <funclink>SetMeshMaterial</funclink>)</col>
</row>
<row id="defprops_Name">
<literal_col>Name</literal_col>
<col>GetID()->GetName()</col>

View File

@ -66,6 +66,11 @@
<col>C4ID</col>
<col>Optional ID that is passed to the script function. See <emlink href="playercontrols.xml#ExtraData">ExtraData</emlink>.</col>
</row>
<row>
<literal_col>CoordinateSpace</literal_col>
<col>Game, Viewport</col>
<col>For viewport the given coordinates are relative to the players top left corner of the window. Default ist Game.</col>
</row>
<row>
<literal_col>SendCursorPos</literal_col>
<col>Boolean</col>
@ -218,7 +223,7 @@
</row>
<row>
<literal_col>TriggerMode</literal_col>
<col>bitmask</col>
<col>Bitmask</col>
<col>
<text>
Trigger mode of this mapping. Bitmask based on the following values:

View File

@ -161,12 +161,12 @@
<col>Objects the player should initially be able to create.</col>
</row>
<row>
<literal_col>HomeBaseMaterial</literal_col>
<literal_col>BaseMaterial</literal_col>
<col>ID list</col>
<col>Materials available to buy at game start.</col>
</row>
<row>
<literal_col>HomeBaseProduction</literal_col>
<literal_col>BaseProduction</literal_col>
<col>ID list</col>
<col>Additional supply of materials to buy.</col>
</row>
@ -223,7 +223,7 @@
<row>
<literal_col>TopOpen</literal_col>
<col>Integer</col>
<col>0 or 1. Determines wether the top of the game world should be open.</col>
<col>0, 1 or 2. Determines wether the top of the game world should be open. Values analogous to BottomOpen.</col>
</row>
<row>
<literal_col>LeftOpen</literal_col>

View File

@ -44,7 +44,7 @@
<param>
<type>int</type>
<name>extra</name>
<desc>Extra parameter for special behaviour of the menu entry.<br/> Lower 7 bits (0-127): menu symbol.<br/> 0: normal<br/> 1: rank symbol. With symbol specified, the Rank.png component of that definition will be used. count indicates the rank<br/> 2: picture facet, shifted to the right by XPar1 times the facet width. This is used to include multiple menu symbols in a single definition.<br/> 3: XPar1 specifies an object to be drawn with the rank symbol. If the object has no info section (and thus no rank), there will be an empty entry in context menus.<br/> 4: XPar1 specifies an object to be drawn.<br/> Bit 8 (128): XPar2 is used as object value and overrides the normal object value. Also see extra in <funclink>CreateMenu</funclink></desc>
<desc>Extra parameter for special behaviour of the menu entry.<br/> Lower 7 bits (0-127): menu symbol.<br/> 0: normal<br/> 1: rank symbol. With symbol specified, the Rank.png component of that definition will be used. count indicates the rank<br/> 2: picture facet, shifted to the right by XPar1 times the facet width. This is used to include multiple menu symbols in a single definition.<br/> 3: XPar1 specifies an object to be drawn with the rank symbol. If the object has no info section (and thus no rank), there will be an empty entry in context menus.<br/> 4: XPar1 specifies an object to be drawn.<br/> 7: XPar1 is a prop list that contains parameters for the menu symbol drawing. See picture parameter of <funclink>CustomMessage</funclink> for possible members. Bit 8 (128): XPar2 is used as object value and overrides the normal object value. Also see extra in <funclink>CreateMenu</funclink></desc>
<optional />
</param>
<param>

View File

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>C4Id</title>
<category>Script</category>
<subcat>Strings</subcat>
<version>5.1 OC</version>
<syntax>
<rtype>id</rtype>
<params>
<param>
<type>string</type>
<name>id_string</name>
<desc>String to be converted into an id.</desc>
</param>
</params>
</syntax>
<desc>Converts a string into an id.</desc>
<examples>
<example>
<code>C4Id(&quot;Rock&quot;)</code>
<text>Returns the id 'Rock'.</text>
</example>
</examples>
</func>
<author>jwk</author><date>2002-04</date>
</funcs>

View File

@ -84,6 +84,7 @@ var particles =
<funclink>PV_Step</funclink>
<funclink>PV_Speed</funclink>
<funclink>PV_KeyFrames</funclink>
<funclink>PV_Sin</funclink>
<funclink>PV_Wind</funclink>
<funclink>PV_Gravity</funclink>
<funclink>PC_Die</funclink>

View File

@ -52,9 +52,30 @@
<optional />
</param>
<param>
<type>id/object</type>
<type>proplist</type>
<name>portrait</name>
<desc>Definition or object to take the graphics from as a portrait.</desc>
<desc>
Definition, object or image specification prop list to take the graphics from as a portrait.<br />
Image specification prop lists can contain the following members:
<table>
<rowh>
<col>Property</col>
<col>Description</col>
</rowh>
<row>
<col>Source</col>
<col>Definition to draw graphics of.</col>
</row>
<row>
<col>Name</col>
<col>Name of graphics to draw from definition. Can be used to show a message e.g. of a skinned clonk. Default graphics are used if not specified.</col>
</row>
<row>
<col>Color</col>
<col>Color in which ColorByOwner surfaces of definition are drawn.</col>
</row>
</table>
</desc>
<optional />
</param>
<param>

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>DeepEqual</title>
<category>Script</category>
<version>5.5 OC</version>
<syntax>
<rtype>bool</rtype>
<params>
<param>
<type>any</type>
<name>value1</name>
<desc>First value for comparison.</desc>
</param>
<param>
<type>any</type>
<name>value2</name>
<desc>Second value for comparison.</desc>
</param>
</params>
</syntax>
<desc>Compares two values. Unlike the <emlink href="script/operatoren.html#equality">==-operator</emlink>, DeepEqual compares the elements of proplists and arrays if two non-equal proplists are passed.</desc>
<examples>
<example>
<code>var foo={a=1};
var bar={a=1};
<funclink>Log</funclink>("Pointer comparison: %v, deep comparison: %v", foo==bar, DeepEqual(foo, bar));</code>
<text>Logs "Pointer comparison: false, deep comparison: true".</text>
</example>
</examples>
</func>
<author>Sven2</author><date>2014-04</date>
</funcs>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>DoHomebaseMaterial</title>
<title>DoBaseMaterial</title>
<category>Player</category>
<version>5.1 OC</version>
<syntax>
@ -30,17 +30,19 @@
<desc>Changes availability of buyable objects at the home base.</desc>
<examples>
<example>
<code>DoHomebaseMaterial(0, Firestone, 1);</code>
<code><funclink>DoBaseMaterial</funclink>(0, Firestone, 1);</code>
<text>The player can now buy one flint more.</text>
</example>
</examples>
<related>
<funclink>GetHomebaseMaterial</funclink>
<funclink>GetHomebaseProduction</funclink>
<funclink>DoHomebaseProduction</funclink>
<funclink>GetBaseMaterial</funclink>
<funclink>SetBaseMaterial</funclink>
<funclink>GetBaseProduction</funclink>
<funclink>DoBaseProduction</funclink>
<funclink>SetBaseProduction</funclink>
<funclink>Buy</funclink>
<funclink>Sell</funclink>
</related>
</func>
<author>Sven2</author><date>2001-11</date>
<author>Maikel</author><date>2014-04</date>
</funcs>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>DoHomebaseProduction</title>
<title>DoBaseProduction</title>
<category>Player</category>
<version>5.1 OC</version>
<syntax>
@ -30,17 +30,19 @@
<desc>Changes resupply speed of buyable objects at the home base.</desc>
<examples>
<example>
<code><funclink>DoHomebaseProduction</funclink>(0, Firestone, -<funclink>GetHomebaseProduction</funclink>(0, Firestone));</code>
<code><funclink>DoBaseProduction</funclink>(0, Firestone, -<funclink>GetBaseProduction</funclink>(0, Firestone));</code>
<text>No more flintstones are resupplied for the first player.</text>
</example>
</examples>
<related>
<funclink>GetHomebaseProduction</funclink>
<funclink>DoHomebaseMaterial</funclink>
<funclink>GetHomebaseMaterial</funclink>
<funclink>GetBaseProduction</funclink>
<funclink>SetBaseProduction</funclink>
<funclink>DoBaseMaterial</funclink>
<funclink>GetBaseMaterial</funclink>
<funclink>SetBaseMaterial</funclink>
<funclink>Buy</funclink>
<funclink>Sell</funclink>
</related>
</func>
<author>Clonk-Karl</author><date>2008-03</date>
<author>Maikel</author><date>2014-04</date>
</funcs>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>GetHomebaseMaterial</title>
<title>GetBaseMaterial</title>
<category>Player</category>
<version>5.1 OC</version>
<syntax>
@ -38,17 +38,19 @@
<desc>With id specified, the function returns the number of objects of that type which the player can buy at his home base. In this case index and category are ignored. If id is not specified, the function returns the id of the indicated type of objects of the specified category buyable at the players home base. This will return object types which are generally buyable, even if currently no object of that type is available.</desc>
<examples>
<example>
<code><funclink>Log</funclink>(&quot;Player %s can buy %d firestones!&quot;,<funclink>GetPlayerName</funclink>(0), GetHomebaseMaterial(0,Firestone));</code>
<code><funclink>Log</funclink>(&quot;Player %s can buy %d firestones!&quot;,<funclink>GetPlayerName</funclink>(0), GetBaseMaterial(0,Firestone));</code>
<text>Returns the number of fire stones the first player can buy.</text>
<code>var def = GetHomebaseMaterial(0,nil,3,<funclink>C4D_Vehicle</funclink>);
<code>var def = GetBaseMaterial(0,nil,3,<funclink>C4D_Vehicle</funclink>);
<funclink>Log</funclink>(&quot;The third buyable vehicle of this player is a %i&quot;,def);</code>
<text>Gives the notice "The third buyable vehicle of this player is a ..."</text>
</example>
</examples>
<related>
<funclink>DoHomebaseMaterial</funclink>
<funclink>GetHomebaseProduction</funclink>
<funclink>DoHomebaseProduction</funclink>
<funclink>DoBaseMaterial</funclink>
<funclink>SetBaseMaterial</funclink>
<funclink>GetBaseProduction</funclink>
<funclink>DoBaseProduction</funclink>
<funclink>SetBaseProduction</funclink>
<funclink>C4D_All</funclink>
<funclink>C4D_Goal</funclink>
<funclink>C4D_Living</funclink>
@ -59,5 +61,5 @@
<funclink>C4D_Vehicle</funclink>
</related>
</func>
<author>Günther</author><date>2002-02</date>
<author>Maikel</author><date>2014-04</date>
</funcs>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>GetHomebaseProduction</title>
<title>GetBaseProduction</title>
<category>Player</category>
<version>5.1 OC</version>
<syntax>
@ -38,14 +38,16 @@
<desc>With id specified, the function returns how quickly objects of that type are resupplied to the player's home base. In this case index and category are ignored. If id is not specified, the function returns the id of the indicated type of objects of the specified category in the player's resupply list. This will return all object types from the resupply list, even if they are currently not being resupplied.</desc>
<examples>
<example>
<code>if(!<funclink>GetHomebaseProduction</funclink>(0, Firestone)) <funclink>GetCursor</funclink>(0)-&gt;<funclink>CreateContents</funclink>(Firestone);</code>
<code>if(!<funclink>GetBaseProduction</funclink>(0, Firestone)) <funclink>GetCursor</funclink>(0)-&gt;<funclink>CreateContents</funclink>(Firestone);</code>
<text>Gives a flintstone to the selected clonk of the first player if currently no flintstones are resupplied to the player's home base.</text>
</example>
</examples>
<related>
<funclink>GetHomebaseMaterial</funclink>
<funclink>DoHomebaseMaterial</funclink>
<funclink>DoHomebaseProduction</funclink>
<funclink>GetBaseMaterial</funclink>
<funclink>DoBaseMaterial</funclink>
<funclink>SetBaseMaterial</funclink>
<funclink>DoBaseProduction</funclink>
<funclink>SetBaseProduction</funclink>
<funclink>C4D_All</funclink>
<funclink>C4D_Goal</funclink>
<funclink>C4D_Living</funclink>
@ -56,5 +58,5 @@
<funclink>C4D_Vehicle</funclink>
</related>
</func>
<author>Clonk-Karl</author><date>2008-03</date>
<author>Maikel</author><date>2014-04</date>
</funcs>

View File

@ -33,7 +33,7 @@ var spawn_weapon = weapon_list[<funclink>Random</funclink>(<funclink>GetLength</
</example>
</examples>
<related>
<funclink>GetHomebaseMaterial</funclink>
<funclink>GetBaseMaterial</funclink>
<funclink>GetPlrKnowledge</funclink>
<funclink>C4D_Goal</funclink>
<funclink>C4D_Living</funclink>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>GetLeagueProgressData</title>
<category>Network</category>
<subcat>League</subcat>
<version>5.5 OC</version>
<syntax>
<rtype>string</rtype>
<params>
<param>
<type>int</type>
<name>player_id</name>
<desc>ID of player whose progress data shall be returned. Use <funclink>GetPlayerID</funclink>() to get the ID of a joined player.</desc>
</param>
</params>
</syntax>
<desc>Gets the league progress data. See <funclink>SetLeagueProgressData</funclink> for more information.</desc>
<related><funclink>SetLeagueProgressData</funclink><funclink>GetLeagueScore</funclink></related>
</func>
<author>Sven2</author><date>2014-04</date>
</funcs>

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>GetLeagueScore</title>
<category>Network</category>
<subcat>League</subcat>
<version>5.5 OC</version>
<syntax>
<rtype>int</rtype>
<params>
<param>
<type>int</type>
<name>player_id</name>
<desc>ID of player whose score shall shall be returned.</desc>
<optional />
</param>
</params>
</syntax>
<desc>Returns the league score of the given player. This function can be used for custom scoring e.g. in competition leagues.</desc>
<remark>Use <funclink>GetPlayerID</funclink>() to get the ID of a joined player.</remark>
<related><funclink>GetLeagueProgressData</funclink><funclink>SetLeaguePerformance</funclink></related>
</func>
<author>Sven2</author><date>2014-04</date>
</funcs>

View File

@ -19,7 +19,7 @@
</param>
</params>
</syntax>
<desc>Returns the material currently set for the calling object.</desc>
<desc>Returns the material currently set for the calling object. May also be called from definition context to return the default material of the graphics of this definition.</desc>
<examples>
<example>
<code><funclink>if</funclink>(<funclink>GetMeshMaterial</funclink>() == &quot;Clonk_Body&quot;)
@ -28,8 +28,14 @@ else
<funclink>SetMeshMaterial</funclink>(&quot;Clonk_Body&quot;);</code>
<text>If a clonk has its eyes open then this script makes it close them, otherwise they are opened.</text>
</example>
<example>
<code><funclink>for</funclink> (var i=0,mat; mat=<funclink>GetID</funclink>()->GetMeshMaterial(i); ++i)
<funclink>SetMeshMaterial</funclink>(mat, i);</code>
<text>Resets the mesh material of all submeshes of this object to their respective defaults.</text>
</example>
</examples>
<related><funclink>SetMeshMaterial</funclink></related>
</func>
<author>Clonk-Karl</author><date>2010-04</date>
<author>Sven2</author><date>2014-04</date>
</funcs>

View File

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>GetPlayerZoomLimits</title>
<category>Player</category>
<subcat>View</subcat>
<version>5.5 OC</version>
<syntax>
<rtype>proplist</rtype>
<params>
<param>
<type>int</type>
<name>player</name>
<desc>Player whose zoom limits are queried.</desc>
</param>
</params>
</syntax>
<desc>Returns currently set zoom limits for a player. The return value is a proplist with the following properties:
<table>
<rowh>
<col>Property</col>
<col>Description</col>
</rowh>
<row>
<literal_col>MaxWidth</literal_col>
<col>Maximum width of landscpe in viewport, i.e. how far the player can view if zoomed out as far as possible. May be zero if MaxHeight is nonzero and zoom limits are determined by maximum view height only.</col>
</row>
<row>
<literal_col>MaxHeight</literal_col>
<col>Maximum height of landscpe in viewport. May be zero if MaxWidth is nonzero.</col>
</row>
<row>
<literal_col>MinWidth</literal_col>
<col>Minimum width of landscpe in viewport, i.e. how far the player can view if zoomed in as far as possible. May be zero if MinHeight is nonzero and zoom limits are determined by minimunm view height only.</col>
</row>
<row>
<literal_col>MinHeight</literal_col>
<col>Minimum height of landscpe in viewport. May be zero if MinWidth is nonzero.</col>
</row>
<row>
<literal_col>MaxValue</literal_col>
<col>Maximum zoom if set as a direct pixel-to-landscape correspondance value using <funclink>SetPlayerZoom</funclink> function. Zero if a direct zoom value is not specified.</col>
</row>
<row>
<literal_col>MinValue</literal_col>
<col>Minimum zoom if set as a direct pixel-to-landscape correspondance value using <funclink>SetPlayerZoom</funclink> function. Zero if a direct zoom value is not specified.</col>
</row>
</table>
</desc>
<remark>It is currently not possible to query the current zoom because these values are not synchronized.</remark>
<examples>
<example>
<code>func ReduceSight(int player)
{
var zoom_limits = <funclink>GetPlayerZoomLimits</funclink>(player);
SetPlayerZoomByViewRange(player, zoom_limits.MaxWidth/2, zoom_limits.MaxHeight/2, PLRZOOM_LimitMax);
return true;
}
</code>
<text>Halves the view range of a player.</text>
</example>
</examples>
<related>
<funclink>SetPlayerZoomByViewRange</funclink>
<funclink>SetPlayerZoom</funclink>
</related>
</func>
<author>Sven2</author><date>2014-05</date>
</funcs>

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>LogCallStack</title>
<category>Developer</category>
<version>5.3 OC</version>
<syntax>
<rtype>bool</rtype>
</syntax>
<desc>Prints out the current call stack without breaking execution flow.</desc>
<examples>
<example>
<code>func Destruction()
{
Log("Destruction of %v!", GetID());
LogCallStack();
return _inherited(...);
}</code>
<text>Helper function during development: When this object gets destructed, a call stack is printed. This may be useful to find out where a particular object removal call was coming from.</text>
</example>
</examples>
<related>
<funclink>FatalError</funclink>
</related>
</func>
<author>Sven2</author><date>2014-01</date>
</funcs>

View File

@ -27,6 +27,7 @@
<funclink>PV_Step</funclink>
<funclink>PV_Speed</funclink>
<funclink>PV_KeyFrames</funclink>
<funclink>PV_Sin</funclink>
<funclink>PC_Die</funclink>
<funclink>PC_Bounce</funclink>
</related>

View File

@ -31,6 +31,7 @@
<funclink>PV_Step</funclink>
<funclink>PV_Speed</funclink>
<funclink>PV_KeyFrames</funclink>
<funclink>PV_Sin</funclink>
<funclink>PV_Wind</funclink>
<funclink>PC_Die</funclink>
<funclink>PC_Bounce</funclink>

View File

@ -66,6 +66,7 @@
<funclink>PV_Random</funclink>
<funclink>PV_Speed</funclink>
<funclink>PV_Step</funclink>
<funclink>PV_Sin</funclink>
<funclink>PC_Die</funclink>
<funclink>PC_Bounce</funclink>
</related>

View File

@ -31,6 +31,7 @@
<funclink>PV_Step</funclink>
<funclink>PV_Speed</funclink>
<funclink>PV_KeyFrames</funclink>
<funclink>PV_Sin</funclink>
<funclink>PC_Die</funclink>
<funclink>PC_Bounce</funclink>
</related>

View File

@ -39,6 +39,7 @@
<funclink>PV_Step</funclink>
<funclink>PV_Speed</funclink>
<funclink>PV_KeyFrames</funclink>
<funclink>PV_Sin</funclink>
<funclink>PC_Die</funclink>
<funclink>PC_Bounce</funclink>
</related>

View File

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>PV_Sin</title>
<category>Particles</category>
<version>5.4.2 OC</version>
<syntax>
<rtype>array</rtype>
<params>
<param>
<type>int</type>
<name>start_value</name>
<desc>Begin of the interval.</desc>
</param>
<param>
<type>int</type>
<name>end_value</name>
<desc>End of the interval.</desc>
</param>
</params>
</syntax>
<desc>The value will is calculates as sin(value) * amplitude + offset with value given in degrees.</desc>
<remark>See the <emlink href="particle/index.html">particle documentation</emlink> for further explanations of the particle system.</remark>
<examples>
<example>
<code><funclink>CreateParticle</funclink>("MagicRing", 0, 0, 0, 0, 100, {R=0xff,G=0x00,B=0x30, Size = PV_Sin(<funclink>PV_Linear</funclink>(0,180),10,0)}, 1);</code>
<text>Creates a particle which increases size from 0 to 10 and back to 0 during 100 frames.</text>
</example>
</examples>
<related>
<funclink>CreateParticle</funclink>
<funclink>PV_Direction</funclink>
<funclink>PV_Random</funclink>
<funclink>PV_Step</funclink>
<funclink>PV_Linear</funclink>
<funclink>PV_Speed</funclink>
<funclink>PV_KeyFrames</funclink>
<funclink>PC_Die</funclink>
<funclink>PC_Bounce</funclink>
</related>
</func>
<author>Sven2</author><date>2014-06</date>
</funcs>

View File

@ -30,6 +30,7 @@
<funclink>PV_Direction</funclink>
<funclink>PV_Random</funclink>
<funclink>PV_KeyFrames</funclink>
<funclink>PV_Sin</funclink>
<funclink>PV_Step</funclink>
<funclink>PC_Die</funclink>
<funclink>PC_Bounce</funclink>

View File

@ -44,6 +44,7 @@
<funclink>PV_Random</funclink>
<funclink>PV_Speed</funclink>
<funclink>PV_KeyFrames</funclink>
<funclink>PV_Sin</funclink>
<funclink>PC_Die</funclink>
<funclink>PC_Bounce</funclink>
</related>

View File

@ -31,6 +31,7 @@
<funclink>PV_Step</funclink>
<funclink>PV_Speed</funclink>
<funclink>PV_KeyFrames</funclink>
<funclink>PV_Sin</funclink>
<funclink>PC_Die</funclink>
<funclink>PC_Bounce</funclink>
<funclink>PC_Stop</funclink>

View File

@ -50,6 +50,7 @@ for(var living in <funclink>FindObjects</funclink>(<funclink>Find_OCF</funclink>
<funclink>GetMaterial</funclink>
<funclink>GBackSolid</funclink>
<funclink>GetPathLength</funclink>
<funclink>PathFree2</funclink>
</related>
</func>
<author>Sven2</author><date>2002-08</date>

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>PathFree2</title>
<category>Landscape</category>
<version>5.1 OC</version>
<syntax>
<rtype>array</rtype>
<params>
<param>
<type>int</type>
<name>x1</name>
<desc>X coordinate of the start point</desc>
</param>
<param>
<type>int</type>
<name>y1</name>
<desc>Y coordinate of the start point</desc>
</param>
<param>
<type>int</type>
<name>x2</name>
<desc>X coordinate of the end point</desc>
</param>
<param>
<type>int</type>
<name>y2</name>
<desc>Y coordinate of the end point</desc>
</param>
</params>
</syntax>
<desc>Works like <emlink href="script/fn/PathFree.html">PathFree</emlink>, but instead returns an array containing the coordinates of the first solid pixel found on line. Returns nil if the path is free.</desc>
<remark>All coordinates are global, even in local calls.</remark>
<examples>
<example>
<code>var x = <funclink>Random</funclink>(<funclink>LandscapeWidth</funclink>()),
pos = PathFree2(x, 0, x, <funclink>LandscapeHeight</funclink>());
if(pos)
<funclink>CreateObject</funclink>(Idol, pos[0], pos[1]);
</code>
<text>Creates an Idol somewhere on the surface of the landscape.</text>
</example>
</examples>
<related>
<funclink>GetMaterial</funclink>
<funclink>GBackSolid</funclink>
<funclink>GetPathLength</funclink>
<funclink>PathFree</funclink>
</related>
</func>
<author>Apfelclonk</author><date>2014-04</date>
</funcs>

View File

@ -25,7 +25,7 @@
<type>string</type>
<name>material_name</name>
<desc>
Material in which object are to be created. This can be a material number or a string as follows:
Material in which object are to be created. This can be a material name or a string as follows:
<table>
<rowh>
<col>material_index</col>
@ -93,7 +93,7 @@
<remark>If there is only very little of the target material present in the landscape, placement calculation will take longer.<br/>However, endless retry loops are avoided.</remark>
<examples>
<example>
<code>PlaceObjects(Loam,20,<funclink>Material</funclink>(&quot;Earth&quot;),100,0,200)</code>
<code>PlaceObjects(Loam,20,&quot;Earth&quot;,100,0,200)</code>
<text>Create 20 chunks of loam in earth within the coordinates 100,0 and 200,LandscapeHeight().</text>
</example>
<example>

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>SetBaseMaterial</title>
<category>Player</category>
<version>5.1 OC</version>
<syntax>
<rtype>bool</rtype>
<params>
<param>
<type>int</type>
<name>player</name>
<desc>Number of the player whose home base material you want to set.</desc>
</param>
<param>
<type>id</type>
<name>definition</name>
<desc>id of the buyable object type you want to adjust.</desc>
</param>
<param>
<type>int</type>
<name>cnt</name>
<desc>Set the available amount (positive).</desc>
</param>
</params>
</syntax>
<desc>Sets the availability of buyable objects at the home base.</desc>
<examples>
<example>
<code><funclink>SetBaseMaterial</funclink>(0, Firestone, 10);</code>
<text>The first player can now buy ten flints.</text>
</example>
</examples>
<related>
<funclink>GetBaseMaterial</funclink>
<funclink>DoBaseMaterial</funclink>
<funclink>GetBaseProduction</funclink>
<funclink>SetBaseProduction</funclink>
<funclink>DoBaseProduction</funclink>
<funclink>Buy</funclink>
<funclink>Sell</funclink>
</related>
</func>
<author>Maikel</author><date>2014-04</date>
</funcs>

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>SetBaseProduction</title>
<category>Player</category>
<version>5.1 OC</version>
<syntax>
<rtype>bool</rtype>
<params>
<param>
<type>int</type>
<name>player</name>
<desc>Number of the player whose home base resupply list you want to set.</desc>
</param>
<param>
<type>id</type>
<name>type</name>
<desc>id of the object type you want to adjust.</desc>
</param>
<param>
<type>int</type>
<name>cnt</name>
<desc>Set the resupply value (positive).</desc>
</param>
</params>
</syntax>
<desc>Sets resupply speed of buyable objects at the home base.</desc>
<examples>
<example>
<code><funclink>SetBaseProduction</funclink>(0, Firestone, 0);</code>
<text>No more flintstones are resupplied for the first player.</text>
</example>
</examples>
<related>
<funclink>GetBaseProduction</funclink>
<funclink>DoBaseProduction</funclink>
<funclink>DoBaseMaterial</funclink>
<funclink>SetBaseMaterial</funclink>
<funclink>GetBaseMaterial</funclink>
<funclink>Buy</funclink>
<funclink>Sell</funclink>
</related>
</func>
<author>Maikel</author><date>2014-04</date>
</funcs>

View File

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>SetLeaguePerformance</title>
<category>Network</category>
<subcat>League</subcat>
<version>5.5 OC</version>
<syntax>
<rtype>bool</rtype>
<params>
<param>
<type>int</type>
<name>score</name>
<desc>New player or scenario score</desc>
</param>
<param>
<type>int</type>
<name>player_id</name>
<desc>ID of player whose score shall be set. If not given, global performance for all players is set.</desc>
<optional />
</param>
</params>
</syntax>
<desc>Sets the league score. This function can be used for custom scenario scoring in competition or adventure leagues.</desc>
<remark>Use <funclink>GetPlayerID</funclink>() to get the ID of a joined player.</remark>
<examples>
<example>
<code>#appendto Rock
static g_rocks_collected;
func Entrance(clonk)
{
var plr = clonk-><funclink>GetController</funclink>();
if (clonk-><funclink>GetID</funclink>() == Clonk &amp;&amp; plr != NO_OWNER)
{
++g_rocks_collected;
<funclink>Log</funclink>("%s found a rock! Score: %d", <funclink>GetTaggedPlayerName</funclink>(plr), g_rocks_collected);
SetLeaguePerformance(g_rocks_collected);
return <funclink>RemoveObject</funclink>();
}
return <funclink>_inherited</funclink>(clonk, ...);
}</code>
<text>Rock script modification: Whenever a rock is collected by a Clonk, the score of all players is increased.</text>
</example>
</examples>
<related><funclink>SetLeagueProgressData</funclink><funclink>GetLeagueScore</funclink></related>
</func>
<author>Sven2</author><date>2014-04</date>
</funcs>

View File

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>SetLeagueProgressData</title>
<category>Network</category>
<subcat>League</subcat>
<version>5.5 OC</version>
<syntax>
<rtype>bool</rtype>
<params>
<param>
<type>string</type>
<name>new_data</name>
<desc>New data string for this player in this scenario.</desc>
</param>
<param>
<type>int</type>
<name>player_id</name>
<desc>ID of player whose progress data shall be set. Use <funclink>GetPlayerID</funclink>() to get the ID of a joined player.</desc>
</param>
</params>
</syntax>
<desc>Sets the league progress data. This function can be used to store a per-scenario per-user data string in the league. The function is available for both melee and custom settlement leagues. The data is stored between league games and can later be retrieved using <funclink>GetLeagueProgressData</funclink>().</desc>
<remark>Each scenario may store up to 2048 characters. The string may only contain alphanumeric characters plus space (" ") and underscore ("_"). Invalid characters will be removed by the league and not returned when <funclink>GetLeagueProgressData</funclink> is called after the next scenario start.</remark>
<examples>
<example>
<code>func SetLeagueProgressScore(int plr, int new_progress)
{
// Safety: Valid players only
var plrid = <funclink>GetPlayerID</funclink>(plr);
if (!plrid) return;
// Progress must be between 0 and 25
new_progress = <funclink>BoundBy</funclink>(new_progress, 0, 25);
// Get old progress from previous round
var progress_string = <funclink>GetLeagueProgressData</funclink>(plrid);
if (progress_string &amp;&amp; <funclink>GetLength</funclink>(progress_string))
{
var old_progress = <funclink>GetChar</funclink>(progress_string)-<funclink>GetChar</funclink>("A");
// If old progress was better than new progress, keep old progress
new_progress = <funclink>Max</funclink>(old_progress, new_progress);
}
// Set new progress
SetLeagueProgressData(<funclink>Format</funclink>("%c", <funclink>GetChar</funclink>("A") + new_progress));
<funclink>SetLeaguePerformance</funclink>(new_progress);
return true;
}</code>
<text>Helper script for a scenario that is using custom scoring in the league. LeagueProgressData is used to remember the last progress and ensure that progress never decreases.</text>
</example>
</examples>
<related><funclink>GetLeagueProgressData</funclink><funclink>SetLeaguePerformance</funclink></related>
</func>
<author>Sven2</author><date>2014-04</date>
</funcs>

View File

@ -6,7 +6,7 @@
<func>
<title>SetPlayList</title>
<category>Music</category>
<version>5.1 OC</version>
<version>4.2 OC</version>
<syntax>
<rtype>int</rtype>
<params>
@ -16,6 +16,12 @@
<desc>List of pieces of music to be played. The individual file names are separated with semicolons (";"). Wildcards are expanded. If the parameter is left out, the standard playlist is restored.</desc>
<optional />
</param>
<param>
<type>int</type>
<name>at_player</name>
<desc>The playlist is changed only on clients where the player with this player number is local. If left out or NO_OWNER, the playlist is changed for all clients. If the player number is invalid, no playlists are changed.</desc>
<optional />
</param>
</params>
</syntax>
<desc>Sets the play list of pieces of music to be played in random order, if music is activated. The actual number of pieces of music in the playlist is returned, or 0 in network mode.</desc>
@ -24,4 +30,5 @@
<related><funclink>Music</funclink></related>
</func>
<author>PeterW</author><date>2003-01</date>
<author>Sven2</author><date>2014-08</date>
</funcs>

View File

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>SetPlayerZoom</title>
<category>Player</category>
<subcat>View</subcat>
<version>5.5 OC</version>
<syntax>
<rtype>bool</rtype>
<params>
<param>
<type>int</type>
<name>player</name>
<desc>Player whose zoom or zoom limits are to be adjusted. NO_OWNER for all players.</desc>
</param>
<param>
<type>int</type>
<name>zoom</name>
<desc>New zoom factor. A factor of zero disables direct zoom definition and reverts to the default method of calculating zoom by view range.</desc>
</param>
<param>
<type>int</type>
<name>precision</name>
<desc>Value by which zoom is divided to achieve fractional numbers.</desc>
<optional />
</param>
<param>
<type>int</type>
<name>flags</name>
<desc>Flags controlling function behaviour:
<table>
<rowh>
<col>Flag</col>
<col>Description</col>
</rowh>
<row>
<literal_col>PLRZOOM_Direct</literal_col>
<col>The zoom does not scroll slowly towards the new value, but is set directly.</col>
</row>
<row>
<literal_col>PLRZOOM_NoIncrease</literal_col>
<col>The new zoom is only to be set if it is smaller than the current value.</col>
</row>
<row>
<literal_col>PLRZOOM_NoDecrease</literal_col>
<col>The new zoom is only to be set if it is greater than the current value.</col>
</row>
<row>
<literal_col>PLRZOOM_LimitMin</literal_col>
<col>Set the minimum limit for zooming. The player cannot zoom out further than this.</col>
</row>
<row>
<literal_col>PLRZOOM_LimitMax</literal_col>
<col>Set the maximum limit for zooming. The player cannot zoom in further than this.</col>
</row>
<row>
<literal_col>PLRZOOM_Set</literal_col>
<col>Set the current zoom. This flag is implied if neither PLRZOOM_LimitMin nor PLRZOOM_LimitMax is supplied but can be used if current zoom and limits should be set simultanuously.</col>
</row>
</table>
</desc>
</param>
</params>
</syntax>
<desc>Changes zoom or zoom limits vor all viewports of a player to direct values.</desc>
<remark>Setting zoom to a direct value causes the game to look different depending on which screen resolution the player has configured. Use this function only if you want to achieve direct pixel correspondance between the game world and the screen, e.g. because your scenario provides low resolution graphics only or because your scenario should be played in certain screen resolutions only. Regular scenarios should use <funclink>SetPlayerZoomByViewRange</funclink> to achieve visuals whcih are independent of the player's monitor size.</remark>
<examples>
<example>
<code>func InitializePlayer(int plr)
{
SetPlayerZoom(plr, 1,1, PLRZOOM_LimitMin | PLRZOOM_LimitMax);
<funclink>SetPlayerViewLock</funclink>(plr, true);
return true;
}</code>
<text>Code for a scenario script: The zoom is fixed to 1, i.e. one landscape pixel corresponds to one pixel on the screen. Zooming in or out is not possible.</text>
</example>
</examples>
<related>
<funclink>SetPlayerZoomByViewRange</funclink>
<funclink>GetPlayerZoomLimits</funclink>
<funclink>SetPlayerViewLock</funclink>
<funclink>SetPlrView</funclink>
<funclink>SetPlrViewRange</funclink>
<funclink>SetFoW</funclink>
</related>
</func>
<author>Sven2</author><date>2014-03</date>
</funcs>

View File

@ -55,12 +55,16 @@
<literal_col>PLRZOOM_LimitMax</literal_col>
<col>Set the maximum limit for zooming. The player cannot zoom in further than this.</col>
</row>
<row>
<literal_col>PLRZOOM_Set</literal_col>
<col>Set the current zoom. This flag is implied if neither PLRZOOM_LimitMin nor PLRZOOM_LimitMax is supplied but can be used if current zoom and limits should be set simultanuously.</col>
</row>
</table>
</desc>
</param>
</params>
</syntax>
<desc>Disabled or enabled locked view for one or all players. If the view is locked, the player cannot scroll around to explore the map.</desc>
<desc>Adjusts the zoom or zoom limit of all viewports of a player.</desc>
<examples>
<example>
<code>func InitializePlayer(int plr)
@ -74,6 +78,8 @@
</example>
</examples>
<related>
<funclink>SetPlayerZoom</funclink>
<funclink>GetPlayerZoomLimits</funclink>
<funclink>SetPlayerViewLock</funclink>
<funclink>SetPlrView</funclink>
<funclink>SetPlrViewRange</funclink>

View File

@ -162,28 +162,14 @@
<row>
<col>9l</col>
<col id="==">==</col>
<col>Returns whether a equals b.</col>
<col>Returns whether a equals b. For proplists and arrays, pointers are compared. Use <funclink>DeepEqual</funclink> to compare contents.</col>
<col>postfix</col>
<col>bool, any/any</col>
</row>
<row>
<col>9l</col>
<col id="!=">!=</col>
<col>Returns whether a is unequal to b.</col>
<col>postfix</col>
<col>bool, any/any</col>
</row>
<row>
<col>9l</col>
<col id="===">===</col>
<col>Returns whether a and b refer to the same thing.</col>
<col>postfix</col>
<col>bool, any/any</col>
</row>
<row>
<col>9l</col>
<col id="!==">!==</col>
<col>Returns whether a and b do not refer to the same thing.</col>
<col>Returns whether a is unequal to b. For proplists and arrays, pointers are compared. Use !<funclink>DeepEqual</funclink> to compare contents.</col>
<col>postfix</col>
<col>bool, any/any</col>
</row>

View File

@ -39,16 +39,13 @@ if ($link && $db) {
die();
}
$server->cleanUp(true); //Cleanup old stuff
// register new release
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'release-file') {
try {
registerRelease();
} catch(Exception $e) {
C4Network::sendAnswer(C4Network::createError($e->getMessage()));
}
// prepare data for the engine
} else if (isset($GLOBALS['HTTP_RAW_POST_DATA'])) {
} else if (isset($GLOBALS['HTTP_RAW_POST_DATA'])) { //data sent from engine?
$input = $GLOBALS['HTTP_RAW_POST_DATA'];
$action = ParseINI::parseValue('Action', $input);
$csid = ParseINI::parseValue('CSID', $input);
@ -59,17 +56,17 @@ if ($link && $db) {
switch ($action) {
case 'Start': //start a new round
if (ParseINI::parseValue('LeagueAddress', $reference)) {
C4Network::sendAnswer(C4Network::createError('IDS_MSG_LEAGUENOTSUPPORTED'));
C4Network::sendAnswer(C4Network::createError('League not supported!'));
} else {
$csid = $server->addReference($reference);
if ($csid) {
$answer = array('Status' => 'Success', 'CSID' => $csid);
if(!testHostConn($input))
$answer['Message'] = 'IDS_MSG_MASTERSERVNATERROR';
$answer['Message'] = 'Your network failed to pass certain tests. It is unlikely that are you able to host for the public.|To fix that, you need port forwarding in your router.';
C4Network::sendAnswer(C4Network::createAnswer($answer));
unset($answer);
} else {
C4Network::sendAnswer(C4Network::createError('IDS_MSG_MATERSERVSIGNUPFAIL'));
C4Network::sendAnswer(C4Network::createError('Round signup failed. (To many tries?)'));
}
}
break;
@ -77,26 +74,26 @@ if ($link && $db) {
if ($server->updateReference($csid, $reference)) {
C4Network::sendAnswer(C4Network::createAnswer(array('Status' => 'Success')));
} else {
C4Network::sendAnswer(C4Network::createError('IDS_MSG_MASTERSERVUPDATEFAIL'));
C4Network::sendAnswer(C4Network::createError('Round update failed.'));
}
break;
case 'End': //remove a round
if ($server->removeReference($csid)) {
C4Network::sendAnswer(C4Network::createAnswer(array('Status' => 'Success')));
} else {
C4Network::sendAnswer(C4Network::createError('IDS_MSG_MASTERSERVENDFAIL'));
C4Network::sendAnswer(C4Network::createError('Round end failed.'));
}
break;
default:
if (!empty($action)) {
C4Network::sendAnswer(C4Network::createError('IDS_MSG_MASTERSERVNOOP'));
C4Network::sendAnswer(C4Network::createError('Unknown action.'));
} else {
C4Network::sendAnswer(C4Network::createError('IDS_MSG_MASTERSERVNOOP'));
C4Network::sendAnswer(C4Network::createError('No action defined.'));
}
break;
}
} else {
C4Network::sendAnswer(C4Network::createError('IDS_MSG_MASTERSERVWRONGENGINE'));
C4Network::sendAnswer(C4Network::createError('Wrong engine, "' . ParseINI::parseValue('Game', $input) . '" expected.'));
}
} else { //list availabe games
$list = array();

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -36,7 +36,7 @@ material FlagRight
scene_blend alpha_blend
texture_unit
{
texture FlagAmetyst.png
texture FlagAmethyst.png
tex_address_mode wrap
filtering trilinear
}

View File

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 117 KiB

View File

@ -4,8 +4,6 @@ Shape=Rough
Density=70
Friction=15
BlastFree=1
Blast2Object=Amethyst
Blast2ObjectRatio=100
MaxAirSpeed=100
MaxSlide=1
Corrode=60

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

View File

@ -1,12 +0,0 @@
[Material]
Name=Ametyst
Shape=Rough
Density=70
Friction=15
BlastFree=1
Blast2Object=Ice
MaxAirSpeed=100
MaxSlide=1
Corrode=60
Placement=21
TextureOverlay=Ametyst

View File

@ -4,7 +4,6 @@ Shape=Rough
Density=70
Friction=15
BlastFree=1
Blast2Object=Ice
MaxAirSpeed=100
MaxSlide=1
Corrode=60

View File

@ -58,7 +58,7 @@ OverloadTextures
65=Ruby-Ruby
66=Ice-ice2
67=Ametyst-Ametyst
67=Amethyst-Amethyst
68=Ice-ice3
70=Snow-snow1

View File

@ -5,7 +5,7 @@ Category=C4D_StaticBack
Width=8
Height=7
Offset=-4,-4
SolidMask=0,9,8,3,0,1
SolidMask=0,0,8,7
Value=10
Mass=10
Rotate=1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 275 B

After

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 B

View File

@ -1,2 +1,2 @@
NameLeft=Team Ruby
NameRight=Team Ametyst
NameRight=Team Amethyst

View File

@ -152,9 +152,9 @@ global func FxBalloonsTimer()
var target;
var r = Random(3);
if(r == 0) target = CreateObject(Boompack, x, y, NO_OWNER);
if(r == 1){target = CreateObject(DynamiteBox, x, y, NO_OWNER); target->SetR(180); }
if(r == 2){target = CreateObject(Arrow, x, y, NO_OWNER); target->SetObjDrawTransform(1000,0,0,0,1000,-7500);}
if (r == 0) { target = CreateObject(Boompack, x, y, NO_OWNER); target->SetR(180); }
if (r == 1) { target = CreateObject(DynamiteBox, x, y, NO_OWNER); target->SetR(180); }
if (r == 2) { target = CreateObject(Arrow, x, y, NO_OWNER); target->SetObjDrawTransform(1000,0,0,0,1000,-7500); }
var balloon = CreateObject(TargetBalloon, x, y-30, NO_OWNER);
@ -165,22 +165,6 @@ global func FxBalloonsTimer()
balloon->SetXDir(((Random(2)*2)-1) * (Random(4)+3));
}
global func PlaceEdges()
{
var x=[213, 780, 285, 285, 220, 220, 235, 414, 404, 668, 676, 684, 781, 694, 781, 229, 772, 364, 534, 380];
var y=[276, 212, 325, 404, 404, 421, 495, 285, 276, 372, 364, 356, 356, 277, 413, 309, 252, 445, 446, 412];
var d=[nil, 1, 2, 0, 1, 3, 3, 2, 1, 1, 1, 1, 0, 3, 2, 0, 1, 3, 2, 0];
for (var i = 0; i < GetLength(x); i++)
{
var edge=CreateObject(BrickEdge, x[i], y[i] + 5, NO_OWNER);
edge->Initialize();
edge->SetP(d[i]);
edge->SetPosition(x[i],y[i]);
//edge->PermaEdge();
}
return 1;
}
global func PlaceGras()
{
var x=[747, 475, 474, 359, 244, 216, 324, 705, 754, 758, 828, 828, 235, 266, 266, 269, 177, 194, 204, 223, 348, 273, 284, 365, 369, 375, 379, 285, 281, 274, 233, 390, 229, 401, 388, 414, 476, 468, 463, 457, 422, 482, 493, 615, 609, 625, 631, 700, 704, 687, 761, 763, 771, 777, 619, 615, 621, 696, 789, 766, 356, 228, 188];
@ -195,17 +179,6 @@ global func PlaceGras()
return 1;
}
private func MakeTarget(int x, int y)
{
var target = CreateObject(DynamiteBox, x, y, NO_OWNER);
var balloon = CreateObject(TargetBalloon, x, y-30, NO_OWNER);
balloon->SetProperty("load",target);
target->SetAction("Attach", balloon);
CreateParticle("Flash", x, y, 0, 0, 8, Particles_Flash());
}
// Refill/fill chests.
global func FxIntFillChestsStart(object target, effect, int temporary)
{

View File

@ -3,9 +3,10 @@
#appendto Boompack
func Fall(int from)
func Fall(int from_plr)
{
SetOwner(from);
SetOwner(from_plr);
SetController(from_plr);
Launch(RandomX(-10,10)+180);
}

View File

@ -17,6 +17,7 @@ func Fall(int from)
for(var i=0; i < 7 + Random(2); i++)
{
var dyn=CreateObject(Dynamite,0,0,from);
dyn->SetController(from);
dyn->SetXDir(RandomX(-9,9));
dyn->SetYDir(RandomX(-5,8));
dyn->SetRDir(RandomX(-15,15));

View File

@ -9,5 +9,4 @@ Vertices=2
VertexX=0,0
VertexY=32,-32
VertexFriction=50
Value=10
Mass=15

View File

@ -0,0 +1,15 @@
[Developer/Maintainer]
Maikel
[Folder Information]
This folder contains objects with decorative purposes only.
[Information for developers]
In this folder you should add objects which have a decorative purpose, this does not mean they cannot have
any interactions whatsoever. However, these objects do not play any role in the normal Objects.ocd and do
not depend on any other objects (under ideal circumstances). Please make sure you give your object a unique
identifier and place it in the most fitting sub folder of Decoration.ocd or create a new sub folder if
there is need for that.
If you want to contribute to this folder feel free to do so and in case of questions contact the maintainer
in IRC or the forum.

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 KiB

View File

@ -0,0 +1,6 @@
[DefCore]
id=Deco_AltMaterials
Version=5,2,0,1
Category=C4D_StaticBack
Width=1
Height=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

View File

@ -0,0 +1 @@
This definition is not created. It just serves as a container for custom mesh materials, which aren't loaded unless the definition is valid.

View File

@ -0,0 +1,167 @@
material GoldenChest
{
receive_shadows on
technique
{
pass
{
ambient 0.500000 0.500000 0.500000 1.000000
diffuse 0.640000 0.640000 0.640000 1.000000
specular 0.500000 0.500000 0.500000 1.000000 12.500000
emissive 0.000000 0.000000 0.000000 1.000000
texture_unit
{
texture goldenchest.jpg
tex_address_mode wrap
filtering trilinear
}
}
}
}
material AncientColumn
{
receive_shadows on
technique
{
pass
{
ambient 0.500000 0.500000 0.500000 1.000000
diffuse 0.640000 0.640000 0.640000 1.000000
specular 0.000000 0.000000 0.000000 1.000000 12.500000
emissive 0.000000 0.000000 0.000000 1.000000
texture_unit
{
texture AncientColumn.png
tex_address_mode wrap
filtering trilinear
}
}
}
}
material FlyAmanitaMushroom
{
receive_shadows on
technique
{
pass FlyAmanitaMushroom
{
ambient 0.800000011920929 0.800000011920929 0.800000011920929 1.0
diffuse 1.0 1.0 1.0 1.0
specular 0.0 0.0 0.0 1.0 12.5
emissive 0.0 0.0 0.0 1.0
alpha_to_coverage off
cull_hardware clockwise
depth_write on
scene_blend one zero
texture_unit
{
texture FlyAmanitaMushroom.jpg
tex_address_mode wrap
scale 1.0 1.0
colour_op modulate
}
}
}
}
material RuinedLorry
{
receive_shadows on
technique
{
pass
{
ambient 0.500000 0.500000 0.500000 1.000000
diffuse 0.640000 0.640000 0.640000 1.000000
specular 0.500000 0.500000 0.500000 1.000000 12.500000
emissive 0.000000 0.000000 0.000000 1.000000
texture_unit
{
texture ruinedlorry.jpg
tex_address_mode wrap
filtering trilinear
}
}
}
}
material SpinWheelBaseAlt
{
receive_shadows on
technique
{
pass
{
ambient 0.500000 0.500000 0.500000 1.000000
diffuse 1.000000 1.000000 1.000000 1.000000
specular 0.500000 0.500000 0.500000 1.000000 12.500000
emissive 0.000000 0.000000 0.000000 1.000000
texture_unit
{
texture SpinWheelBaseAlt.jpg
tex_address_mode wrap
filtering trilinear
}
}
}
}
material SpinWheelGearRed
{
receive_shadows on
technique
{
pass
{
ambient 0.500000 0.500000 0.500000 1.000000
diffuse 1.000000 1.000000 1.000000 1.000000
specular 0.500000 0.500000 0.500000 1.000000 12.500000
emissive 0.000000 0.000000 0.000000 1.000000
texture_unit
{
texture SpinWheelGearRed.jpg
tex_address_mode wrap
filtering trilinear
}
}
}
}
material SpinWheelGearBlue
{
receive_shadows on
technique
{
pass
{
ambient 0.500000 0.500000 0.500000 1.000000
diffuse 1.000000 1.000000 1.000000 1.000000
specular 0.500000 0.500000 0.500000 1.000000 12.500000
emissive 0.000000 0.000000 0.000000 1.000000
texture_unit
{
texture SpinWheelGearBlue.jpg
tex_address_mode wrap
filtering trilinear
}
}
}
}
material IdolGrayColor
{
receive_shadows on
technique
{
pass
{
ambient 0.5 0.5 0.5 1.000000
diffuse 0.4 0.37 0.35 1.000000
specular 0.266613 0.266613 0.266613 1.000000 12.500000
emissive 0.000000 0.000000 0.000000 1.000000
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -0,0 +1,9 @@
[DefCore]
id=LotsOfCoins
Version=5,2,0,1
Category=C4D_StaticBack
Width=55
Height=17
Offset=-27,-8
Mass=1000
Components=GoldBar=20

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

View File

@ -0,0 +1,16 @@
[DefCore]
id=Bone
Version=5,2,0,1
Category=C4D_Object
Width=8
Height=8
Offset=-4,-4
Vertices=2
VertexX=-3,3
VertexY=-3,3
VertexFriction=50,50
Value=1
Mass=2
Components=Wood=1
Rotate=1
StretchGrowth=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

@ -0,0 +1,12 @@
/*--- A Bone ---*/
protected func Hit()
{
Sound("GeneralHit*");
return 1;
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";
local Plane = 410;

View File

@ -0,0 +1,2 @@
Name=Knochen
Description=Relikt des Lebens.

View File

@ -0,0 +1,2 @@
Name=Bone
Description=Relic of life.

View File

@ -1,6 +1,6 @@
[DefCore]
id=Ruin3
Version=5,2,90,21
id=Ruin_ChemicalLab
Version=5,4,0,0
Category=C4D_Structure
Width=50
Height=52
@ -9,6 +9,4 @@ Vertices=6
VertexX=-1,10,20,-23,-23,0
VertexY=-17,-25,-14,25,25,25
VertexFriction=50,50,50,100,100,100
Value=20
Mass=500
Components=Wood=3;Metal=3

View File

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -0,0 +1,13 @@
/**
ChemicalLab Ruin
@author Sven2
*/
/*-- Properties --*/
local Name = "$Name$";
local Description = "$Description$";
local BlastIncinerate = 100;
local HitPoints = 70;

View File

@ -0,0 +1,2 @@
Name=Chemielabor Ruine
Description=Relikt vergangener Siedlungen.

View File

@ -0,0 +1,2 @@
Name=Chemical lab ruin
Description=Relic of past settlements.

View File

@ -1,6 +1,6 @@
[DefCore]
id=Ruin2
Version=5,2,0,1
id=Ruin_Windmill
Version=5,4,0,0
Category=C4D_Structure
Width=80
Height=96
@ -9,6 +9,4 @@ Vertices=5
VertexX=0,25,15,-15,-25
VertexY=-10,-20,47,47,-20
VertexFriction=50,50,100,100,50
Value=5
Mass=100
Components=Rock=6;Wood=2;
Mass=500

View File

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

View File

@ -0,0 +1,13 @@
/**
Windmill Ruin
@author Sven2
*/
/*-- Properties --*/
local Name = "$Name$";
local Description = "$Description$";
local BlastIncinerate = 100;
local HitPoints = 70;

View File

@ -0,0 +1,2 @@
Name=Windmühle Ruine
Description=Relikt vergangener Siedlungen.

View File

@ -0,0 +1,2 @@
Name=Windmill ruin
Description=Relic of past settlements.

View File

@ -1,6 +1,6 @@
[DefCore]
id=Ruin1
Version=5,2,0,1
id=Ruin_WoodenCabin
Version=5,4,0,0
Category=C4D_Structure
Width=94
Height=43
@ -9,7 +9,5 @@ Vertices=7
VertexX=-26,26,-22,23,-38,-38,40
VertexY=-7,-6,19,19,4,19,19
VertexFriction=50,50,100,100
Value=20
Mass=1000
Components=Wood=5;Rock=4
Rotate=1

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -0,0 +1,13 @@
/**
WoodenCabin Ruin
@author Sven2
*/
/*-- Properties --*/
local Name = "$Name$";
local Description = "$Description$";
local BlastIncinerate = 100;
local HitPoints = 70;

View File

@ -0,0 +1,2 @@
Name=Holzhütte Ruine
Description=Relikt vergangener Siedlungen.

View File

@ -0,0 +1,2 @@
Name=Wooden cabin ruin
Description=Relic of past settlements.

View File

@ -0,0 +1,16 @@
[DefCore]
id=Skull
Version=5,2,0,1
Category=C4D_Object
Width=11
Height=13
Offset=-5,-6
Vertices=5
VertexX=-4,1,5,5,1
VertexY=-5,-4,-5,5,5
VertexFriction=50,50,50,50,50
Value=2
Mass=6
Components=Wood=1
Rotate=1
StretchGrowth=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Some files were not shown because too many files have changed in this diff Show More