Showing posts with label game-dev. Show all posts
Showing posts with label game-dev. Show all posts

Sunday, October 31, 2010

Interesting Magic Number

Yesterday I've bought Emergency 2012, the new game of the Emergency series. Because the freeplay mode has some annoying events (like pickpocketing) which happens very often, I wanted to change the frequency like in Em4. But the most xml files were compressed or encrypted. The magic number of this files seems interesting:
00010203
00D3C03713
If you read this as a little endian integer you will get: 0x1337C0D3
Someone wants to speak some leetspeak :)

btw: this shop has some cool language options ;)

Greetz
BlueC0re

Wednesday, July 28, 2010

Lua C-API

Yesterday I've restarted to develop a rts-game from the scratch. I've decided to use LUA as script engine. Because I want use C++ as programming language, I wrote a binder class to bind C++-Classes with Lua-Metatables. The first thing I needed to learn was that you can't call all functions of the C-API directly. Some of them must be called during a lua-call. If they be called directly you will often get an error like "PANIC: unprotected error in call to Lua API (no calling environment)" and your application will crash immediately. It tooks a long time until I noticed that I can't call
lua_replace(L, LUA_ENVIRONINDEX);
directly so I must use
lua_setfenv(L, -1);
if I want to set the current table as environment table. You will get the same error message if you try to load single libs (luaopen_..) directly. You must use luaL_openlibs or open it during a lua call.

Greetz,
BlueC0re