I already talked with @GoGs. Im on VCGuard 5.0 now. It will be combined with vcaa functions, to make admins life easier for now.
Hopefully I can finish it this month.
Yes, but - Deny pickup - this is not the best solution, in some missions you need to pick up enemy gun if you are last man and no ammo for example. I think enough is to write some info as admin to all players like "Player Brchi picked up forbidden enemy gun"
I tried out Lua to realize an event/condition/action system without much effort (basic for now):
Code
60% rule: OnPlayerJoined()
if(numPlayersDead > numPlayersAlive) then
KillPlayer(player)
end
But then I had the idea to control the whole ptero scripting engine with Lua.
The basic idea is to intercept SCR_ExecScript() calls and if for example level.scr is called, it is bypassed and instead a Lua script is called.
That Lua script could not only call any SC_* functions from the engine, but also do anything else (change MP settings, ...).
Performance should be good and scripts could be modified without changing the map files cbf/dat, even when the map is already running (the script could also be autoupdated on clientside when modified on server).
I think at the end it could become unperformant due to possible needed wrappers and comfort binding to C in general. The VC C script is better suited for all that (object arrays, pointers, ..).
Another idea: Add custom script functions (with SCR_EnableFnToScript) that can be called then to expand functionality, possibility to modify scripts on-the-fly (SCR_CompileScript, SCR_LoadScript), and also to call additional scripts (another SCR_ExecScript after mp script for example, with custom message Ids like new events, timers and such). But not sure yet if this can work.
I was busy a bit with renovation.
First success. Bypassing mp script and compiling&loading&executing custom script on the fly works! Also calls to added custom functions.
Example (writes "Aounter: ..." to clients screen):
Code
// Called with SCR_ExecScript(customScrHandle, 44);
#include <inc\sc_global.h>
unsigned int counter = 0;
void ScriptMain(unsigned int message)
{
char buf[512];
switch(message)
{
case 44:
{
counter += 1;
sprintf(buf, "Counter: %u", counter);
SC_CUSTOM_Test(buf);
SC_Fnt_Write(10.0, 10.0, buf, 1, 0xFFFFFFFF);
break;
}
}
}
Code
// Defined in C/C++ Code
void SC_CUSTOM_Test(char* buf)
{
buf[0] = 'A';
}
New vcguard will of course only support serverside. But I think a lot will be possible in future.
This month was horrible I couldnt find much time to work on it, but dont worry, Im on it.
Scripting will not be implemented in vcguard, I want to realize it much better for JK. No real need for vcguard functionality now.
Maplist will be replaced by a schedule where maps and settings can be set depending on time.
Weapon rules will also be in (should work flawlessly even for CTF and such, custom script will restart map without resetting scores so that all dropped weapons are gone and ppl respawn with set weapons).