Fixed GemRB compilation
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -1,41 +0,0 @@
|
||||
ADD_SUBDIRECTORY( core )
|
||||
ADD_SUBDIRECTORY( plugins )
|
||||
ADD_SUBDIRECTORY( override )
|
||||
ADD_SUBDIRECTORY( GUIScripts )
|
||||
ADD_SUBDIRECTORY( docs )
|
||||
ADD_SUBDIRECTORY( tests )
|
||||
|
||||
ADD_EXECUTABLE(gemrb GemRB.cpp )
|
||||
SET_TARGET_PROPERTIES(gemrb PROPERTIES INSTALL_RPATH ${LIB_DIR})
|
||||
INCLUDE_DIRECTORIES( ${SDL_INCLUDE_DIR} )
|
||||
IF(WIN32)
|
||||
TARGET_LINK_LIBRARIES(gemrb gemrb_core)
|
||||
ELSE(WIN32)
|
||||
IF(APPLE)
|
||||
if (STATIC_LINK)
|
||||
TARGET_LINK_LIBRARIES(gemrb ${SDL_LIBRARY}
|
||||
${SDL_MAIN_LIBRARY_PATH} ${COCOA_LIBRARY_PATH} ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT}
|
||||
gemrb_core ${plugins} -Wl,-all_load)
|
||||
else (STATIC_LINK)
|
||||
TARGET_LINK_LIBRARIES(gemrb gemrb_core ${SDL_LIBRARY}
|
||||
${SDL_MAIN_LIBRARY_PATH} ${COCOA_LIBRARY_PATH} ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif (STATIC_LINK)
|
||||
ELSE(APPLE)
|
||||
if (STATIC_LINK)
|
||||
TARGET_LINK_LIBRARIES(gemrb ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT}
|
||||
-Wl,--whole-archive gemrb_core ${plugins} -Wl,--no-whole-archive)
|
||||
else (STATIC_LINK)
|
||||
TARGET_LINK_LIBRARIES(gemrb gemrb_core ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif (STATIC_LINK)
|
||||
ENDIF(APPLE)
|
||||
ENDIF(WIN32)
|
||||
|
||||
# preconfigure the sample config with the selected paths
|
||||
CONFIGURE_FILE(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/GemRB.cfg.sample.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/GemRB.cfg.sample"
|
||||
IMMEDIATE @ONLY
|
||||
)
|
||||
|
||||
INSTALL( TARGETS gemrb DESTINATION ${BIN_DIR} )
|
||||
INSTALL( FILES "${CMAKE_CURRENT_BINARY_DIR}/GemRB.cfg.sample" GemRB.cfg.noinstall.sample DESTINATION ${SYSCONF_DIR} )
|
||||
@@ -1,256 +0,0 @@
|
||||
#####################################################
|
||||
# #
|
||||
# This is the GemRB Configuration file. #
|
||||
# Here are defined some default parameters for #
|
||||
# basic configuration and paths definition. #
|
||||
# #
|
||||
# Parameters are defined as a Name=Value pair #
|
||||
# The Value can be of three types: #
|
||||
# - String #
|
||||
# - Integer #
|
||||
# - Boolean #
|
||||
# #
|
||||
# The String value is represented as follows #
|
||||
# i.e. H:\GemRB\plugins #
|
||||
# Integers are defined as follows #
|
||||
# i.e. 12723 #
|
||||
# Booleans are represented as 1 or 0 in this file #
|
||||
# #
|
||||
# Lines starting with # are ignored #
|
||||
# #
|
||||
#####################################################
|
||||
|
||||
#####################################################
|
||||
# #
|
||||
# Game Type [String] Use one of the following #
|
||||
# values: #
|
||||
# #
|
||||
# auto Attempt to autodetect game type #
|
||||
# #
|
||||
# bg1 Baldur's Gate #
|
||||
# bg2 Baldur's Gate 2 : SoA or ToB #
|
||||
# tob Baldur's Gate 2 : ToB (obsolete) #
|
||||
# iwd IceWind Dale (no How or ToTL installed)#
|
||||
# how IceWind Dale : HoW or ToTL #
|
||||
# iwd2 IceWind Dale 2 #
|
||||
# pst Planescape Torment #
|
||||
# (More will come) #
|
||||
# #
|
||||
#####################################################
|
||||
|
||||
GameType=test
|
||||
|
||||
#####################################################
|
||||
# Game Name [String] Title for GemRB window, use #
|
||||
# anything you wish, e.g. Baldur's Gate 3: RotFL #
|
||||
#####################################################
|
||||
|
||||
GameName=Baldur's Gate 2
|
||||
|
||||
#####################################################
|
||||
# Video Parameters #
|
||||
#####################################################
|
||||
|
||||
#Screen width
|
||||
Width=640
|
||||
|
||||
#Screen height
|
||||
Height=480
|
||||
|
||||
#Bits per pixel [Integer:16,32]
|
||||
Bpp=32
|
||||
|
||||
#Fullscreen [Boolean]
|
||||
Fullscreen=0
|
||||
|
||||
# Delay before tooltips appear [milliseconds]
|
||||
TooltipDelay=500
|
||||
|
||||
#####################################################
|
||||
# Audio Parameters #
|
||||
#####################################################
|
||||
# #
|
||||
# All volume options are in percents, with 100 #
|
||||
# being the normal and default volume #
|
||||
# #
|
||||
#####################################################
|
||||
|
||||
# Choices: openal (default), sdlaudio (faster, but limited featureset), none
|
||||
#AudioDriver = openal
|
||||
|
||||
# Volume of ambient sounds
|
||||
#VolumeAmbients = 100
|
||||
|
||||
# Volume during movie playback
|
||||
#VolumeMovie = 100
|
||||
|
||||
# Volume of background music
|
||||
#VolumeMusic = 100
|
||||
|
||||
# Volume of sound effects
|
||||
#VolumeSFX = 100
|
||||
|
||||
# Volume of PC or NPC voices
|
||||
#VolumeVoices = 100
|
||||
|
||||
#####################################################
|
||||
# Case Sensitive Filesystem [Boolean] #
|
||||
# #
|
||||
# If your installed game files are residing on a #
|
||||
# case sensitive filesystem (ext2 on Linux) then #
|
||||
# you need to set this value to 1, it has no #
|
||||
# effect on Windows #
|
||||
#####################################################
|
||||
|
||||
#CaseSensitive=1
|
||||
|
||||
#GameOnCD=0
|
||||
|
||||
#####################################################
|
||||
# GUI Parameters #
|
||||
#####################################################
|
||||
# #
|
||||
# GemRB may enhance the GUI of the Infinity Engine #
|
||||
# games (so far only in bg2) creating functionally #
|
||||
# new buttons or scrollbars where they weren't #
|
||||
# present in original games. It may improve its #
|
||||
# usability, but is not quite compatible with #
|
||||
# mods changing graphics and alignment in the *.chu #
|
||||
# files (e.g. the buttons will appear in old #
|
||||
# coordinates and may stop being clickable). #
|
||||
#####################################################
|
||||
|
||||
# Enable all gui enhancements ? [Boolean]
|
||||
GUIEnhancements = 1
|
||||
|
||||
|
||||
#####################################################
|
||||
# Debug #
|
||||
#####################################################
|
||||
|
||||
# Do not play intro videos [Boolean], useful for development
|
||||
#SkipIntroVideos=1
|
||||
|
||||
# Draw Frames per Second info [Boolean]
|
||||
#DrawFPS=1
|
||||
|
||||
# Hide unexplored parts of a map
|
||||
#FogOfWar=1
|
||||
|
||||
# Enable debug and cheat keystrokes, see docs/en/CheatKeys.txt
|
||||
# full listing
|
||||
#EnableCheatKeys=1
|
||||
|
||||
#####################################################
|
||||
# Paths #
|
||||
#####################################################
|
||||
|
||||
#####################################################
|
||||
# Game Paths [String] #
|
||||
# #
|
||||
# These are the paths where the Game you want to #
|
||||
# play is installed. #
|
||||
# Enter the full path to the directory. #
|
||||
#####################################################
|
||||
|
||||
GamePath=../gemrb/tests/minimal
|
||||
CD1=/mnt/windows/Programmi/Black Isle/BGII - SoA/
|
||||
CD2=/mnt/windows/Programmi/Black Isle/BGII - SoA/CD2/
|
||||
CD3=/mnt/windows/Programmi/Black Isle/BGII - SoA/CD3/
|
||||
CD4=/mnt/windows/Programmi/Black Isle/BGII - SoA/CD4/
|
||||
CD5=/mnt/windows/Programmi/Black Isle/BGII - SoA/CD5/
|
||||
|
||||
#####################################################
|
||||
# GemRB Cache Path [String] #
|
||||
# #
|
||||
# This is the path where GemRB will store the #
|
||||
# cached files, enter the full path to the GemRB #
|
||||
# Cache directory. #
|
||||
#####################################################
|
||||
|
||||
CachePath=./gemrb/Cache/
|
||||
|
||||
#####################################################
|
||||
# GemRB Save Path [String] #
|
||||
# #
|
||||
# This is the path where GemRB looks for saved #
|
||||
# games. #
|
||||
# Enter the full path to the directory containing #
|
||||
# e.g. the 'save' subdirectory. #
|
||||
# #
|
||||
# You do not have to specify this if you use save #
|
||||
# subdir in the GamePath directory. #
|
||||
#####################################################
|
||||
|
||||
#SavePath=/mnt/windows/Programmi/Black Isle/BGII - SoA/
|
||||
|
||||
#####################################################
|
||||
# GemRB Path [String] #
|
||||
# #
|
||||
# This is the path where GemRB is stored, just #
|
||||
# enter the full path to the GemRB executable #
|
||||
#####################################################
|
||||
|
||||
GemRBPath=../gemrb
|
||||
|
||||
#####################################################
|
||||
# GemRB GUI Scripts Path [String] #
|
||||
# #
|
||||
# This is the path where GemRB GUI scripts are #
|
||||
# stored, usually these are in the GemRB directory #
|
||||
# Enter the full path to the directory containing #
|
||||
# the 'GUIScript' subdirectory. #
|
||||
#####################################################
|
||||
|
||||
#GUIScriptsPath=./
|
||||
|
||||
#####################################################
|
||||
# GemRB Plugins Path [String] #
|
||||
# #
|
||||
# This is the path containing GemRB plugins #
|
||||
# - shared libraries (.so) on Unixes, or #
|
||||
# DLLs (.dll) on windows. #
|
||||
# Enter the full path to the directory. #
|
||||
# #
|
||||
# You may need to specify this path if running #
|
||||
# GemRB from source directory on Linux. #
|
||||
#####################################################
|
||||
|
||||
PluginsPath=./gemrb/plugins/
|
||||
|
||||
#####################################################
|
||||
# Game Data Path [String] #
|
||||
# #
|
||||
# This is the subdirectory under GamePath where #
|
||||
# game data files are stored. #
|
||||
# #
|
||||
# You probably do NOT want to specify this! #
|
||||
#####################################################
|
||||
|
||||
#GameDataPath=data
|
||||
|
||||
#####################################################
|
||||
# Game Data Override Path [String] #
|
||||
# #
|
||||
# This is the subdirectory under GamePath where #
|
||||
# game data override files are stored. #
|
||||
# #
|
||||
# You probably do NOT want to specify this! #
|
||||
#####################################################
|
||||
|
||||
#GameOverridePath=override
|
||||
|
||||
#####################################################
|
||||
# GemRB Data Override Path [String] #
|
||||
# #
|
||||
# This is the path where GemRB looks for the GemRB #
|
||||
# data override directory. #
|
||||
# #
|
||||
# You probably do NOT want to specify this! #
|
||||
#####################################################
|
||||
|
||||
#GemRBOverridePath=/usr/share/games/gemrb
|
||||
|
||||
#####################################################
|
||||
# END #
|
||||
#####################################################
|
||||
@@ -1,261 +0,0 @@
|
||||
#####################################################
|
||||
# #
|
||||
# This is the GemRB Configuration file. #
|
||||
# Here are defined some default parameters for #
|
||||
# basic configuration and paths definition. #
|
||||
# #
|
||||
# Parameters are defined as a Name=Value pair #
|
||||
# The Value can be of three types: #
|
||||
# - String #
|
||||
# - Integer #
|
||||
# - Boolean #
|
||||
# #
|
||||
# The String value is represented as follows #
|
||||
# i.e. H:\GemRB\plugins #
|
||||
# Integers are defined as follows #
|
||||
# i.e. 12723 #
|
||||
# Booleans are represented as 1 or 0 in this file #
|
||||
# #
|
||||
# Lines starting with # are ignored #
|
||||
# #
|
||||
#####################################################
|
||||
|
||||
#####################################################
|
||||
# #
|
||||
# Game Type [String] Use one of the following #
|
||||
# values: #
|
||||
# #
|
||||
# auto Attempt to autodetect game type #
|
||||
# #
|
||||
# bg1 Baldur's Gate #
|
||||
# bg2 Baldur's Gate 2 : SoA or ToB #
|
||||
# tob Baldur's Gate 2 : ToB (obsolete) #
|
||||
# iwd IceWind Dale (no How or ToTL installed)#
|
||||
# how IceWind Dale : HoW or ToTL #
|
||||
# iwd2 IceWind Dale 2 #
|
||||
# pst Planescape Torment #
|
||||
# (More will come) #
|
||||
# #
|
||||
#####################################################
|
||||
|
||||
GameType=bg2
|
||||
|
||||
#####################################################
|
||||
# Game Name [String] Title for GemRB window, use #
|
||||
# anything you wish, e.g. Baldur's Gate 3: RotFL #
|
||||
#####################################################
|
||||
|
||||
GameName=Baldur's Gate 2
|
||||
|
||||
#####################################################
|
||||
# Video Parameters #
|
||||
#####################################################
|
||||
|
||||
#Screen width
|
||||
Width=640
|
||||
|
||||
#Screen height
|
||||
Height=480
|
||||
|
||||
#Bits per pixel [Integer:16,32]
|
||||
Bpp=32
|
||||
|
||||
#Fullscreen [Boolean]
|
||||
Fullscreen=0
|
||||
|
||||
# Delay before tooltips appear [milliseconds]
|
||||
TooltipDelay=500
|
||||
|
||||
#####################################################
|
||||
# Audio Parameters #
|
||||
#####################################################
|
||||
# #
|
||||
# All volume options are in percents, with 100 #
|
||||
# being the normal and default volume #
|
||||
# #
|
||||
#####################################################
|
||||
|
||||
# Choices: openal (default), sdlaudio (faster, but limited featureset), none
|
||||
#AudioDriver = openal
|
||||
|
||||
# Volume of ambient sounds
|
||||
#VolumeAmbients = 100
|
||||
|
||||
# Volume during movie playback
|
||||
#VolumeMovie = 100
|
||||
|
||||
# Volume of background music
|
||||
#VolumeMusic = 100
|
||||
|
||||
# Volume of sound effects
|
||||
#VolumeSFX = 100
|
||||
|
||||
# Volume of PC or NPC voices
|
||||
#VolumeVoices = 100
|
||||
|
||||
#####################################################
|
||||
# Case Sensitive Filesystem [Boolean] #
|
||||
# #
|
||||
# If your installed game files are residing on a #
|
||||
# case sensitive filesystem (ext2 on Linux) then #
|
||||
# you need to set this value to 1, it has no #
|
||||
# effect on Windows #
|
||||
#####################################################
|
||||
|
||||
#CaseSensitive=1
|
||||
|
||||
#GameOnCD=0
|
||||
|
||||
#####################################################
|
||||
# GUI Parameters #
|
||||
#####################################################
|
||||
# #
|
||||
# GemRB may enhance the GUI of the Infinity Engine #
|
||||
# games (so far only in bg2) creating functionally #
|
||||
# new buttons or scrollbars where they weren't #
|
||||
# present in original games. It may improve its #
|
||||
# usability, but is not quite compatible with #
|
||||
# mods changing graphics and alignment in the *.chu #
|
||||
# files (e.g. the buttons will appear in old #
|
||||
# coordinates and may stop being clickable). #
|
||||
#####################################################
|
||||
|
||||
# Enable all gui enhancements ? [Boolean]
|
||||
GUIEnhancements = 1
|
||||
|
||||
|
||||
#####################################################
|
||||
# Debug #
|
||||
#####################################################
|
||||
|
||||
# Do not play intro videos [Boolean], useful for development
|
||||
#SkipIntroVideos=1
|
||||
|
||||
# Draw Frames per Second info [Boolean]
|
||||
#DrawFPS=1
|
||||
|
||||
# Hide unexplored parts of a map
|
||||
#FogOfWar=1
|
||||
|
||||
# Enable debug and cheat keystrokes, see docs/en/CheatKeys.txt
|
||||
# full listing
|
||||
#EnableCheatKeys=1
|
||||
|
||||
#####################################################
|
||||
# Paths #
|
||||
#####################################################
|
||||
|
||||
#####################################################
|
||||
# Game Paths [String] #
|
||||
# #
|
||||
# These are the paths where the Game you want to #
|
||||
# play is installed. #
|
||||
# Enter the full path to the directory. #
|
||||
#####################################################
|
||||
|
||||
GamePath=/mnt/windows/Programmi/Black Isle/BGII - SoA/
|
||||
CD1=/mnt/windows/Programmi/Black Isle/BGII - SoA/
|
||||
CD2=/mnt/windows/Programmi/Black Isle/BGII - SoA/CD2/
|
||||
CD3=/mnt/windows/Programmi/Black Isle/BGII - SoA/CD3/
|
||||
CD4=/mnt/windows/Programmi/Black Isle/BGII - SoA/CD4/
|
||||
CD5=/mnt/windows/Programmi/Black Isle/BGII - SoA/CD5/
|
||||
|
||||
#####################################################
|
||||
# GemRB Cache Path [String] #
|
||||
# #
|
||||
# This is the path where GemRB will store the #
|
||||
# cached files, enter the full path to the GemRB #
|
||||
# Cache directory. #
|
||||
#####################################################
|
||||
|
||||
CachePath=./Cache/
|
||||
|
||||
#####################################################
|
||||
# GemRB Save Path [String] #
|
||||
# #
|
||||
# This is the path where GemRB looks for saved #
|
||||
# games. #
|
||||
# Enter the full path to the directory containing #
|
||||
# e.g. the 'save' subdirectory. #
|
||||
# #
|
||||
# You do not have to specify this if you use save #
|
||||
# subdir in the GamePath directory. #
|
||||
#####################################################
|
||||
|
||||
#SavePath=/mnt/windows/Programmi/Black Isle/BGII - SoA/
|
||||
|
||||
###### HERE BE DRAGONS #############################
|
||||
###### HERE BE DRAGONS #############################
|
||||
###### HERE BE DRAGONS #############################
|
||||
# You shouldn't need to change anything below this point.
|
||||
|
||||
#####################################################
|
||||
# GemRB Path [String] #
|
||||
# #
|
||||
# This is the path where GemRB is stored, just #
|
||||
# enter the full path to the GemRB executable #
|
||||
#####################################################
|
||||
|
||||
#GemRBPath=@DATA_DIR@
|
||||
|
||||
#####################################################
|
||||
# GemRB GUI Scripts Path [String] #
|
||||
# #
|
||||
# This is the path where GemRB GUI scripts are #
|
||||
# stored, usually these are in the GemRB directory #
|
||||
# Enter the full path to the directory containing #
|
||||
# the 'GUIScript' subdirectory. #
|
||||
#####################################################
|
||||
|
||||
#GUIScriptsPath=@DATA_DIR@
|
||||
|
||||
#####################################################
|
||||
# GemRB Plugins Path [String] #
|
||||
# #
|
||||
# This is the path containing GemRB plugins #
|
||||
# - shared libraries (.so) on Unixes, or #
|
||||
# DLLs (.dll) on windows. #
|
||||
# Enter the full path to the directory. #
|
||||
# #
|
||||
# You may need to specify this path if running #
|
||||
# GemRB from source directory on Linux. #
|
||||
#####################################################
|
||||
|
||||
#PluginsPath=@PLUGIN_DIR@
|
||||
|
||||
#####################################################
|
||||
# Game Data Path [String] #
|
||||
# #
|
||||
# This is the subdirectory under GamePath where #
|
||||
# game data files are stored. #
|
||||
# #
|
||||
# You probably do NOT want to specify this! #
|
||||
#####################################################
|
||||
|
||||
#GameDataPath=data
|
||||
|
||||
#####################################################
|
||||
# Game Data Override Path [String] #
|
||||
# #
|
||||
# This is the subdirectory under GamePath where #
|
||||
# game data override files are stored. #
|
||||
# #
|
||||
# You probably do NOT want to specify this! #
|
||||
#####################################################
|
||||
|
||||
#GameOverridePath=override
|
||||
|
||||
#####################################################
|
||||
# GemRB Data Override Path [String] #
|
||||
# #
|
||||
# This is the path where GemRB looks for the GemRB #
|
||||
# data override directory. #
|
||||
# #
|
||||
# You probably do NOT want to specify this! #
|
||||
#####################################################
|
||||
|
||||
#GemRBOverridePath=@DATA_DIR@
|
||||
|
||||
#####################################################
|
||||
# END #
|
||||
#####################################################
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <SDL/SDL.h>
|
||||
#include "audio.h"
|
||||
#include "Audio.h"
|
||||
|
||||
// pause audio playing if app goes in background
|
||||
static void appPutToBackground()
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
bin_PROGRAMS = gemrb
|
||||
sysconf_DATA = GemRB.cfg.sample.in
|
||||
gemrb_SOURCES = GemRB.cpp
|
||||
|
||||
gemrb_LDADD = ./core/libgemrb_core.la
|
||||
|
||||
SUBDIRS = core plugins includes GUIScripts override docs
|
||||
EXTRA_DIST = GemRB.cfg* plugins-prepare.sh CMakeLists.txt
|
||||
|
||||
gemrb_LDFLAGS = $(all_libraries) @LIBPTHREAD@
|
||||
|
||||
#install-data-local:
|
||||
# $(INSTALL_DATA) GemRB.cfg* $(sysconfdir)
|
||||
@@ -1,213 +0,0 @@
|
||||
/* GemRB - Infinity Engine Emulator
|
||||
* Copyright (C) 2003 The GemRB Project
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include "System/CachedFileStream.h"
|
||||
|
||||
#include "win32def.h"
|
||||
|
||||
#include "Interface.h"
|
||||
|
||||
CachedFileStream::CachedFileStream(const char* stream, bool autoFree)
|
||||
{
|
||||
ExtractFileFromPath( filename, stream );
|
||||
PathJoin( originalfile, core->CachePath, filename, NULL );
|
||||
|
||||
str = _fopen( originalfile, "rb" );
|
||||
if (str == NULL) { // File was not found in cache
|
||||
if (core->GameOnCD) {
|
||||
_FILE* src = _fopen( stream, "rb" );
|
||||
#ifdef _DEBUG
|
||||
core->CachedFileStreamPtrCount++;
|
||||
#endif
|
||||
_FILE* dest = _fopen( originalfile, "wb" );
|
||||
#ifdef _DEBUG
|
||||
core->CachedFileStreamPtrCount++;
|
||||
#endif
|
||||
void* buff = malloc( 1024 * 1000 );
|
||||
do {
|
||||
size_t len = _fread( buff, 1, 1024 * 1000, src );
|
||||
size_t c = _fwrite( buff, 1, len, dest );
|
||||
if (c != len) {
|
||||
printf("CachedFileStream failed to write to cached file '%s' (from '%s')\n", originalfile, stream);
|
||||
abort();
|
||||
}
|
||||
} while (!_feof( src ));
|
||||
free( buff );
|
||||
_fclose( src );
|
||||
#ifdef _DEBUG
|
||||
core->CachedFileStreamPtrCount--;
|
||||
#endif
|
||||
_fclose( dest );
|
||||
#ifdef _DEBUG
|
||||
core->CachedFileStreamPtrCount--;
|
||||
#endif
|
||||
} else { // Don't cache files already on hdd
|
||||
strncpy(originalfile, stream, _MAX_PATH);
|
||||
}
|
||||
str = _fopen( originalfile, "rb" );
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
core->CachedFileStreamPtrCount++;
|
||||
#endif
|
||||
startpos = 0;
|
||||
_fseek( str, 0, SEEK_END );
|
||||
size = _ftell( str );
|
||||
_fseek( str, 0, SEEK_SET );
|
||||
Pos = 0;
|
||||
this->autoFree = autoFree;
|
||||
}
|
||||
|
||||
CachedFileStream::CachedFileStream(CachedFileStream* cfs, int startpos,
|
||||
int size, bool autoFree)
|
||||
{
|
||||
this->size = size;
|
||||
this->startpos = startpos;
|
||||
this->autoFree = autoFree;
|
||||
char cpath[_MAX_PATH];
|
||||
PathJoin( cpath, core->CachePath, cfs->filename, NULL );
|
||||
str = _fopen( cpath, "rb" );
|
||||
if (str == NULL) {
|
||||
str = _fopen( cfs->originalfile, "rb" );
|
||||
if (str == NULL) {
|
||||
printf( "Can't open stream (maybe leaking?)\n" );
|
||||
return;
|
||||
}
|
||||
strncpy( originalfile, cfs->originalfile, sizeof(originalfile) );
|
||||
strncpy( filename, cfs->filename, sizeof(filename) );
|
||||
} else {
|
||||
strncpy( originalfile, cpath, sizeof(originalfile) );
|
||||
strncpy( filename, cfs->filename, sizeof(filename) );
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
core->CachedFileStreamPtrCount++;
|
||||
#endif
|
||||
_fseek( str, startpos, SEEK_SET );
|
||||
|
||||
|
||||
Pos = 0;
|
||||
}
|
||||
|
||||
CachedFileStream::~CachedFileStream(void)
|
||||
{
|
||||
if (autoFree && str) {
|
||||
#ifdef _DEBUG
|
||||
core->CachedFileStreamPtrCount--;
|
||||
#endif
|
||||
_fclose( str );
|
||||
}
|
||||
str = NULL;
|
||||
//autoFree = false; //File stream destructor hack
|
||||
}
|
||||
|
||||
int CachedFileStream::Read(void* dest, unsigned int length)
|
||||
{
|
||||
//we don't allow partial reads anyway, so it isn't a problem that
|
||||
//i don't adjust length here (partial reads are evil)
|
||||
if (Pos+length>size ) {
|
||||
return GEM_ERROR;
|
||||
}
|
||||
|
||||
unsigned int c = (unsigned int) _fread( dest, 1, length, str );
|
||||
if (c != length) {
|
||||
return GEM_ERROR;
|
||||
}
|
||||
if (Encrypted) {
|
||||
ReadDecrypted( dest, c );
|
||||
}
|
||||
Pos += c;
|
||||
return c;
|
||||
}
|
||||
|
||||
int CachedFileStream::Write(const void* src, unsigned int length)
|
||||
{
|
||||
// do encryption here if needed
|
||||
|
||||
unsigned int c = (unsigned int) _fwrite( src, 1, length, str );
|
||||
if (c != length) {
|
||||
return GEM_ERROR;
|
||||
}
|
||||
Pos += c;
|
||||
//this is needed only if you want to Seek in a written file
|
||||
if (Pos>size) {
|
||||
size = Pos;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
int CachedFileStream::Seek(int newpos, int type)
|
||||
{
|
||||
switch (type) {
|
||||
case GEM_CURRENT_POS:
|
||||
_fseek( str, newpos, SEEK_CUR );
|
||||
Pos += newpos;
|
||||
break;
|
||||
|
||||
case GEM_STREAM_START:
|
||||
_fseek( str, startpos + newpos, SEEK_SET );
|
||||
Pos = newpos;
|
||||
break;
|
||||
|
||||
default:
|
||||
return GEM_ERROR;
|
||||
}
|
||||
//we went past the buffer
|
||||
if (Pos>size) {
|
||||
printf("[Streams]: Invalid seek position: %ld (limit: %ld)\n",Pos, size);
|
||||
return GEM_ERROR;
|
||||
}
|
||||
return GEM_OK;
|
||||
}
|
||||
|
||||
/** No descriptions */
|
||||
int CachedFileStream::ReadLine(void* buf, unsigned int maxlen)
|
||||
{
|
||||
if (!maxlen) {
|
||||
return 0;
|
||||
}
|
||||
unsigned char * p = ( unsigned char * ) buf;
|
||||
if (_feof( str )) {
|
||||
p[0]=0;
|
||||
return -1;
|
||||
}
|
||||
if (Pos >= size) {
|
||||
p[0]=0;
|
||||
return -1;
|
||||
}
|
||||
unsigned int i = 0;
|
||||
while (i < ( maxlen - 1 )) {
|
||||
int ch = _fgetc( str );
|
||||
if (Pos == size)
|
||||
break;
|
||||
if (Encrypted)
|
||||
ch ^= GEM_ENCRYPTION_KEY[Pos & 63];
|
||||
Pos++;
|
||||
if (( ( char ) ch ) == '\n')
|
||||
break;
|
||||
if (( ( char ) ch ) == '\t')
|
||||
ch = ' ';
|
||||
if (( ( char ) ch ) != '\r')
|
||||
p[i++] = ch;
|
||||
//Warning:this feof implementation reads forward one byte
|
||||
if (_feof( str ))
|
||||
break;
|
||||
}
|
||||
p[i] = 0;
|
||||
return i;
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
/* GemRB - Infinity Engine Emulator
|
||||
* Copyright (C) 2003 The GemRB Project
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CACHEDFILESTREAM_H
|
||||
#define CACHEDFILESTREAM_H
|
||||
|
||||
#include "System/DataStream.h"
|
||||
|
||||
#include "exports.h"
|
||||
|
||||
class GEM_EXPORT CachedFileStream : public DataStream// : public FileStream
|
||||
{
|
||||
private:
|
||||
bool autoFree;
|
||||
unsigned long startpos;
|
||||
_FILE* str;
|
||||
public:
|
||||
CachedFileStream(const char* stream, bool autoFree = true);
|
||||
CachedFileStream(CachedFileStream* cfs, int startpos, int size,
|
||||
bool autoFree = true);
|
||||
~CachedFileStream(void);
|
||||
int Read(void* dest, unsigned int length);
|
||||
int Write(const void* src, unsigned int length);
|
||||
int Seek(int pos, int startpos);
|
||||
/** No descriptions */
|
||||
int ReadLine(void* buf, unsigned int maxlen);
|
||||
};
|
||||
#endif
|
||||
@@ -1,35 +0,0 @@
|
||||
/* GemRB - Infinity Engine Emulator
|
||||
* Copyright (C) 2011 The GemRB Project
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <android/log.h>
|
||||
|
||||
int android_log_printf(const char * fmt, ...) {
|
||||
int return_value;
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
int characters = vfprintf(stdout, fmt, ap); // determine buffer size
|
||||
if(characters<0) return characters;
|
||||
char* buff = new char[characters+1];
|
||||
return_value = vsprintf(buff, fmt, ap);
|
||||
va_end(ap);
|
||||
__android_log_print(ANDROID_LOG_INFO, "printf:", buff);
|
||||
delete buff;
|
||||
return return_value;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
/* GemRB - Infinity Engine Emulator
|
||||
* Copyright (C) 2011 The GemRB Project
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef IE_ANDROID_LOG_PRINTF_H
|
||||
#define IE_ANDROID_LOG_PRINTF_H
|
||||
|
||||
int android_log_printf(const char * fmt, ...);
|
||||
|
||||
#endif
|
||||
@@ -1 +0,0 @@
|
||||
ADD_SUBDIRECTORY( en )
|
||||
@@ -1 +0,0 @@
|
||||
SUBDIRS = en
|
||||
@@ -1,7 +0,0 @@
|
||||
INSTALL(
|
||||
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
DESTINATION ${DOC_DIR}
|
||||
PATTERN CMakeLists.txt EXCLUDE
|
||||
PATTERN Makefile.am EXCLUDE
|
||||
PATTERN doxygen/* EXCLUDE
|
||||
)
|
||||
@@ -1,88 +0,0 @@
|
||||
CHEAT AND DEBUG KEYS
|
||||
--------------------
|
||||
|
||||
|
||||
Following is a list of cheats you can use during development of GemRB.
|
||||
If you implement a new cheatkey, try to assign the same key as in the
|
||||
original engine (if you implement a similar function).
|
||||
This list can be incomplete and obsolete - for current status, look into
|
||||
gemrb/plugins/Core/GameControl.cpp, functions GameControl::OnKeyRelease()
|
||||
and GameControl::Draw().
|
||||
|
||||
Cheat keys are disabled by default. To activate them, either type command
|
||||
GemRB.EnableCheatKeys(1) on console (pops-up with CTRL+SPACE key combination)
|
||||
or put it into some GUIScript - e.g. for PS:T in Start.py.
|
||||
|
||||
GameControl control must be focused for the keys to be recognized, so it
|
||||
might be needed to 'click' the GameControl (i.e. map) first.
|
||||
|
||||
|
||||
Ctrl-A - Alters the animation ID of the actor. You have to hover your
|
||||
mouse over it.
|
||||
|
||||
Ctrl-B - Draws path from start point marked by Ctrl-O to current mouse
|
||||
position.
|
||||
|
||||
Ctrl-C - Force casts a hardcoded spell. The last selected actor is the
|
||||
caster and the target is the door/actor currently under the
|
||||
pointer. This currently casts knock (SPWI207).
|
||||
|
||||
Ctrl-D - Trap or trapped container pointed w/ mouse is disarmed.
|
||||
|
||||
Ctrl-F - Toggles fullscreen mode
|
||||
|
||||
Ctrl-G - Dumps the global (game) object. Currently shows only loaded areas.
|
||||
|
||||
Ctrl-I - Triggers an interaction between the last pointed npc and a random
|
||||
party member.
|
||||
|
||||
Ctrl-J - Teleports (jumps) selected actors to current mouse position.
|
||||
|
||||
Ctrl-K - Kicks the actor out of the party.
|
||||
|
||||
Ctrl-L - Plays the S056ICBL animation over the actor. (This exists in PST only)
|
||||
TODO: iterate through animations, like the IE does.
|
||||
|
||||
Ctrl-M - Prints (on terminal or DOS window) useful info on pointed actor, door
|
||||
container or infopoint and current map
|
||||
|
||||
Ctrl-O - Marks current mouse position as start point (origin) for path drawn
|
||||
with Ctrl-B
|
||||
|
||||
Ctrl-P - Centers the viewport on the selected actor.
|
||||
|
||||
Ctrl-Q - The pointed actor will join the party.
|
||||
|
||||
Ctrl-R - Resurrects pointed actor. If she's already alive, just heals.
|
||||
|
||||
Ctrl-S - Alters the stance (animation state) of the actor. You have to
|
||||
hover your mouse over it.
|
||||
|
||||
Ctrl-T - Advances time by one hour.
|
||||
|
||||
Ctrl-V - Explores a small, random part of the pointed area.
|
||||
|
||||
Ctrl-X - Prints (on terminal or DOS window) name of current area script
|
||||
and current mouse position converted to game coordinates.
|
||||
|
||||
Ctrl-Y - Kills pointed actor or unlocks the pointed door/container, even
|
||||
if it requires a key.
|
||||
|
||||
Ctrl-Z - Same as Ctrl-A but backward
|
||||
|
||||
Ctrl-1 - Changes the armour level
|
||||
|
||||
Ctrl-4 - Toggles debug flag DEBUG_SHOW_INFOPOINTS (show all
|
||||
traps, infopoints and wallgroups)
|
||||
|
||||
Ctrl-6 - Toggles debug flag DEBUG_SHOW_LIGHTMAP (show the lightmap)
|
||||
|
||||
Ctrl-7 - Toggle drawing of Fog-Of-War (actually explored bitmap atm.)
|
||||
in GameControl.
|
||||
|
||||
Ctrl-8 - Toggle drawing of searchmap over the area in GameControl.
|
||||
|
||||
ALT - Toggles debug flag DEBUG_SHOW_CONTAINERS (show all containers
|
||||
and doors)
|
||||
|
||||
TAB - Sets debug flag DEBUG_XXX while pressed (unused)
|
||||
@@ -1,9 +0,0 @@
|
||||
Header file include order.
|
||||
|
||||
- Header file associated to cpp file, or plugin base class header.
|
||||
- Additional plugin headers.
|
||||
- Headers in includes.
|
||||
- Headers in core followed by subdirectories.
|
||||
- System and library headers.
|
||||
|
||||
Each item should be sorted in ascii order, and separated by blank lines.
|
||||
@@ -1,36 +0,0 @@
|
||||
There are 4 distinct palettes.
|
||||
|
||||
Known values of palette (p) are:
|
||||
0 Body
|
||||
1 Weapon
|
||||
2 Shield (or Off-hand weapon)
|
||||
3 Helmet
|
||||
|
||||
Each has 7 colour slots at most.
|
||||
Known values of slots (s) are:
|
||||
Body:
|
||||
0 - Metal
|
||||
1 - Minor
|
||||
2 - Major
|
||||
3 - Skin
|
||||
4 - Leather
|
||||
5 - Armor
|
||||
6 - Hair
|
||||
|
||||
Weapon:
|
||||
0 - Crossguard
|
||||
..
|
||||
5 - Grip
|
||||
6 - Blade
|
||||
|
||||
etc.
|
||||
|
||||
The combined palette location is given in <p><s> format, where both numbers are 4 bits.
|
||||
|
||||
|
||||
|
||||
In GemRB we store these values in the 7 stats starting at IE_COLORS.
|
||||
Each stat stores four colour gradients (each as a byte).
|
||||
The n-th stat contains the n-th colour for body, weapon, shield, helmet, from
|
||||
least significant to most significant byte.
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
|
||||
Container specification (based on IESDP)
|
||||
|
||||
Relevant structures:
|
||||
--------------------
|
||||
|
||||
typedef struct {
|
||||
char containername[32];
|
||||
short posx, posy;
|
||||
short type;
|
||||
short lockdiff;
|
||||
long flags;
|
||||
short trapdetect;
|
||||
short trapremove;
|
||||
short trapped;
|
||||
short trapvisible;
|
||||
short launchx, launchy;
|
||||
short p1x, p1y, p2x, p2y; //minimum bounding box
|
||||
long firstitem;
|
||||
long itemcount;
|
||||
char trapscript[8];
|
||||
long firstvertex;
|
||||
short vertexcount;
|
||||
short unknown56;
|
||||
char scriptname[32];
|
||||
char keyitem[8];
|
||||
short unknown80;
|
||||
short unknown82;
|
||||
long strref; //STRREF!!!
|
||||
char unused[56];
|
||||
} area_container;
|
||||
|
||||
|
||||
Description:
|
||||
------------
|
||||
The container's name is not really relevant, it is used only in editors. Scripts reference a container by
|
||||
the scriptname field. The container's position determines the opening location.
|
||||
All container types are similar, except that only a few got a special graphics (BAM), see containr.2da in GemRB.
|
||||
The ground piles are special containers of type 4. Ground pile containers show the item's ground icon instead of
|
||||
the container's trigger polygon. Containers could be locked, the lockdiff field determines the difficulty to open
|
||||
them by force. The trapdetect and trapremove fields determine the trap detection and removal difficulties.
|
||||
The trapped field shows if the trap is still trapped, and the trapvisible field (GemRB implements it as a countdown)
|
||||
shows if the trap is still visible. The launch point determines the origin of spells cast by the trap script.
|
||||
The bounding box has effect on the polygon only. The trapscript is not necessarily a trap, this script is always running
|
||||
not like the door's script. There are several triggers that might affect this script. (OpenFail, Open, Lockpick fail).
|
||||
The firstitem/itemcount fields point to the inventory of the container (or ground pile).
|
||||
The keyitem determines if there is a key. (There should be a keyremoval field like with doors, but it isn't yet found).
|
||||
The strref is the openfail message (when it is 100% impossible to open).
|
||||
|
||||
Container flags:
|
||||
----------------
|
||||
0x00000001 - The container is locked, opening by brute force, key or lockpick is needed.
|
||||
0x00000002 - ?
|
||||
0x00000004 - ?
|
||||
0x00000008 - The script isn't removed when it is triggered.
|
||||
0x00000010 - ?
|
||||
0x00000020 - The container is disabled, the polygon is still active, but the container is not accessible to PC's
|
||||
@@ -1,101 +0,0 @@
|
||||
|
||||
Door specification (based on IESDP)
|
||||
|
||||
Relevant structures:
|
||||
--------------------
|
||||
|
||||
typedef struct {
|
||||
char doorid[8]; //matched with area_door.doorid
|
||||
short closed; //this is largely unknown, probably it shows which tile represents the closed state
|
||||
short firstdoortileidx; //door tile cell indices are 16 bit values
|
||||
short countdoortileidx;
|
||||
short countpolygonopen; //wallpolygon count for the open door state
|
||||
short countpolygonclose; //wallpolygon count for the closed door state
|
||||
long offsetpolygonopen; //wallpolygon offset for the open door state
|
||||
long offsetpolygonclose; //wallpolygon offset for the closed door state
|
||||
} wed_door;
|
||||
|
||||
typedef struct {
|
||||
char doorname[32]; //scripting name
|
||||
char doorid[8]; //wed reference
|
||||
long flags; //door flags, see below
|
||||
long firstvertexopen; //first open vertex index
|
||||
short countvertexopen; //count of open vertices
|
||||
short countvertexclose; //count of closed vertices
|
||||
long firstvertexclose; //first closed vertex index
|
||||
short op1x,op1y,op2x,op2y; //minimum bounding box for open
|
||||
short cp1x,cp1y,cp2x,cp2y; //minimum bounding box for close
|
||||
long firstblockopen; //first open impeded blocks (for searchmap)
|
||||
short countblockopen; //count of open impeded blocks
|
||||
short countblockclose; //count of closed impeded blocks
|
||||
long firstblockclose; //first closed impeded blocks (for searchmap)
|
||||
long unknown54; //unused in tob
|
||||
char openres[8]; //opening sound resource reference
|
||||
char closeres[8]; //closing sound resource reference
|
||||
long cursortype; //mouse cursor type (when mouse is over the door polygon)
|
||||
short trapdetect; //difficulty of detecting a trap
|
||||
short trapremoval; //difficulty of removing a trap
|
||||
short trapflags; //
|
||||
short trapdetflags; //
|
||||
short launchx, launchy; //traps are launched from this point
|
||||
char key[8]; //key item resource reference
|
||||
char openscript[8]; //(trap) script, activated at first triggering (opening door)
|
||||
long locked; //
|
||||
long lockremoval; //difficulty of opening the door
|
||||
short locp1x, locp1y; //open location 1
|
||||
short locp2x, locp2y; //open location 2
|
||||
long strref; //check this for missing strings STRREF!!!
|
||||
char regionlink[24];
|
||||
long nameref; //check this for missing strings STRREF!!!
|
||||
char dlgref[8]; //?
|
||||
char unknownc0[8]; //?
|
||||
} area_door;
|
||||
|
||||
Description:
|
||||
------------
|
||||
|
||||
Scripts reference the door using the doorname field (Scripting Name).
|
||||
The relation between the two structures (wed/area) is established by the doorid field.
|
||||
Each door is a 'wall', the wall polygons are stored in the wed part of the door.
|
||||
The doors also reference two sets of tiles (also in the wed).
|
||||
Each door is a special info point with a separate trigger area (polygon) for the open/closed state.
|
||||
The bounding boxes are used when rendering the trigger area polygons (actually, could be auto-generated).
|
||||
The impeded blocks are superpositioned on the searchmap, they block passage, vision (unless door is transparent) or
|
||||
changing the door's state (unless door is sliding).
|
||||
The opening/closing sounds of a door are modifiable, though there is a default one (PST has no default sounds).
|
||||
If a door is hidden, then the default sound is different.
|
||||
The cursor type applies when the mouse is over the trigger area of the door (both states have the same cursor).
|
||||
If a door has a script assigned and the trap is detectable the trap detection difficulty determines the chance of
|
||||
success. If the difficulty is exactly 100, then it is impossible to detect (a flaw in the original engine lets >100
|
||||
values to be detectable). In the impossible case, a message (strref) will be displayed.
|
||||
The trap removal difficulty is similarly handled. If trapflags is nonzero, then the trap is still active.
|
||||
If Trapdetflags is nonzero, then the trap is still visible. (GemRB will implement the latter as a counter which
|
||||
counts down until 0). The trap (if the script starts a spell) is fired from the launch point.
|
||||
The key resource has meaning only if the door is locked. If it is empty, then the door cannot be unlocked by key.
|
||||
The door is also openable by brute force, the difficulty for this is stored in lockremoval.
|
||||
The actor who operates the door will walk up to the closest of the open locations.
|
||||
Regionlink is a reference to a travel region which is blocked by the door, if the door is closed.
|
||||
//not tested
|
||||
Nameref is the name of the door in case of a dialog. DlgRef is the door's dialog.
|
||||
|
||||
The door flags are these:
|
||||
|
||||
Value Meaning if set
|
||||
----- --------------
|
||||
0x00000001 - The door is closed (PST), the door is open (other games). When a door's state is changed,
|
||||
(OpenDoor/CloseDoor actions), its (trap) script is triggered.
|
||||
0x00000002 - The door is locked, the lock difficulty must be set to nonzero to have this any effect.
|
||||
0x00000004 - The script isn't removed when it is triggered.
|
||||
0x00000008 - The trap (script) is detectable (fair to set it for real traps).
|
||||
0x00000010 - Broken?
|
||||
0x00000020 - Can't close?
|
||||
0x00000040 - An info trigger is linked to this door.
|
||||
0x00000080 - Secret door
|
||||
0x00000100 - Secret door already found (purple outline)
|
||||
0x00000200 - The impeded doors are ignored concerning vision (door is transparent)
|
||||
0x00000400 - The key object is removed when unlocking the door
|
||||
0x00000800 - The impeded blocks are ignored when opening the door (sliding door)
|
||||
0x00001000 - ?
|
||||
0x00002000 - ?
|
||||
0x00004000 - ?
|
||||
0x00008000 - ?
|
||||
@@ -1,116 +0,0 @@
|
||||
A kind of 'specification' for the IE game effects.
|
||||
This description uses the IESDP effect structure definition with updates.
|
||||
|
||||
V1.0 effect struct (you need to convert it to V2 on the fly)
|
||||
typedef struct {
|
||||
short feature; //opcode
|
||||
unsigned char target; //target type
|
||||
unsigned char power; //level
|
||||
parameter par1;
|
||||
parameter par2;
|
||||
unsigned char timing; //timing method
|
||||
unsigned char resist; //resistance type
|
||||
long duration;
|
||||
unsigned char prob2; //usually 100
|
||||
unsigned char prob1; //usually 0
|
||||
char resource[8]; //1. resource
|
||||
long count;
|
||||
long sides;
|
||||
long stype;
|
||||
long sbonus;
|
||||
long unknown2c; //unused in V1.0, but copied over to 2.0
|
||||
} feat_block;
|
||||
|
||||
//effect body (V2.0 effects)
|
||||
//please note that in an .eff file there is an additional header
|
||||
//before these (the first 8 bytes are doubled)
|
||||
Offset Size (data type) Description
|
||||
0x0000 4 (char array) For on disk effects, this is a copy of the Signature field from the header. For embedded EFF V2.0 structures, this is zeroed out.
|
||||
0x0004 4 (char array) For on disk effects, this is a copy of the Version field from the header. For embedded EFF V2.0 structures, this is zeroed out.
|
||||
0x0008 4 (dword) Effect type
|
||||
0x000c 4 (dword) Target type
|
||||
0x0010 4 (dword) Power (level)
|
||||
0x0014 4 (dword) NP1
|
||||
0x0018 4 (dword) NP2
|
||||
0x001c 4 (dword) Flags (timing method)
|
||||
0 - duration
|
||||
1 - permanent
|
||||
2 - while equipped (source of effect)
|
||||
3 - delayed duration (after delay duration)
|
||||
4 - delayed (after delay it is permanent)
|
||||
5 - special, delayed, unsaved
|
||||
6 - special, duration
|
||||
7 - special, ?
|
||||
8 - permanent, unsaved
|
||||
9 - permanent after death
|
||||
10 - trigger (just expired)
|
||||
|
||||
0x0020 4 (dword) Time (duration)
|
||||
0x0024 2 (word) Probability 1
|
||||
0x0026 2 (word) Probability 2
|
||||
0x0028 8 (resref) resource
|
||||
0x0030 4 (dword) die sides/max level
|
||||
0x0034 4 (dword) dice count/min level
|
||||
0x0038 4 (dword) save type (stype)
|
||||
0x003c 4 (dword) save bonus (sbonus)
|
||||
0x0040 4 (dword) Is Variable? (same as 0x2c in EFF V1.0)
|
||||
0x0044 4 (dword) Spell School (used for dispelling)
|
||||
0x0048 4*3 (dword) Unknown
|
||||
0x0054 4 (dword) Resistance Type (resist)
|
||||
0x0058 4 (dword) NP3
|
||||
0x005c 4 (dword) NP4
|
||||
0x0060 4*2 (dword) unknown
|
||||
0x0068 8 (resref) VVC
|
||||
0x0070 8 (resref) 3. resource
|
||||
0x0078 4*2 (point) Source point
|
||||
0x0080 4*2 (point) Target point
|
||||
0x0088 4 (dword) Source type of effect (0 - none, 1 - item, 2 - spell)
|
||||
0x008c 8 (resref) Source of Effect (used for equipping and dispelling)
|
||||
0x0094 4 (dword) resource flags
|
||||
0x0098 4 (dword) projectile
|
||||
0x009c 4 (dword) item slot
|
||||
0x00a0 32 (bytes) variable
|
||||
0x00c0 4*2 (dword) unknown
|
||||
0x00c8 4 (dword) Secondary Type (used for dispelling)
|
||||
0x00cc 4*15 (dword) unknown
|
||||
|
||||
|
||||
An effect's lifecycle:
|
||||
(apply time)
|
||||
1. Check if it affects the target
|
||||
- if percentages don't match, drop it
|
||||
- if level limits don't match, drop it (some effects don't have this)
|
||||
- if resistable, check for resistance (once for an applied block)
|
||||
- if saving throw applies, check for it (once for an applied block)
|
||||
2. If it is a delayed effect
|
||||
- precalculate the time of onset (in game time) (store it in the duration field).
|
||||
- put it on the fx list
|
||||
3. If it is an instant effect (some opcodes ignore delays, so they are always instant)
|
||||
|
||||
(in each update cycle in creatures)
|
||||
1. copy the original stats to the modified stats
|
||||
2. apply all effects in their original order
|
||||
- if the effect isn't in time (delayed or delayed duration, 3 or 4), skip it
|
||||
- if a delayed effect reached time: change it to permanent (i think this is a different permanent)
|
||||
- if a delayed duration effect reached time: change it to duration
|
||||
- if the effect is permanent (1 or 9), apply it (some effects couldn't be permanent, these effects just apply, then go away)
|
||||
- if the effect reached end (duration), set a special timing method (10)
|
||||
- if an effect reached expiration (10) remove it from the queue
|
||||
|
||||
(dispelling/removal)
|
||||
There should be a way of:
|
||||
1. Dispelling all by power level ( remove all effects <= power level)
|
||||
2. Dispelling all by source of effect ( remove all effects == soe)
|
||||
3. Dispelling all or first that matches a spell school or secondary type
|
||||
- there is a 'dispellable' flag in the effects which normally disables dispelling. But there should be a 'forced dispel' flag.
|
||||
4 On death: remove all effects except (9)
|
||||
|
||||
(saving)
|
||||
Effects that are not saved: 2 -'while equipped'
|
||||
|
||||
|
||||
(probability, gemrb specific)
|
||||
If the low probability field was set to 100, then the high probability field contains the
|
||||
stat which determines the chance of the effect. For example:
|
||||
100/136 would determine the chance of the effect based on the caster's detect illusions skill.
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
enginedocs_DATA = *.txt
|
||||
enginedocsdir = $(docdir)/Engine/
|
||||
EXTRA_DIST = *.txt
|
||||
@@ -1,38 +0,0 @@
|
||||
Projectile extension flags for GemRB
|
||||
|
||||
These flags reside in the .pro format on offset 0x2c
|
||||
|
||||
1 Bounce from walls
|
||||
2 Continue on original path as travel projectile after explosion
|
||||
4 Freeze as travel projectile after explosion
|
||||
8 No travel path (move to destination immediately, thus skipping the travel phase)
|
||||
16 Trail bams got the same orientation behaviour as the travel bam
|
||||
32 Curved path
|
||||
64 Random starting frame for travel projectile
|
||||
128 Pillar type projectiles (instead of orientations, the cycles are drawn vertically on top of each other)
|
||||
256 Half transparent travel projectile (not blend, but could be combined with it)
|
||||
512 Static tinted travel projectile
|
||||
1024 Create another projectile with an ID one less than the current one (missile iteration)
|
||||
2048 Tile the whole area of effect with the travel bam
|
||||
4096 Freefalling trajectory (appears horizontally over the target)
|
||||
8192 Incoming trajectory (appears diagonally over the target)
|
||||
16384 The area of effect is a line from source to target
|
||||
32768 The area of effect is a line (wall) crossing target, ahead of source
|
||||
65536 Draw behind (under) the target
|
||||
0x20000 Draw pop in/hold/pop out animation sequence
|
||||
0x40000 Internal flag for 0x20000 (after pop in phase was done) - could be used to play 2 phases, first shadow, then travel bam
|
||||
0x80000 Slowly fade out a freezed projectile (used with flag 0x4)
|
||||
0x100000 Display string in setup (string reference is stored on offset 0x30)
|
||||
0x200000 Random movement instead of path
|
||||
|
||||
These fields are in the .pro format in the Extension structure:
|
||||
0x228 - ResRef - spread animation (RESOURCE2 in areapro.2da)
|
||||
0x230 - ResRef - secondary animation (RESOURCE3 in areapro.2da)
|
||||
0x238 - ResRef - area sound (SOUND2 in areapro.2da)
|
||||
0x240 - Dword - flags in areapro.2da
|
||||
|
||||
Other areapro.2da fields
|
||||
0x21c - ResRef - RESOURCE1
|
||||
0x208 - ResRef - SOUND1
|
||||
|
||||
See areapro.2da for more information.
|
||||
@@ -1,8 +0,0 @@
|
||||
Door Container Travel Trap Info Actor
|
||||
LastEntered Opened - - Entered/IsOverMe - LastHitter
|
||||
LastTrigger Closed - - - Clicked LastSummoner
|
||||
LastUnlocked Unlocked - - - - LastTalkedTo
|
||||
LastDisarmFailed DisarmFailed DisarmFailed - DisarmFailed - LastTarget
|
||||
LastDisarmed Disarmed Disarmed - Disarmed - LastAttacker
|
||||
LastOpenFailed OpenFailed OpenFailed -
|
||||
PickPocketFailed
|
||||
@@ -1,5 +0,0 @@
|
||||
Usability hacks in the original IE engine
|
||||
|
||||
(0x00040000) Assasin - 15 skill points (skills.2da)
|
||||
(0x00080000) Bountyhunter - 20 skill points (skills.2da)
|
||||
(0x00100000) Swashbuckler - no backstab multiplier (TODO)
|
||||
@@ -1,29 +0,0 @@
|
||||
Changes to the original engines
|
||||
*******************************
|
||||
|
||||
|
||||
Generally the changes were designed to be compatible with the original game files. No additional fields added (so far), only previously unused parts are used.
|
||||
|
||||
1. Items entries:
|
||||
Item entries in stores, containers, creatures will have additional flags. These flags will extend the usage of HasItem, DestroyItem, TakeItem scripting functions. The first four flags should be familiar.
|
||||
|
||||
IE_ITEM_IDENTIFIED = 1
|
||||
IE_ITEM_UNSTEALABLE = 2
|
||||
IE_ITEM_STOLEN = 4
|
||||
IE_ITEM_UNDROPPABLE = 8
|
||||
//these are GemRB extensions
|
||||
IE_ITEM_ACQUIRED = 0x10
|
||||
IE_ITEM_DESTRUCTIBLE = 0x20
|
||||
IE_ITEM_EQUIPPED = 0x40
|
||||
IE_ITEM_STACKED = 0x80
|
||||
|
||||
This will make possible scripts like these:
|
||||
HasAnyItem(STOLEN)
|
||||
TakeAllStolenItem()
|
||||
DropAllEquippedItem()
|
||||
HasItem("SWORD",EQUIPPED|IDENTIFIED)
|
||||
|
||||
2. Journal entries:
|
||||
Journal entries will have an additional Group ID. This group ID will make it possible to remove a group of journal entries along with adding a new one of the same group using solely the dialog structure. This eliminates the problem of residue entries. Also, you don't have to remember the journal entry strref, just assign a unique group (quest ID).
|
||||
The quest ID byte will be stored on offset 0x0002 in the transition table entry.
|
||||
The former flags field (it was a dword) will be a word. Its highest bit will be the group flag. Unless this flag is set, the behaviour will be the same as before. If you set this flag, then all journal entries set with the same id will be removed before adding the new one. The scripting actions will also accept an additional quest ID parameter.
|
||||
@@ -1,13 +0,0 @@
|
||||
|
||||
Prototype: ActOnPC(player)
|
||||
|
||||
Metaclass Prototype: /
|
||||
|
||||
Description: Targets the selected PC for an action (cast spell, attack, ...)
|
||||
|
||||
Parameters: player - the pc's party position (1-10)
|
||||
|
||||
Return value: /
|
||||
|
||||
See also: ClearActions, SetModalState, SpellCast
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
Prototype: GemRB.AddGameTypeHint(type, weight, flags=0)
|
||||
|
||||
Description: Asserts that GameType should be TYPE, with confidence WEIGHT.
|
||||
This is used by Autodetect.py scripts when GameType was
|
||||
set to 'auto' in config file.
|
||||
|
||||
Parameters: type - GameType (e.g. bg1, bg2, iwd, how, iwd2, pst and possibly others)
|
||||
weight - numeric, confidence that TYPE is correct. Standard games should use
|
||||
values <= 100, (eventual) new games based on the standard ones
|
||||
should use values above 100.
|
||||
flags - numeric, not used now
|
||||
|
||||
|
||||
Return value: N/A
|
||||
|
||||
MD5: 1c130785e329448b743a7f160b07a312
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
|
||||
Prototype: AdjustScrolling(WindowIndex, ControlIndex, x, y)
|
||||
|
||||
Metaclass Prototype: AdjustScrolling(x, y)
|
||||
|
||||
Description: Sets the scrolling offset of a WorldMapControl.
|
||||
|
||||
Parameters: WindowIndex, ControlIndex - the control's reference
|
||||
x,y - scrolling offset values
|
||||
|
||||
Return value: N/A
|
||||
|
||||
Example:
|
||||
#northeast
|
||||
Button = GemRB.GetControl (Window, 9)
|
||||
GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "MapNE")
|
||||
...
|
||||
def MapNE():
|
||||
GemRB.AdjustScrolling (Window, WorldMapControl, 10, -10)
|
||||
return
|
||||
The above lines set up a button event. When the button is pressed the worldmap will be shifted in the northeastern direction.
|
||||
|
||||
See also: CreateWorldMapControl
|
||||
|
||||
|
||||
MD5: 500775c70886362ce1ebc9353505027f
|
||||
@@ -1,31 +0,0 @@
|
||||
|
||||
Prototype: GemRB.ApplyEffect(PartyID, opcode, param1, param2[, resref, resref2, resref3, source])
|
||||
|
||||
Description: Creates a basic effect and applies it on the player character
|
||||
marked by PartyID.
|
||||
This function could be used to add stats that are stored in effect blocks.
|
||||
|
||||
Parameters:
|
||||
PartyID - the player character's index in the party
|
||||
opcode - the effect opcode (for values see effects.ids)
|
||||
param1 - parameter 1 for the opcode
|
||||
param2 - parameter 2 for the opcode
|
||||
resref - optional resource reference to set in effect
|
||||
resref2 - (optional) resource reference to set in the effect
|
||||
resref3 - (optional) resource reference to set in the effect
|
||||
resref4 - (optional) resource reference to set in the effect
|
||||
source - (optional) source to set in the effect
|
||||
|
||||
Return value: N/A
|
||||
|
||||
Example:
|
||||
for i in range(ProfCount-8):
|
||||
StatID = GemRB.GetTableValue(TmpTable, i+8, 0)
|
||||
Value = GemRB.GetVar ("Prof "+str(i) )
|
||||
if Value:
|
||||
GemRB.ApplyEffect (MyChar, "Proficiency", Value, StatID )
|
||||
|
||||
The above example sets the weapon proficiencies in a bg2's CharGen9.py script.
|
||||
|
||||
See also: SpellCast, SetPlayerStat, GetPlayerStat, CountEffects
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
|
||||
Prototype: GemRB.ApplySpell(PartyID, resref)
|
||||
|
||||
Description: Applies a spell on the actor marked by PartyID.
|
||||
This function can be used to add abilities that are stored as spells (eg. innates)
|
||||
|
||||
Parameters:
|
||||
PartyID - the player character's index in the party
|
||||
resref - spell resource reference
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: SpellCast, ApplyEffect, CountEffects
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
|
||||
Prototype: AttachScrollBar(WindowIndex, ControlIndex, ScrollBarControlIndex)
|
||||
|
||||
Description: Attaches a scrollbar to a control. If the control receives mousewheel events, it will be relayed to the ScrollBar. TextArea controls will also be synchronised with the scrollbar. If there is a single ScrollBar on the window, or the ScrollBar was set with SetDefaultScrollBar, this command is not needed.
|
||||
|
||||
Parameters: WindowIndex, ControlIndex - the control's reference
|
||||
ScrollBarControlIndex - the scrollbar's index on the same window
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: ConvertEdit, SetDefaultScrollBar
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
|
||||
Prototype: GemRB.CanUseItemType(slottype, itemname[, actor, equipped])
|
||||
|
||||
Description: Checks the itemtype vs. slottype, and also checks the usability flags vs. Actor's stats (alignment, class, race, kit etc.)
|
||||
|
||||
Parameters:
|
||||
slottype - the slot to check (See ie_slots.py)
|
||||
itemname - the resource reference of the item
|
||||
actor - the actor's number in the team (if 0, then actor is not unimportant)
|
||||
equipped - whether the item is equipped (if so, don't consider disabled items to be unusable)
|
||||
|
||||
Return value: boolean
|
||||
|
||||
See also: DropDraggedItem, UseItem
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
|
||||
Prototype: ChangeContainerItem( PartyID, slot, action )
|
||||
|
||||
Description: Moves an item from PC's inventory into a container or vice versa. If PartyID is 0 then PC is the first selected PC and container is the current container. If PartyID is not 0 then the container is the pile at the feet of that PC.
|
||||
|
||||
Parameters:
|
||||
PartyID - the PC's position in the party
|
||||
slot - the item's inventory or container slot
|
||||
action =
|
||||
0 - put item of PC into container
|
||||
1 - get item from container and put it in actor's inventory (backpack)
|
||||
|
||||
Return value: None
|
||||
|
||||
See also: GetContainer, GetSlotItem
|
||||
|
||||
|
||||
MD5: b5226a9f5a886c5552438cf1598c72e1
|
||||
@@ -1,28 +0,0 @@
|
||||
|
||||
Prototype: GemRB.ChangeItemFlag(PartyID, slot, flags, mode)
|
||||
|
||||
Description: Changes the flags of an inventory slot. For example, identifies an item.
|
||||
|
||||
Parameters:
|
||||
PartyID - the PC's position in the party (1 based)
|
||||
slot - inventory slot
|
||||
flags - a bitfield, same as the GetSlotItem flags
|
||||
IE_INV_ITEM_IDENTIFIED = 0x01 - the item is identified
|
||||
IE_INV_ITEM_UNSTEALABLE = 0x02 - the item is unstealable
|
||||
IE_INV_ITEM_STOLEN = 0x04 - the item is marked as stolen
|
||||
IE_INV_ITEM_UNDROPPABLE = 0x08 - the item is undroppable (dragitem fails)
|
||||
IE_INV_ITEM_ACQUIRED = 0x10 - the item was recently acquired
|
||||
IE_INV_ITEM_DESTRUCTIBLE = 0x20 - the item is removable
|
||||
IE_INV_ITEM_EQUIPPED = 0x40 - the item is equipped
|
||||
IE_INV_ITEM_STACKED = 0x80 - the item is a stacked item
|
||||
|
||||
mode - binary operation type
|
||||
OP_SET = 0 - sets all bits as flag
|
||||
OP_AND = 1 - turns all other bits off
|
||||
OP_OR = 2 - turns bit on
|
||||
OP_XOR = 3 - toggles bit
|
||||
OP_NAND = 4 - turns bit off
|
||||
|
||||
Return value: Returns false if the item was not found.
|
||||
|
||||
See also: GetSlotItem
|
||||
@@ -1,23 +0,0 @@
|
||||
|
||||
Prototype: ChangeStoreItem( PartyID, slot, action )
|
||||
|
||||
Description: Performs a buy, sell, identify or steal action. Action has the same bit values as IsValidStoreItem.
|
||||
|
||||
Parameters:
|
||||
PartyID - the PC's position in the party
|
||||
slot - the item's inventory or store slot
|
||||
action - bitfield
|
||||
1 - buy
|
||||
2 - sell
|
||||
4 - identify
|
||||
8 - steal
|
||||
Add 0x40 for selection (in case of buy/sell only)
|
||||
|
||||
Return value:
|
||||
0 - failure
|
||||
2 - success
|
||||
|
||||
See also: EnterStore, GetSlotItem, GetStoreItem, IsValidStoreItem
|
||||
|
||||
|
||||
MD5: 07c89de8dbd0236f8c206b06abe4b3dc
|
||||
@@ -1,15 +0,0 @@
|
||||
|
||||
Prototype: GemRB.CheckFeatCondition(partyslot, a_stat, a_value, b_stat, b_value, c_stat, c_value, d_stat, d_value)
|
||||
|
||||
Description: Checks if a party character is eligible for a feat, the formula is: (stat[a]>=a or stat[b]>=b) and (stat[c]>=c or stat[d]>=d)
|
||||
|
||||
Parameters: partyslot - the characters position in the party
|
||||
a_stat,b_stat, c_stat, d_stat - stat IDs
|
||||
a_value, b_value, c_value, d_value - stat value limits
|
||||
|
||||
Return value: bool
|
||||
|
||||
See also: GetPlayerStat, SetPlayerStat
|
||||
|
||||
|
||||
MD5: b237a66b3abbb49ede75897d3d1ee0da
|
||||
@@ -1,16 +0,0 @@
|
||||
|
||||
Prototype: GemRB.CheckVar(VariableName, Context)
|
||||
|
||||
Description: Return (and output on terminal) the value of a Game Variable. It executes the CheckVariable gamescript function in the last actor's context, or, short of that, in the current area's context. If there is no running game, it terminates the script.
|
||||
GetGameVar("variable") is effectively the same as CheckVar("variable","GLOBAL").
|
||||
|
||||
Parameters: VariableName - must be shorter than 32 bytes
|
||||
Context - must be exactly 6 bytes long
|
||||
Special cases for Context: LOCALS, GLOBAL, MYAREA
|
||||
|
||||
Return value: numeric
|
||||
|
||||
See also: GetGameVar
|
||||
|
||||
|
||||
MD5: 872634ab7317e9f381a71f00771f29cd
|
||||
@@ -1,9 +0,0 @@
|
||||
|
||||
Prototype: GemRB.ClearActions(Slot)
|
||||
|
||||
Description: Stops a player character's movement and any pending action.
|
||||
|
||||
Parameters: Slot - actor index in game structure
|
||||
|
||||
Return value: N/A
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
|
||||
Prototype: GemRB.ConvertEdit(WindowIndex, ControlID[, ScrollBarID])
|
||||
|
||||
Description: Converts a TextEdit control into an editable TextArea control. TextAreas have unlimited editbuffer, scrollbar and wordwrap abilities. The optional ScrollBar must already been created.
|
||||
|
||||
Parameters:
|
||||
WindowIndex - the value returned from LoadWindow
|
||||
ControlID - the old control's controlID, usually it will be preserved, but don't rely on it
|
||||
ScrollBarID - the optional ScrollBar controlID.
|
||||
|
||||
Return value: The new ControlID
|
||||
|
||||
See also: CreateTextEdit
|
||||
@@ -1,22 +0,0 @@
|
||||
|
||||
Prototype: GemRB.CountEffects(PartyID, opcode, param1, param2[, resref])
|
||||
|
||||
Description: Counts the number of effects currently affecting the target.
|
||||
If a parameter was set to -1, it will be ignored.
|
||||
|
||||
Parameters:
|
||||
PartyID - the player character's index in the party
|
||||
opcode - the effect opcode (for values see effects.ids)
|
||||
param1 - parameter 1 for the opcode
|
||||
param2 - parameter 2 for the opcode
|
||||
resref - optional resource reference to match the effect
|
||||
|
||||
Return value: N/A
|
||||
|
||||
Example:
|
||||
res = GemRB.CountEffect (MyChar, "HLA", -1, -1, AbilityName )
|
||||
|
||||
The above example returns how many HLA effects were applied on the character.
|
||||
|
||||
See also: ApplyEffect
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
|
||||
Prototype: GemRB.CreateButton(WindowIndex, ControlID, x, y, w, h)
|
||||
|
||||
Metaclass Prototype: CreateButton(ControlID, x, y, w, h)
|
||||
|
||||
Description: Creates and adds a new Button to a Window.
|
||||
|
||||
Parameters:
|
||||
WindowIndex - the value returned from LoadWindow
|
||||
ControlID - the new control will be available via this controlID
|
||||
x,y,w,h - X position, Y position, Width and Height of the control
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: CreateLabel, CreateMapControl, CreateWorldMapControl, CreateTextEdit
|
||||
|
||||
MD5: cca3f572a4ebf8b1e9974f83f6e756aa
|
||||
@@ -1,13 +0,0 @@
|
||||
|
||||
Prototype: GemRB.CreateCreature(PartyID, CreResRef)
|
||||
|
||||
Description: Creates Creature in the vicinity of the player character.
|
||||
|
||||
Parameters:
|
||||
PartyID - the PC's position in the party
|
||||
CreResRef - the creature's name (.cre resref)
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: CreateItem
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
|
||||
Prototype: GemRB.CreateItem(PartyID, ItemResRef, [SlotID, Charge0, Charge1, Charge2])
|
||||
|
||||
Description: Creates Item in the inventory of the player character.
|
||||
|
||||
Parameters:
|
||||
PartyID - the PC's position in the party
|
||||
ItemResRef - the item's name (.itm resref)
|
||||
SlotID - Inventory Slot (-1 means any backpack slot)
|
||||
Charge0-2 - The item's stack amount/charges
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also:
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
|
||||
Prototype: GemRB.CreateLabel(WindowIndex, ControlID, x, y, w, h, font, text, align)
|
||||
|
||||
Metaclass Prototype: CreateLabel(ControlID, x, y, w, h, font, text, align)
|
||||
|
||||
Description: Creates and adds a new Label to a Window.
|
||||
|
||||
Parameters:
|
||||
WindowIndex - the value returned from LoadWindow
|
||||
ControlID - the new control will be available via this controlID
|
||||
x,y,w,h - X position, Y position, Width and Height of the control
|
||||
font - a .bam resref which must be listed in fonts.2da too
|
||||
text - initial text of the label (must be string)
|
||||
align - label text alignment
|
||||
|
||||
Return value: N/A
|
||||
|
||||
Example:
|
||||
GemRB.CreateLabel(StartWindow, 0x0fff0000, 0,415,640,30, "EXOFONT", "", 1)
|
||||
Label=GemRB.GetControl(StartWindow, 0x0fff0000)
|
||||
GemRB.SetText(StartWindow, Label,GEMRB_VERSION)
|
||||
The above lines add the GemRB version string to the PST main screen.
|
||||
|
||||
See also: CreateButton, SetText
|
||||
|
||||
|
||||
MD5: aaeaa42947bb1bc3cde0719ad5e08b51
|
||||
@@ -1,18 +0,0 @@
|
||||
|
||||
Prototype: GemRB.CreateLabelOnButton(WindowIndex, ButtonControlID, NewID, font, align)
|
||||
|
||||
Metaclass Prototype: CreateLabelOnButton(NewID, font, align)
|
||||
|
||||
Description: Creates and adds a new Label to a Window, based on the dimensions of an existing button. If the NewID is the same as the old button ID, the old button will be converted to this Label (the old button will be removed).
|
||||
|
||||
Parameters:
|
||||
WindowIndex - the value returned from LoadWindow
|
||||
ButtonControlID - the button control to be copied/converted
|
||||
NewID - the new control will be available via this controlID
|
||||
font - a .bam resref which must be listed in fonts.2da too
|
||||
align - label text alignment
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: CreateButton, CreateLabel
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
Prototype: GemRB.CreateMapControl(WindowIndex, ControlID, x, y, w, h, [LabelID, FlagResRef [, Flag2ResRef]]
|
||||
|
||||
Metaclass Prototype: CreateMapControl(ControlID, x, y, w, h, [LabelID, FlagResRef [, Flag2ResRef]]
|
||||
|
||||
Description: Creates and adds a new Area Map Control to a Window. If WindowIndex and ControlID (not ControlIndex!) point to a valid control, it will replace that control with the MapControl using the original control's dimensions (x,y,w,h are ignored). It is possible to associate a variable with the MapControl, in this case, the associated variable will enable or disable mapnotes (you must supply a LabelID and the resources for the pins).
|
||||
|
||||
Parameters:
|
||||
WindowIndex - the value returned from LoadWindow
|
||||
ControlID - the new control will be available via this controlID
|
||||
x,y,w,h - X position, Y position, Width and Height of the control
|
||||
LabelID - associated control ID to display mapnotes, it must be a label
|
||||
FlagResRef - Resource Reference for the pins, if no Flag2ResRef is given, this should be a .bam resref. If there is a second resref, then both must be .bmp.
|
||||
Flag2ResRef - the readonly mapnotes are marked by this .bam (red pin)
|
||||
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: SetVarAssoc, SetMapnote
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
|
||||
Prototype: GemRB.CreateMovement(Area, Entrance[, Direction])
|
||||
|
||||
Description: Moves some or all actors of the current area to the destination area.
|
||||
|
||||
Parameters: Area - The area resource reference where the player(s) should arrive.
|
||||
Entrance - The area entrance in the Destination area.
|
||||
Direction - The direction flag (from WMP) to use if the entrance doesn't exist.
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: GetDestinationArea
|
||||
|
||||
MD5: b19700ed972c915b0910b40a746a87ee
|
||||
@@ -1,25 +0,0 @@
|
||||
|
||||
Prototype: CreatePlayer(CREResRef, Slot [,Import, VersionOverride] )
|
||||
|
||||
Description: Adds an actor (PC) to the current game. It works only after a LoadGame() was executed, and should be used before an EnterGame(). It is also used to import a .chr file as a PC. A new character will need additional SetPlayerStat() and FillPlayerInfo() calls to be a working character.
|
||||
|
||||
Parameters: CREResRef - The name of the creature to be used as the actor, usually 'charbase'
|
||||
Slot - The player character's position in the party
|
||||
Import - Set it to 1 if you want to import a .chr instead of creating a new character
|
||||
VersionOverride - Force version of new actor.
|
||||
|
||||
Return value: the new player's index in the game structure
|
||||
|
||||
Examples:
|
||||
MyChar = GemRB.GetVar("Slot")
|
||||
GemRB.CreatePlayer("charbase", MyChar )
|
||||
|
||||
The above example will create a new player character in the slot selected by the Slot variable.
|
||||
|
||||
MyChar = GemRB.GetVar("Slot")
|
||||
ImportName = "avenger"
|
||||
GemRB.CreatePlayer(ImportName, MyChar, 1 )
|
||||
The above example would import avenger.chr into the slot selected by the Slot Variable. (If it exists in the Characters directory of the game).
|
||||
|
||||
See also: LoadGame, EnterGame, QuitGame, FillPlayerInfo, SetPlayerStat
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
v
|
||||
Prototype: GemRB.CreateScrollBar(WindowIndex, ControlID, x, y, w, h)
|
||||
|
||||
Metaclass Prototype: CreateScrollBar(ControlID, x, y, w, h)
|
||||
|
||||
Description: Creates and adds a new ScrollBar to a Window.
|
||||
|
||||
Parameters:
|
||||
WindowIndex - the window control
|
||||
ControlID - the id of the new control
|
||||
x - position
|
||||
y - position
|
||||
w - width
|
||||
h - height
|
||||
|
||||
Return value: ControlIndex
|
||||
|
||||
See also: SetScrollBarSprites, SetDefaultScrollBar, AttachScrollBar
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
|
||||
Prototype: GemRB.CreateTextEdit(WindowIndex, ControlID, x, y, w, h, font, text)
|
||||
|
||||
Metaclass Prototype: CreateTextEdit(ControlID, x, y, w, h, font, text)
|
||||
|
||||
Description: Creates and adds a new TextEdit field to a Window. Used in PST MapNote editor. The maximum length of the edit field is 500 characters.
|
||||
|
||||
Parameters:
|
||||
WindowIndex - the value returned from LoadWindow
|
||||
ControlID - the new control will be available via this controlID
|
||||
x,y,w,h - X position, Y position, Width and Height of the control
|
||||
font - font BAM ResRef
|
||||
text - initial text
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: CreateLabel, CreateMapControl, CreateWorldMapControl, CreateButton
|
||||
|
||||
MD5: dd93ef5d51dda6ab1a2b5050bb0c4e3f
|
||||
@@ -1,17 +0,0 @@
|
||||
|
||||
Prototype: GemRB.CreateWindow(WindowID, X, Y, Width, Height, MosResRef)
|
||||
|
||||
Description: Creates a new empty window and returns its index.
|
||||
|
||||
Parameters:
|
||||
WindowID - the window's ID
|
||||
X,Y - the window's position
|
||||
Width, Height - the window's dimensions
|
||||
MosResRef - the background image (.mos resref)
|
||||
|
||||
Return value: a window index
|
||||
|
||||
See also:
|
||||
|
||||
|
||||
MD5: f28c0c3fb8a9e7d0a279d735c5b94d6f
|
||||
@@ -1,25 +0,0 @@
|
||||
|
||||
Prototype: GemRB.CreateWorldMapControl(WindowIndex, ControlID, x, y, w, h, direction[, font])
|
||||
|
||||
Metaclass Prototype: CreateWorldMapControl(ControlID, x, y, w, h, direction[, font])
|
||||
|
||||
Description: This command will create a special WorldMapControl, which is currently unavailable via .chu files. If WindowIndex and ControlID (not ControlIndex!) point to a valid control, it will replace that control with the WorldMapControl using the original control's dimensions (x,y,w,h are ignored).
|
||||
|
||||
Parameters:
|
||||
WindowIndex - the value returned from LoadWindow
|
||||
ControlID - the new control will be available via this controlID
|
||||
x,y,w,h - X position, Y position, Width and Height of the control
|
||||
direction
|
||||
font - font uused to display names of map locations
|
||||
|
||||
Return value: N/A
|
||||
|
||||
Example:
|
||||
Window = GemRB.LoadWindow (0)
|
||||
GemRB.CreateWorldMapControl (Window, 4, 0, 62, 640, 418, Travel, "floattxt")
|
||||
WorldMapControl = GemRB.GetControl (Window, 4)
|
||||
|
||||
See also: GetDestinationArea, CreateMovement
|
||||
|
||||
|
||||
MD5: ec421a1b6a60206700cad9c9776f78e6
|
||||
@@ -1,16 +0,0 @@
|
||||
|
||||
Prototype: GemRB.DeleteControl(WindowIndex, ControlID)
|
||||
|
||||
Metaclass Prototype: DeleteControl(ControlID)
|
||||
|
||||
Description: Deletes a control from a Window.
|
||||
|
||||
Parameters: WindowIndex - the return value of a previous LoadWindow call.
|
||||
ControlID - a control ID, see the .chu file specification
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: GetControl
|
||||
|
||||
|
||||
MD5: dfbf18fa1830fccf5eb61cf2b39b5147
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
Prototype: GemRB.DeleteSaveGame(SlotCount)
|
||||
|
||||
Description: Deletes a saved game folder completely.
|
||||
|
||||
Parameters: SlotCount - the index of a saved game
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: GetSaveGameCount
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
|
||||
Prototype: GemRB.DisplayString(strref, color[, PartyID])
|
||||
|
||||
Description: Displays a string in the messagewindow using methods supplied by the core engine.
|
||||
|
||||
Parameters: strref - the tlk reference
|
||||
color - a hex packed RGB value
|
||||
PartyID - if supplied, then the PC's name will be displayed too
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: SetText
|
||||
|
||||
MD5:
|
||||
@@ -1,14 +0,0 @@
|
||||
|
||||
Prototype: GemRB.DragItem(PartyID, Slot, ResRef, [Count=0])
|
||||
|
||||
Description: Start dragging specified item. If Count is given, it will try to split the item. If an item is already dragged, it won't do anything.
|
||||
|
||||
Parameters: PartyID - the PC's position in the party
|
||||
Slot - actor index in game structure
|
||||
ResRef - item name (.itm resref)
|
||||
Count - stack size (0 means all)
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: DropDraggedItem, IsDraggingItem
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
Prototype: GemRB.DrawWindows()
|
||||
|
||||
Description: Refreshes the User Interface by redrawing invalidated controls.
|
||||
|
||||
Parameters: N/A
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: InvalidateWindow, UnhideGUI
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
|
||||
Prototype: GemRB.DropDraggedItem(PartyID, Slot)
|
||||
|
||||
Description: Stop dragging specified item. Dropping the item in an invalid slot will result in 0. Partial success may happen if the item was dropped into a stack, but not all items were moved. The dragging status will be removed only after a complete success. Not all inventory slots may carry any type of item. The item could be dropped in an unspecified inventory slot, the ground, or an equippable slot fitting for the item.
|
||||
|
||||
Parameters: PartyID - the actor's inparty index
|
||||
Slot - the Inventory Slot
|
||||
Special values for Slot:
|
||||
-1 any equippable slot fitting for the item
|
||||
-2 ground
|
||||
-3 any inventory slot
|
||||
Return value: integer, the action was: 0 (unsuccessful), 1 (partial success) or 2 (complete success)
|
||||
|
||||
See also: DragItem, IsDraggingItem, CanUseItemType
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
|
||||
Prototype: GemRB.EnableButtonBorder(WindowIndex, ControlIndex, BorderIndex, enabled)
|
||||
|
||||
Metaclass Prototype: EnableBorder(BorderIndex, enabled)
|
||||
|
||||
Description: Enable or disable specified border/frame/overlay of a button control.
|
||||
|
||||
Parameters:
|
||||
WindowIndex, ControlIndex - the control's reference
|
||||
BorderIndex - 0,1 or 2
|
||||
enabled - boolean, true enables the border
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: SetButtonBAM, SetButtonFlags, SetButtonBorder
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
Prototype: GemRB.EnableCheatKeys(flag)
|
||||
|
||||
Description: Turns the debug keys on or off.
|
||||
|
||||
Parameters: flag - boolean
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also:
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
Prototype: EndCutSceneMode()
|
||||
|
||||
Description: Exits the CutScene Mode. It is similar to the gamescript command of the same name. It gives back the cursor, and shows the game GUI windows hidden by the CutSceneMode() gamescript action. (This is mainly a debug command.)
|
||||
|
||||
Parameters: N/A
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: HideGUI, UnhideGUI
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
Prototype: GemRB.EnterGame()
|
||||
|
||||
Description: Starts new game and enters it. It destructs all existing windows, and creates a GameControl window as the 0. window (the GameControl object will be its 0. control). You should already load a game using LoadGame(), otherwise the engine may terminate. The Game won't be entered until the execution of the current script ended, but a LoadGame() may precede EnterGame() in the same function. (SetNextScript too).
|
||||
|
||||
Parameters: N/A
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: QuitGame, LoadGame, SetNextScript
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
Prototype: EnterStore( StoreResRef )
|
||||
|
||||
Description: Loads a store and sets it as current (used) store.
|
||||
|
||||
Parameters: StoreResRef - the store's resource name
|
||||
|
||||
Return value: None
|
||||
|
||||
See also: GetStore, GetStoreCure, GetStoreDrink, LeaveStore, SetPurchasedAmount
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
Prototype: GemRB.EvaluateString(String)
|
||||
|
||||
Description: Evaluates an In-Game Script Trigger in the current Area Script Context. It prints the result. (The command is more useful from the Console than using from scripts)
|
||||
|
||||
Parameters: String - a gamescript trigger
|
||||
|
||||
Return value: N/A (the trigger's return value is printed)
|
||||
|
||||
See also: ExecuteString
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
Prototype: GemRB.ExecuteString(String[,Slot])
|
||||
|
||||
Description: Executes an In-Game Script Action in the current Area Script Context. This means that LOCALS will be treated as the current area's variable.
|
||||
|
||||
Parameters: String - a gamescript action
|
||||
Slot - a player slot
|
||||
Return value: N/A
|
||||
|
||||
Example:
|
||||
GemRB.ExecuteString("ActionOverride([PC], Attack(NearestEnemyOf(Myself)) )")
|
||||
|
||||
The above example will force a player (most likely Player1) to attack an enemy, issuing the command as it would come from the current area's script. The current gametype must support the scripting action.
|
||||
|
||||
GemRB.ExecuteString("Attack(NearestEnemyOf(Myself))", 2)
|
||||
|
||||
The above example will force Player2 to attack an enemy, as the example will run in that actor's script context.
|
||||
|
||||
See also: EvaluateString, gamescripts
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
|
||||
Prototype: ExploreArea( [value] )
|
||||
|
||||
Description: Fills the explored bitmap with the value given. If there was no value given, it will fill with -1 (all bit set).
|
||||
|
||||
Parameters: 0 - undo explore
|
||||
-1 - explore
|
||||
all other values give meaningless results
|
||||
|
||||
Return value: None
|
||||
|
||||
See also: MoveToArea
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
|
||||
Prototype: GemRB.FillPlayerInfo(Slot[, Portrait1, Portrait2])
|
||||
|
||||
Description: Fills basic character info, that is not stored in stats. This command will generate an AnimationID for the character based on the avprefix.2da table, the character must have the stats referenced in the avprefix structure already set. It will also set the player's portraits if given. It will set the actor's area/position according to the "PlayMode" variable and the Slot value (using the startpos.2da table). This command must be called once after a character was created and before EnterGame().
|
||||
|
||||
Parameters: Slot - the new character's slot
|
||||
Portrait1 - medium (or large) portrait
|
||||
Portrait2 - small portrait
|
||||
The avprefix structure:
|
||||
avprefix.2da is a gemrb specific table. Its first row contains the base animationID used for the actor. Its optional additional rows contain other table resrefs which refine the animationID by different player stats. The first row of these tables contain the stat which affects the animationID. The other rows assign cummulative values to the animationID.
|
||||
For example:
|
||||
|
||||
avprefix.2da
|
||||
RESOURCE
|
||||
0 0x6000
|
||||
1 avprefr
|
||||
2 avprefg
|
||||
3 avprefc
|
||||
avprefr.2da
|
||||
RACE
|
||||
TYPE 201
|
||||
HUMAN 0
|
||||
ELF 1
|
||||
HALF_ELF 1
|
||||
GNOME 4
|
||||
HALFLING 3
|
||||
DWARF 2
|
||||
HALFORC 5
|
||||
|
||||
Based on the avatar's stat (201 == race) the animationID (0x6000) will be increased by the given values. For example an elf's animationID will be 0x6001. The animationID will be further modified by gender and class.
|
||||
|
||||
Return value: N/A
|
||||
|
||||
Examples:
|
||||
GemRB.FillPlayerInfo(MyChar, PortraitName+"M", PortraitName+"S")
|
||||
|
||||
See also: LoadGame, CreatePlayer, SetPlayerStat, EnterGame
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
|
||||
Prototype: GemRB.FindTableValue(TableIndex, ColumnIndex, Value[, Start])
|
||||
|
||||
Metaclass Prototype: FindValue(ColumnIndex, Value[, Start])
|
||||
|
||||
Description: Returns the first rowcount of a field value in a 2DA Table. If Start
|
||||
is omitted, the search starts from the beginning. This command doesn't work with
|
||||
a string value.
|
||||
|
||||
Parameters:
|
||||
TableIndex - integer, returned by a previous LoadTable command.
|
||||
ColumnIndex - integer, the index of the column in which you look for the value.
|
||||
Value - integer, The value to find in the table
|
||||
Start - integer, The starting row
|
||||
|
||||
Return value: numeric, -1 if the value isn't to be found
|
||||
|
||||
See also: LoadTable, GetTableValue
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GameControlGetTargetMode()
|
||||
|
||||
Description: Returns the current target mode. It could be: talk, attack, spellcast and such.
|
||||
|
||||
Return value: numeric (see GameControlSetTargetMode)
|
||||
|
||||
See also: GameControlSetScreenFlags
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GameControlSetLastActor(partyID)
|
||||
|
||||
Description: Sets LastActor in the GameControl object. The LastActor object is the player character which is currently about to be selected by the player. Its feet circle is flickering.
|
||||
|
||||
Parameters: partyID - 0 to delete any previous settings, or the partyID.
|
||||
|
||||
Return value: None
|
||||
|
||||
See also: GameSelectPCSingle
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GameControlSetScreenFlags(Mode, Operation)
|
||||
|
||||
Description: Sets screen flags, like cutscene mode, disable mouse, etc. Don't confuse it with the saved screen flags set by GameSetScreenFlags.
|
||||
|
||||
Parameters:
|
||||
Mode - bitfield
|
||||
1 - disable mouse
|
||||
2 - center on actor (one time)
|
||||
4 - center on actor (always)
|
||||
8 - enable gui
|
||||
16 - lock scroll
|
||||
Operation - see bit_operation.txt
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: GameSetScreenFlags, bit_operation
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GameControlSetTargetMode(Mode)
|
||||
|
||||
Description: Sets action to be made by the player (the cursor will change). It could be: talk, attack, spellcast.
|
||||
|
||||
Parameters:
|
||||
Mode - 0 none
|
||||
1 talk
|
||||
2 attack (bash)
|
||||
4 spellcast
|
||||
8 defend
|
||||
16 pick lock
|
||||
|
||||
Also the target type could be added:
|
||||
TARGET_MODE_ALLY = 0x100
|
||||
TARGET_MODE_ENEMY = 0x200
|
||||
TARGET_MODE_NEUTRAL = 0x400
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: GameControlSetScreenFlags, GameControlGetTargetMode
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GameGetFirstSelectedPC()
|
||||
|
||||
Description: Returns index of the first selected PC or 0 if none.
|
||||
|
||||
Parameters: N/A
|
||||
|
||||
Return value: the first selected PC's position in the party (it will look in the original party order, thus the protagonist will be always first!)
|
||||
|
||||
See also: GameSelectPC, GameIsPCSelected
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
Prototype: GameGetFormation()
|
||||
|
||||
Description: Returns current party formation. The formations are stored in the GemRB specific formatio.2da table.
|
||||
|
||||
Parameters: N/A
|
||||
|
||||
Return value: integer
|
||||
|
||||
See also: GameSetFormation
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GameGetPartyGold()
|
||||
|
||||
Description: Returns current party gold.
|
||||
|
||||
Parameters: N/A
|
||||
|
||||
Return value: numeric
|
||||
|
||||
See also: GetPlayerStat
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GameGetReputation()
|
||||
|
||||
Description: Returns current party's reputation.
|
||||
|
||||
Parameters: N/A
|
||||
|
||||
Return value: numeric
|
||||
|
||||
See also: GetPlayerStat, GameSetReputation
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GameGetSelectedPCSingle(flag)
|
||||
|
||||
Description: If flag is 0 or omitted, then returns currently active pc in non-walk environment (i.e. in shops, inventory,...). If flag is set to non-zero, then returns the currently speaking PC.
|
||||
If there is no such PC, then returns 0.
|
||||
|
||||
Parameters: flag - 0/1
|
||||
|
||||
Return value: PartyID (1-10)
|
||||
|
||||
See also: GameSelectPC, GameSelectPCSingle
|
||||
|
||||
MD5: b19700ed972c915b0910b40a746a87ee
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
Prototype: GameIsBeastKnown(index)
|
||||
|
||||
Description: Returns whether beast with given index is known to PCs (works only on PST).
|
||||
|
||||
Parameters: index - the beast's index as of beast.ini
|
||||
|
||||
Return value: boolean, 1 means beast is known.
|
||||
|
||||
See also: GetINIBeastsKey
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GameIsPCSelected(Slot)
|
||||
|
||||
Description: Returns true if the PC is selected.
|
||||
|
||||
Parameters: Slot - the PC's position in the party (1 based)
|
||||
|
||||
Return value: boolean, 1 if the PC is selected
|
||||
|
||||
See also: GameSelectPC, GameGetFirstSelectedPC
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GamePause(pause, quiet)
|
||||
|
||||
Description: Pauses or unpauses the current game. This affects all ingame events, including: scripts, animations, movement. It doesn't affect the GUI.
|
||||
|
||||
Parameters: pause - int, 1 = pause, 0 = continue, 2 = toggle pause
|
||||
quiet - bool, true = no message, false = game paused/unpaused message
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also:
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GameSelectPC(PartyID, Selected, [Flags = SELECT_NORMAL])
|
||||
|
||||
Description: Selects or deselects a PC. Note: some things use a different PC selection mechanism (dialogs and stores are not unified yet).
|
||||
|
||||
Parameters: PartyID - the PC's position in the party, 0 means ALL
|
||||
Selected - boolean
|
||||
Flags - bitflags
|
||||
bit 1 - if set deselect all other actors
|
||||
bit 2 - do not run SelectionHandler (no GUI feedback)
|
||||
|
||||
Return value: N/A
|
||||
|
||||
Example:
|
||||
def SelectAllOnPress ():
|
||||
GemRB.GameSelectPC (0, 1)
|
||||
return
|
||||
The above function is associated to the 'select all' button of the GUI screen.
|
||||
|
||||
See also: GameIsPCSelected, GameSelectPCSingle, GameGetSelectedPCSingle, GameGetFirstSelectedPC
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GameSelectPCSingle(PartyID)
|
||||
|
||||
Description: Selects one PC in non-walk environment (i.e. in shops, inventory,...).
|
||||
|
||||
Parameters:
|
||||
PartyID - the PC's position in the party
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: GameSelectPC, GameGetSelectedPCSingle
|
||||
|
||||
MD5: 6ff47eca2a1cc470e3b909a8c1f9fa0b
|
||||
@@ -1,14 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GameSetExpansion(mode)
|
||||
|
||||
Description: Sets the expansion mode. Most games were created in a two in one and could start the game as expansion only (or transfer to the expansion).
|
||||
This command selects between these two modes.
|
||||
|
||||
-- this command is not working --
|
||||
|
||||
Parameters: Mode - 0 or 1
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: LoadGame, GameType(variable)
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GameSetFormation(Formation)
|
||||
|
||||
Description: Sets party formation.
|
||||
|
||||
Parameters: the row index of formatio.2da
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: GameGetFormation
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GameSetPartyGold(Gold)
|
||||
|
||||
Description: Sets current party gold.
|
||||
|
||||
Parameters: the gold amount to be set
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: GameGetPartyGold
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GameSetPartySize(Size)
|
||||
|
||||
Description: Sets the maximum number of PCs. This command works only after a LoadGame(). If the party size was set to 0, then it means unlimited size.
|
||||
|
||||
Parameters: Size - must be 0-8
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: GetPartySize
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GameSetProtagonistMode(Mode)
|
||||
|
||||
Description: Sets the mode the game handles the game over event. This action works only after a LoadGame.
|
||||
|
||||
Parameters:
|
||||
Mode - 0 no check
|
||||
1 game over when protagonist dies
|
||||
2 game over when whole party is dead
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: LoadGame, GameSetPartySize
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GameSetReputation(Reputation)
|
||||
|
||||
Description: Sets current party's reputation.
|
||||
|
||||
Parameters: the reputation amount to be set. (It is divided by ten when displayed).
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: GameGetReputation, IncreaseReputation
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GameSetScreenFlags(Bits, Operation)
|
||||
|
||||
Description: Stores the portrait/options/message window size value in the game object.
|
||||
|
||||
Parameters:
|
||||
Bits - This depends on the game.
|
||||
The lowest 2 bits are the message window size
|
||||
Operation - The usual bit operations (see bit_operation.txt)
|
||||
|
||||
Return value: N/A
|
||||
|
||||
See also: SetVisible, bit_operation
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GetAbilityBonus(stat, column, value[, ex])
|
||||
|
||||
Description: Returns ability based values from different .2da files. Like strmod, dexmod, etc.
|
||||
|
||||
Parameters: stat - a stat value, like IE_STR
|
||||
column - integer, the column index of the value in the .2da file
|
||||
|
||||
Column indices:
|
||||
|
||||
IE_STR: 0 - To hit, 1 - Damage, 2 - Open doors, 3 - Weight allowance
|
||||
IE_INT: 0 - learn spell, 1 - max spell level, 2 - max spell number on level
|
||||
IE_DEX: 0 - reaction adjustment, 1 - missile, 2 - AC
|
||||
IE_CON: 0 - normal hp, 1 - warrior hp, 2 - minimum hp roll, 3 - hp regen rate, 4 - fatigue
|
||||
IE_CHR: 0 - reaction
|
||||
IE_LORE: 0 - lore bonus (int+wis based)
|
||||
IE_REPUTATION: 0 - reaction (chr+reputation based)
|
||||
IE_WIS: 0 - percentile xp bonus
|
||||
|
||||
Return value: -9999 if the parameters are illegal, otherwise the required bonus
|
||||
|
||||
See also: SetPlayerStat, GetPlayerStat, GetTableValue
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GetCharSounds(WindowIndex, ControlIndex)
|
||||
|
||||
Metaclass Prototype: GetCharSounds(ControlIndex)
|
||||
|
||||
Description: Reads the contents of the sounds subfolder into a TextArea control.
|
||||
|
||||
Parameters:
|
||||
WindowIndex, ControlIndex - the control's reference
|
||||
|
||||
|
||||
Return value: numeric, the number of rows read into the TextArea control.
|
||||
Example:
|
||||
TextAreaControl = GemRB.GetControl(SoundWindow, 45)
|
||||
GemRB.SetTextAreaSelectable(SoundWindow, TextAreaControl,1)
|
||||
GemRB.SetVarAssoc(SoundWindow, TextAreaControl, "Sound", 0)
|
||||
RowCount=GemRB.GetCharSounds(SoundWindow, TextAreaControl)
|
||||
|
||||
See also: QueryText, GetCharacters
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GetCharacters(WindowIndex, ControlIndex)
|
||||
|
||||
Metaclass Prototype: GetCharacters(ControlIndex)
|
||||
|
||||
Description: Reads the contents of the characters subfolder into a TextArea control.
|
||||
|
||||
Parameters:
|
||||
WindowIndex, ControlIndex - the control's reference
|
||||
|
||||
|
||||
Return value: numeric, the number of rows read into the TextArea control.
|
||||
Example:
|
||||
TextAreaControl = GemRB.GetControl(SoundWindow, 45)
|
||||
GemRB.SetTextAreaSelectable(SoundWindow, TextAreaControl,1)
|
||||
GemRB.SetVarAssoc(SoundWindow, TextAreaControl, "Characters", 0)
|
||||
RowCount=GemRB.GetCharSounds(SoundWindow, TextAreaControl)
|
||||
|
||||
See also: QueryText, GetCharSounds
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GetCombatDetails(pc, leftorright)
|
||||
|
||||
Description: Returns the current THAC0 and other data in relation to the equipped weapon.
|
||||
|
||||
Parameters:
|
||||
pc - position in the party
|
||||
leftorright - left or right hand weapon (main or offhand)
|
||||
|
||||
Return value: dict: "ToHit", "Flags", "DamageBonus", "Speed", "CriticalBonus", "Style"
|
||||
|
||||
See also: IsDualWielding
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
|
||||
Prototype: GetContainer( PartyID, autoselect )
|
||||
|
||||
Description: Gets the current container's type and other basic header information. The player is always the first selected player. If PartyID is 0 then the default PC is the first multiselected PC. Autoselect will always select a groundpile. If there is no container at the feet of the PC autoselect will create the container.
|
||||
|
||||
Parameters:
|
||||
PartyID - the PC's position in the party
|
||||
autoselect - is 1 if you call this function from a player inventory (so you select the pile at their feet)
|
||||
|
||||
Return value: dictionary
|
||||
"Type" - the container's type, numeric (see IESDP)
|
||||
"ItemCount" - the number of items in the container
|
||||
|
||||
See also: GetStore, GameGetFirstSelectedPC, GetContainerItem
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
|
||||
Prototype: GetContainerItem( PartyID, index )
|
||||
|
||||
Description: Returns the container item referenced by the index. If PartyID is 0 then the container was opened manually and should be the current container. If PartyID is not 0 then the container is autoselected and should be at the feet of the player.
|
||||
|
||||
Parameters:
|
||||
PartyID - the PC's position in the party
|
||||
index - the item's index in the container
|
||||
|
||||
Return value: dictionary
|
||||
"ItemResRef" - the ResRef of the item
|
||||
"ItemName" - the StrRef of the item's name (identified or not)
|
||||
"Usages0" - The primary charges of the item (or the item's stack amount if the item is stackable).
|
||||
"Usages1" - The secondary charges of the item.
|
||||
"Usages2" - The tertiary charges of the item.
|
||||
"Flags" - Item flags.
|
||||
|
||||
See also: GetContainer, GameGetFirstSelectedPC, GetStoreItem
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GetControl(WindowIndex, ControlID)
|
||||
|
||||
Description: Returns a control in a Window.
|
||||
|
||||
Parameters: WindowIndex - the return value of a previous LoadWindow call.
|
||||
ControlID - a control ID, see the .chu file specification
|
||||
|
||||
Return value: a control index
|
||||
|
||||
See also: LoadWindowPack, LoadWindow
|
||||
|
||||
|
||||
MD5: eccbc1af698fd8d4e5eec5004433e515
|
||||
@@ -1,13 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GetControlObject(WindowID, ControlID)
|
||||
|
||||
Description: Returns a control as an object.
|
||||
|
||||
Parameters:
|
||||
WindowIndex - the window control id
|
||||
ControlID - the id of the target control
|
||||
|
||||
Return value: GControl
|
||||
|
||||
See also:
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GetCurrentArea()
|
||||
|
||||
Description: Returns the name of the current area. It is the same as GetGameString(1). It works only after a LoadGame() was issued.
|
||||
|
||||
Parameters: N/A
|
||||
|
||||
Return value: string, (ARE resref)
|
||||
|
||||
See also: GetGameString
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
|
||||
Prototype: GemRB.GetDestinationArea(WindowIndex, ControlIndex[, RndEncounter])
|
||||
|
||||
Metaclass Prototype: GetDestinationArea([RndEncounter])
|
||||
|
||||
Description: Returns a dictionary of the selected area by the worldmap control.
|
||||
If the route is blocked, then Distance will return a negative value and Destination/Entrance won't be set. Random encounters could be optionally evaluated.
|
||||
|
||||
Parameters:
|
||||
WindowIndex, ControlIndex - designate a worldmap control
|
||||
RndEncounter - 0/1
|
||||
|
||||
Return value: Dictionary
|
||||
Target - The target area selected by the player
|
||||
Distance - The traveling distance, if it is negative, the way is blocked
|
||||
Destination - The area resource reference where the player arrives (if there was a random encounter, it differs from Target)
|
||||
Entrance - The area entrance in the Destination area, it could be empty, in this casethe player should appear in middle of the area
|
||||
|
||||
See also: CreateWorldMapControl, CreateMovement, accessing_gui_controls
|
||||
|
||||
MD5: b19700ed972c915b0910b40a746a87ee
|
||||
@@ -1,11 +0,0 @@
|
||||
Prototype: GemRB.GetEquippedAmmunition(PartyID)
|
||||
|
||||
Description: Returns the equipped ammunition, if any
|
||||
|
||||
Parameters: PartyID - the PC's position in the party (1 based)
|
||||
|
||||
Return value: If ammunition is equipped, the inventory slot, otherwise -1.
|
||||
|
||||
See also: GetEquippedQuickSlot
|
||||
|
||||
MD5: f8136021ae5f439ccbd5fa3de99574a1
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user