tarcv / botc Goto Github PK
View Code? Open in Web Editor NEWFork of Dusk's botc compiler *OPEN FOR ADOPTION*
License: Other
Fork of Dusk's botc compiler *OPEN FOR ADOPTION*
License: Other
Looks like the original Botc license is the 3-Clause BSD License.
Although it is modified and mentions only the author instead of "the copyright holder and contributors". So I don't think that exact text can be used for this (or other) forks.
cc: @so-sleepy adding you as you're talking with Torr about using this botc fork in Zandronum build process.
@crimsondusk Hi. Is it ok for you if I change the license text to match 3 clause BSD, or just add copyright holder and project contributors wording to your license text?
Although #14 fixes tarcv-master, that fix doesn't work in the upgrade branch.
Crash entered the game.
bot Crash command: Random
bot Crash command: delay
bot Crash command: ChatSectionExistsInChatLump
bot Crash command: BeginChatting
bot Crash command: Random
bot Crash command: delay
You got the super shotgun!
You got the BFG9000! Oh, yes.
bot Crash command: SayFromChatLump
Crash: Hey guys ;)
bot Crash command: LookForWeapons
bot Crash command: changestate
bot Crash command: StopChatting
bot Crash command: LookForWeapons
bot Crash command: GetCurrentWeapon
bot Crash command: StringsAreEqual
bot Crash command: Roam
bot Crash command: LookForPowerups
bot Crash command: GetCurrentWeapon
bot Crash command: StringsAreEqual
bot Crash command: Roam
bot Crash command: GetHealth
bot Crash command: GetBaseHealth
bot Crash command: GetCurrentWeapon
bot Crash command: StringsAreEqual
bot Crash command: Roam
bot Crash command: GetArmor
bot Crash command: GetBaseArmor
bot Crash command: LookForBaseArmor
bot Crash command: GetCurrentWeapon
bot Crash command: StringsAreEqual
bot Crash command: Roam
bot Crash command: LookForSuperHealth
bot Crash command: GetCurrentWeapon
bot Crash command: StringsAreEqual
bot Crash command: Roam
bot Crash command: LookForSuperArmor
bot Crash command: GetCurrentWeapon
bot Crash command: StringsAreEqual
bot Crash command: Roam
PushToStack: Stack size exceeded in bot Crash's script!
botc/namedenums/namedenums.cpp
Line 181 in 99dbd44
void SkipWhitespace (char*& cp, const char *end)
botc/namedenums/CMakeLists.txt
Line 4 in 99dbd44
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17 /permissive-")
botc/namedenums/CMakeLists.txt
Line 7 in 99dbd44
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -W -Wall")
I have talked to Torr about botc, he seemed happy about this and asked the following:
Quick question: Should it be possible to exactly recreate the compiled bot scripts from zandronum.pk3 with debotc and botc? I tried decompiling and recompiling crashbot.lump, but the result differed from the original crashbot.lump.
After navigating through Zandronum's source code, I found the following in src/bots.cpp:
case DH_ARRAYSET:
{
LONG lArray;
LONG lVal;
LONG lHighestVal;
// LONG lIdx;
lArray = m_ScriptData.alStack[m_ScriptData.lStackPosition - 3];
lVal = m_ScriptData.alStack[m_ScriptData.lStackPosition - 2];
lHighestVal = m_ScriptData.alStack[m_ScriptData.lStackPosition - 1];
if (( lArray < 0 ) || ( lArray >= MAX_SCRIPT_ARRAYS ))
I_Error( "ParseScript: Invalid array index, %d, in command \"arrayset\"!", static_cast<int> (lArray) );
if (( lHighestVal < 0 ) || ( lHighestVal >= MAX_SCRIPTARRAY_SIZE ))
I_Error( "ParseScript: Invalid array maximum index, %d, in command \"arrayset\"!", static_cast<int> (lHighestVal) );
memset( m_ScriptData.alScriptArrays[lArray], lVal, lHighestVal * sizeof( LONG ));
PopStack( );
PopStack( );
PopStack( );
}
break;
since DH_ARRAYSET is what we call now memset(), and the error says an error occurred with the command "arrayset", I suggest a renaming of that function, or the creation of an alias for it.
I've just went through this issue, I have decided to pick everything necessary from Zandronum's source code to test what happens when the function is called like that. Some things to consider: LONG is an alias for int, bool's size is 1 byte, the memset() below can be translated as memset(array, 1, sizeof(int)*32768), although I am not sure what is the value of lHighestVal in Zandronum's code. What I get from this is that memset() doesn't ever set the value that the modder tells it to even though there is one missing information.
#include <iostream>
#include <cstring>
// Maximum number of global arrays that can be defined in a script.
#define MAX_SCRIPT_ARRAYS 16
// Maximum number of global arrays that can be defined in a script.
#define MAX_SCRIPTARRAY_SIZE 65536
typedef int LONG;
typedef struct
{
LONG alScriptArrays[MAX_SCRIPT_ARRAYS][MAX_SCRIPTARRAY_SIZE];
} SCRIPTDATA_t;
// ===========================================================================//
SCRIPTDATA_t m_ScriptData;
LONG lVal = 1; // value to go into array
LONG lHighestVal = 32768; // Array size?
LONG lArray = 1; // equivalent to $globalArray1[]
int main (void)
{
// same as memset(1, 1, 32768);
memset( m_ScriptData.alScriptArrays[lArray], lVal, lHighestVal * sizeof( LONG ));
std::cout << std::hex << m_ScriptData.alScriptArrays[lArray][0] << ", " << m_ScriptData.alScriptArrays[lArray][1] << ", " << m_ScriptData.alScriptArrays[lArray][2] << ", ...\n";
return 0;
}
The current build script for Mac doesn't work in CI:
set -ex
#touch Brewfile
#echo 'brew "cmake"' >> Brewfile
#echo 'brew "llvm"' >> Brewfile
#brew bundle
brew install cmake || true
brew install llvm || true
export CC=$(brew --prefix llvm)/bin/clang
export CXX=$(brew --prefix llvm)/bin/clang++
export LD_LIBRARY_PATH=$(brew --prefix llvm)/lib
cmake -DCMAKE_POLICY_DEFAULT_CMP0056=NEW -DCMAKE_CXX_FLAGS="-v -stdlib=libc++ -I$(brew --prefix llvm)/include -Wl,-rpath,$LD_LIBRARY_PATH -L$LD_LIBRARY_PATH" .
make
This bug applies to tarcv-master only, don't know if it applies to upgrade.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.