[T1]Some andrew 10k config scripting help

opsayo
03-08-2009, 09:15 AM
I have been browsing around the config files and there are a lot of events/commands/functions etc that are not used but I would like to make use of...

1) In modules/items.acs.cs there are events to drop both kit and mine, anyone know how I use those? (I looked around and wrote a simple keybind in config.cs to drop mines using drop(mine), but I don't know the syntax to drop a repair kit - and it doesn't make use of Andrew's built-in binds which seems more organized to use in Binds.definitions.cs.

2) I have no idea how to make use of modules/autosad.acs.cs. This is what the bottom of my file looks like:
edit: I just figured this out myself :D

A few very minor tweaks I would like to fix too:
1) I've seen other players spew out shit from inventories continuously, but with Andrew's I can only spew out 4 bunches (his spits out in packs of 4) before pressing the litterbug button does nothing (just a lot of beeping buy sounds). Is there any way I can sit in the inven and toss out repair packs as needed without having to leave it and go back in to reset the cycle?

2) The litterbug uses the hotkeys 1-4 which only become litterbug hotkeys when within an inven. The problem is if I enter a vehicle station, it doesn't recognize me leaving it, so until I enter another inventory my buttons 1-4 become fucked (and keep trying to buy stuff). This is only an issue with vehicle stations :(. Does anyone know where I can look to try to fix this?

3) How can I auto-buy a scout at a vehicle station? Right now I have to manually pull up the inventory (I have it normally hidden by default) and buy a scout.


This last question doesn't really deal specifically with Andrew's 10k, but - is there a way to put a sky on those maps that by default don't have skies on them? (like Stonehenge and it's bland gray sky). I know my old config used to put a big blue hudbot sky on it, but now it doesn't. What do I have to call the sky file to place it there or was it a product of how the old animated sky worked?

I know it's a long post, thanks to anyone who offers help.

Lemon
03-08-2009, 01:49 PM
that's not andrews 10k

here are some keybinds for the mine thing

If stonehenge had a sky it was either serverside or the animated sky thing which I've never used. I wish people would add skys to a lot of maps. I posted a pack with skys added on some of them and I'm pretty sure I added one to Stonehenge.

I'll look at the rest later.


bindCommand(keyboard0, make, "numpad0", TO, "kModule::Drop(1, 1);");
bindCommand(keyboard0, break, "numpad0", TO, "remoteEval(2048, lmsg, ovrhere);");

Dare
03-08-2009, 06:10 PM
yes i do not have those problems and i run andrew's 10k

opsayo
03-08-2009, 08:35 PM
well the thing is it's a clean install from andrew's 10k and i just added hudbot, i had the vehicle station problem before i remade my config (i used severed's) and after. others with andrew's don't get that?

thanks for the code :D


If stonehenge had a sky it was either serverside or the animated sky thing which I've never used. I wish people would add skys to a lot of maps. I posted a pack with skys added on some of them and I'm pretty sure I added one to Stonehenge.

do you have a link?

Lemon
03-08-2009, 08:53 PM
you're using andrews full config
andrews 10k is a small autoexec.cs

maps
Lemons_Maps.zip (http://www.mediafire.com/?4dj2dobd1mg)

won't help you unless you're hosting a server

opsayo
03-08-2009, 09:01 PM
oh, i guess i've been confused this whole time :picard:

still any idea whats wrong?

Dare
03-08-2009, 09:28 PM
// -=- MyBind -=-
function myBind(%k, %m, %b)
{
if (%m=="") %m = "$x='';";
if (%b=="") %b = "$x='';";

%k[0] = getword(%k, 0);
%k[1] = getword(%k, 1);

%keys = "\"" @ %k[0] @ "\"";
if (%k[1] != "")
%keys = %keys @ ", \"" @ %k[1] @ "\"";

%dev = "keyboard0";
if (String::FindSubStr(%key, "button") != -1)
%dev = "mouse0";

eval("bindCommand(" @ %dev @ ", make, " @ %keys @ ", TO, \"" @ %m @ "\");");
eval("bindCommand(" @ %dev @ ", break, " @ %keys @ ", TO, \"" @ %b @ "\");");
}


// -=- Options -=-
$Jump::Delay = 0.009;
$Waypoint::Target = 1; //1=enemy, 2=friendly, 3=manual
$Zoom::DefaultZoom = 1; //1=2x, 2=5x, 3=10x, 4=20x
$pref::TerrainVisibleDist ance = "850";

// -=- Prefs -=-
$pref::SkipIntro = true;
$pref::PlayerFOV = 90;
$pref::noEnterInvStation = true;
$pref::noIpx = true;
$pref::starDetail = 0;
$pref::skyDetail = 1;
$pref::filterBadWords = false;
$pref::NumDecals = 0;
$pref::maxNumSmokePuffs = 999;
$pref::PacketFrame = 32;
$pref::PacketRate = 15;
$pref::PacketSize = 400;
$pref::DefaultRecordDemo= true;
$net::interpolatetime = 0;
$Server::warmupTime = 5;
$Server::respawnTime = 0;
$badwords = "";

// -=- Binds -=-
editActionMap("playMap.sae");
MyBind("space", "Jump::Start();", "Jump::Stop();");
MyBind("1", "Waypoint::TargetFriendly( );");
MyBind("2", "Waypoint::TargetEnemy();");
MyBind("m", "DropMines();");
MyBind("e", "Zoom::Zoom();", "Zoom::UnZoom();");
MyBind("z", "Zoom::Cycle();");
MyBind("n", "TV::On();", "TV::Off();");
MyBind("alt home", "$DemoDrop = true;EndGame();");//demodrop
MyBind("up", "DemoHUD(normal);");
MyBind("down", "DemoHUD(pause);");
MyBind("left", "DemoHUD(slower);");
MyBind("right", "DemoHUD(faster);");
bindCommand(mouse0, zaxis0, TO, "nextWeapon();");
bindCommand(mouse0, zaxis1, TO, "prevWeapon();");
MyBind("home", "remoteEval(2048, rememberPosition);");
MyBind("end", "remoteEval(2048, recallPosition);");
MyBind("g", "remoteEval(2048, throwItem, 41, 1000);");//max throw nade
MyBind("capslock", "remoteEval(2048, throwItem, 41, 1);");//reg throw nade
MyBind("m", "remoteEval(2048, throwItem, 40, 1000);");//max throw mine

editActionMap("actionMap.sae");
MyBind("f1", "Fav::Set(1, 'HeavyO');");
MyBind("f2", "Fav::Set(2, 'HeavyD');");
MyBind("f3", "Fav::Set(3, 'Farmer');");
MyBind("f4", "Fav::Set(4, 'Capper');");
MyBind("f5", "Fav::Set(5, 'Sniper');");

NewActionMap("Favorite.sae");
EditActionMap("Favorite.sae");
MyBind("1", "Fav::Litter('Turret');");
MyBind("2", "Fav::Litter('Inventory Station');");
MyBind("3", "Fav::Litter('Pulse Sensor');");
MyBind("4", "Fav::Litter('repair pack');");
MyBind("5", "Fav::Litter('repair kit');");
MyBind("numpad1", "buy('ammo pack');");
MyBind("numpad2", "buy('shield pack');");
MyBind("numpad3", "buy('repair pack');");

// -=- Remote Print Prefs -=-
function remoteCP(%manager, %msg, %timeout)
{
if(%manager == 2048)
{
$centerPrintId++;
if(%timeout)
schedule("clearCenterPrint(" @ $centerPrintId @ ");", %timeout);
Client::centerPrint(%msg, 0);
}
}

function remoteBP(%manager, %msg, %timeout)
{
if(%manager == 2048)
{
$centerPrintId++;
if(%timeout)
schedule("clearCenterPrint(" @ $centerPrintId @ ");", %timeout);
Client::centerPrint(%msg, 0);
}
}

function remoteTP(%manager, %msg, %timeout)
{
if(%manager == 2048)
{
$centerPrintId++;
if(%timeout)
schedule("clearCenterPrint(" @ $centerPrintId @ ");", %timeout);
Client::centerPrint(%msg, 0);
}
}

// -=- Ewww -=-
function substr(%s, %p, %l){return String::GetSubStr(%s, %p, %l);}

function onClientMessage(%cl, %msg)
{
if (!%cl)
{
if ($PlayingDemo) if (String::FindSubStr(%msg, "You couldn't buy Flag") != -1) return false;

if (String::FindSubStr(%msg, "flag") != -1) Flag::Event(%msg);
else if (%msg == "Station Access On") Fav::Enter();
else if (%msg == "Station Access Off") Fav::Exit();
}

return true;
}

function onClientJoin(%cl)
{
$cl::Team[%cl] = Client::GetTeam(%cl);
$Team[$cl::Team[%cl]]++;
CTF::Update();
}

function onClientDrop(%cl)
{
$Team[$cl::Team[%cl]]--;
$cl::Team[%cl] = '';
CTF::Update();
}

function onClientChangeTeam(%cl, %team)
{
$Team[$cl::Team[%cl]]--;
$cl::Team[%cl] = %team;
$Team[%team]++;
CTF::Update();
}

function onMapReset()
{
$Fav::Favorite = 4;

$Flag::Score[0] = $Flag::Score[1] = 0;
$Flag::Status[0] = $Flag::Status[1] = "home";

CTF::Update();
}

function onJoinReset()
{
$Team[-1] = $Team[ 0] = $Team[ 1] = 0;

for (%i=2049; %i<2149; %i++)
if (Client::GetName(%i)!="")
onClientJoin(%i);

$Zoom::Zoom = 2;
Zoom::resetZoom();

$DemoDrop = false;
onMapReset();
}

function onConnection(%msg)
{
$dataFinished = false;
if(%msg == "Accepted")
{
onJoinReset();

resetSimTime();
if ($PCFG::Script != "")exec($PCFG::Script);
resetPlayDelegate();
remoteEval(2048, "SetCLInfo", $PCFG::SkinBase, $PCFG::RealName, $PCFG::EMail, $PCFG::Tribe, $PCFG::URL, 'TSI cheats', $pref::autoWaypoint, $pref::noEnterInvStation, $pref::messageMask);
cursorOn(MainWindow);
GuiLoadContentCtrl(MainWi ndow, "gui\\Loading.gui");
renderCanvas(MainWindow);
}
else
{
echo("Retry @ " @ timestamp());
schedule("connect($Server::Address) ;", 0.75);
}
}

function remoteMissionChangeNotify (%cl, %mission)
{
if(%cl == 2048)
{
flushTextureCache();
Schedule("purgeResources(true);", 3);
onMapReset();
}
}

function onExit()
{
Hud::onExit();

if(isObject(playGui))stor eObject(playGui, "config\\play.gui");
saveActionMap("config\\config.cs", "actionMap.sae", "playMap.sae");
$pref::VideoFullScreen = isFullScreenMode(MainWind ow);
export("Server::*", "config\\ServerPrefs.cs", False);
export("pref::lastMission", "config\\ServerPrefs.cs", True);
export("pref::*", "config\\ClientPrefs.cs", False);
}

function kill(){use('Repair Kit');remoteEval(2048,kil l);}
function throwStart(){}
function throwRelease(%desc){remot eEval(2048, throwItem, getItemType(%desc), 1000);}

// -=- Jump -=-
function Jump::Start()
{
if ((Client::GetTeam(getmana gerid()) == -1))
postAction(2048, IDACTION_MOVEUP, 1);
else
{
function Jump::Jump()
{
postAction(2048, IDACTION_MOVEUP, 1);
schedule("Jump::Jump();", $Jump::Delay);
}

Jump::Jump();
}
}

function Jump::Stop(){ function Jump::Jump(){} }


// -=- Team -=-
function Team::Friendly()
{
%team = Client::getTeam(getManage rId());
if (%team == -1)
%team = 0;

return %team;
}
function Team::Enemy(){ return Team::Friendly() ^ 1; }

// -=- Flag -=-
function Flag::GetName(%msg, %search, %teamFlop)
{
if((%idx = String::FindSubStr(%msg, %search)) != -1)
{
%str = substr(%msg, 0, %idx);
if (%str == "You")
%str = Client::getName(getManage rId());
else if (%str == "Your Team")
return ($Flag::Event = false);

$Flag::Name = %str;
$Flag::ClientID = getClientByName(%str);
$Flag::Team = Client::GetTeam($Flag::Cl ientID) ^ %teamFlop;

return ($Flag::Event = true);
}

return ($Flag::Event = false);
}

function Flag::Event(%msg)
{
if (Flag::GetName(%msg, " took the", 1)) {$Flag::Status[$Flag::Team]=$Flag::ClientID; Waypoint::Event($Flag::Te am, $Flag::ClientID);}
else if (Flag::GetName(%msg, " dropped the", 1)) {$Flag::Status[$Flag::Team]="field";$Flag::Timer[$Flag::Team]=476;$Flag::Tag[$Flag::Team]++;Flag::DropTimer($Flag: :Team,$Flag::Tag[$Flag::Team]);}
else if (Flag::GetName(%msg, " returned the", 0)) {$Flag::Status[$Flag::Team]="home";}
else if (Flag::GetName(%msg, " captured the", 1)) {$Flag::Status[$Flag::Team]="home";$Flag::Score[$Flag::Team^1]++;}
else if (Flag::GetName(%msg, " left the mission", 1)) {$Flag::Status[$Flag::Team]="home";}

if ($flag::Event) CTF::Update();
}


function Flag::DropTimer(%team, %tag)
{
if (%tag!=$Flag::Tag[%team]) return CTF::Update();
if ($Flag::Status[%team] != "field") return CTF::Update();

$Flag::Tag[%team]++;
if($Flag::Timer[%team]-- <= 0)
{
$Flag::Status[%team] = "home";
CTF::Update();
return;
}
CTF::Update();

Schedule("Flag::DropTimer("@%team@","@$flag::tag[%team]@");", 0.1);
}

function Flag::Timer(%team)
{
%val=$Flag::Timer[%team];
if (%val < 10) %val="00"@%val;
else if (%val < 100) %val="0"@%val;

return (substr(%val, 0, 2) @ "." @ substr(%val, 2, 1));
}

// -=- Hud -=-
DeleteVariables("Hud::*");
$Hud::Count = 0;

function PlayGui::onOpen() {for (%i = 0; %i < $Hud::Count; %i++) { addToSet(playGui, $Hud::[%i]);Schedule($Hud::[%i, wake] @ "();", 0); }}
function PlayGui::onClose(){for (%i = 0; %i < $Hud::Count; %i++){ removeFromSet(playGui, $Hud::[%i]);Schedule($Hud::[%i, sleep] @ "();", 0); }}
function Hud::onExit(){ for (%i = 0; %i < $Hud::Count; %i++){removeFromSet(playG ui, $Hud::[%i]);deleteObject($Hud::[%i]);} }

//%type = {FearGui::FearGuiMenu, SimGui::Control}
function Hud::New(%name, %x, %y, %w, %h, %wake, %sleep, %type)
{
if (!$Hud::[%name])
{
%i = ($Hud::Count++ -1);

$Hud::[%i] = newObject(%name, %type, %x, %y, %w, %h);
$Hud::[%i, wake] = %wake;
$Hud::[%i, sleep] = %sleep;
$Hud::[%name] = true;
Control::SetVisible(%name , true);
}
}

// -=- Waypoint -=-
function Waypoint::Event(%team, %client)
{
if ($Waypoint::Target == 3) return;

%friendlyCarrier = ( %team == Team::Enemy() );
%enemyCarrier = ( %team == Team::Friendly() );

if ( ($Waypoint::Target == 2) && (%friendlyCarrier) ) Waypoint::TargetFriendly( );
else if ( ($Waypoint::Target == 1) && (%enemyCarrier) ) Waypoint::TargetEnemy();
}

function Waypoint::Target(%cl, %msg, %wav){ if ( %cl != "home" && %cl != "field" && %cl != getManagerId() ) remoteEval(2048, "IssueTargCommand", 0, %msg @ Client::GetName( %cl ) @ %wav, %cl - 2048, getManagerId()); }
function Waypoint::TargetFriendly( ){Waypoint::Target($Flag: :Status[Team::Enemy()], "Escort: ", "~wescfr");}
function Waypoint::TargetEnemy(){W aypoint::Target($Flag::St atus[Team::Friendly()], "Attack: ", "~wattway");}

// -=- Flag Hud -=-
if (!$CTF::Loaded)
{
HUD::New("CTF::Box", 356, 684, 175, 40, CTF::Wake, CTF::Sleep, FearGui::FearGuiMenu);
newObject("CTF::Status0", FearGuiFormattedText, 5, 0, 180, 20);
newObject("CTF::Status1", FearGuiFormattedText, 5, 20, 180, 20);
addToSet("CTF::Box", "CTF::Status0");
addToSet("CTF::Box", "CTF::Status1");
$CTF::Loaded=true;
}

function CTF::SetTeamValue(%slot, %team)
{
%t = $Team[%team];
%s = $Flag::Score[%team];
%l = $Flag::Status[%team];

if (%l == "home") %l = "<f3>Home";
else if (%l == "field") %l = "<f3>Dropped-><f2>" @ Flag::Timer(%team);
else
{
%fixed="";
%l=Client::GetName(%l);
for (%i=0;(%ch=substr(%l, %i, 1)) != ""; %i++)
{
if (%ch=="<") %ch = "\xd7";
%fixed = %fixed @ %ch;
}

%l = "<f2>" @ %fixed;
}

Control::SetValue("CTF::Status" @ %slot, GetWord("F E", %slot)@"-"@%t@" <f3>(<f2>" @ %s @ "<f3>) " @ %l);
}

function CTF::Wake() {CTF::Update();}
function CTF::Sleep() {}
function CTF::Update() {CTF::SetTeamValue(0, Team::Friendly());CTF::Se tTeamValue(1, Team::Enemy());}

// -=- Zoom -=-
function Zoom::Zoom(){postAction(2 048, IDACTION_SNIPER_FOV, 1.000000);}
function Zoom::UnZoom(){postAction (2048, IDACTION_SNIPER_FOV, 0.000000);Zoom::resetZoom ();}
function Zoom::resetZoom(){while($ Zoom::Zoom != $Zoom::DefaultZoom) Zoom::Cycle();}
function Zoom::Cycle(){ postAction(2048, IDACTION_INC_SNIPER_FOV, 1.000000);if( $Zoom::Zoom++ > 4 ) $Zoom::Zoom = 1; }

// -=- Favorites -=-
function remoteITXT(%cl, %msg)
{
Control::setValue(EnergyD isplayText, %msg);
$Station = "Inventory";
if(String::findSubStr(%ms g, "STATION ENERGY") != -1)
$Station = "RemoteInventory";
}

function Fav::Litter(%item)
{
%type = getItemType(%item);
for (%i = 0; %i < 4; %i++)
Schedule("remoteEval(2048,buyItem," @ %type @ "); remoteEval(2048,dropItem," @ %type @ ");", 0.1);
}

function Fav::Enter()
{
pushActionMap("Favorite.sae");
if ($Station == "Inventory")
{
%type = getItemType("Repair Kit");
for (%i = 0; %i < 8; %i++)
Schedule("remoteEval(2048,useItem," @ %type @ ");remoteEval(2048,buyItem ," @ %type @ ");", 0);

}
Fav::Buy($Fav::Favorite);
}

function Fav::Exit(){ popActionMap("Favorite.sae"); $Station = ""; }
function Fav::Buy(%i){ if ($Station != "") schedule("CmdInventoryGui::buyFavor ites("@%i@");", 0.1); }
function Fav::Set(%i, %desc){ $Fav::Favorite=%i; Fav::Buy(%i); remoteBP(2048,'<jc><f2>Favorite: <f3>'@%desc,2); }

// -=- TV.cs -=-
function TV::On()
{
%t = Team::Enemy();
%loc = $Flag::Status[%t];

if (%loc=="field"||%loc=="home") %loc=$TV::cl;
if (%loc=="") return;

$TV::cl = %loc;

if(isObject("CommandGui")) renameObject("CommandGui", "_CommandGui");
if(!isObject("PlayGui/ObsTV")) addToSet(PlayGui, newObject("ObsTV", FearGui::CMDObserve, 0, 0, 1, 1));
remoteEval(2048, CommandMode);
RemoteEval(2048, "scom", -1);
Schedule("CursorOff(mainwindow);", 0.3);
Client::ToggleCmdObserver ("True");
Client::cmdObservePlayer( %loc);
remoteBP(2048, "<JC><F1>Observing: <F2>" @ Client::GetName(%loc), 999);
}

function TV::Off()
{
Client::ToggleCmdObserver ("False");
remoteEval(2048, PlayMode);
if (isObject("PlayGui/ObsTV"))deleteObject("PlayGui/ObsTV");
if (isObject("_CommandGui"))renameObject("_CommandGui", "CommandGui");
remoteBP(2048, "", 0.1);
}

// -=- Demo -=-

function DemoHUD(%a)
{
if (!$PlayingDemo) return;

%t=$simgame::timescale;
if (%a=="faster")%t=%t*1.5;
else if (%a=="slower")%t=%t*0.75;
else if (%a=="pause")%t=0.0;
else if (%a=="normal")%t=1.0;

if (%t<52)$simgame::timescale = %t;
}

// -=- Basic Server Route stuff -=-
function remoteRememberPosition(%c l){ %cl.rememberPosition = GameBase::GetPosition(%cl ); }
function remoteRecallPosition(%cl)
{
if (%cl.rememberPosition != "")
{
GameBase::SetPosition(%cl , %cl.rememberPosition);
GameBase::SetDamageLevel( Client::GetOwnedObject(%c l), 0);
Item::SetVelocity(Client: :GetOwnedObject(%cl), "0 0 0");

Player::SetItemCount(%cl, DiscLauncher, 1);
Player::SetItemCount(%cl, getItemType("Disc"), 15);
Player::SetItemCount(%cl, RepairKit, 1);
Player::SetItemCount(%cl, 29, 1);
Player::mountItem(%cl, 29, $BackpackSlot);
}
}

// -=- Demo Drop -=-
function EndGame()
{
$ConnectedToServer = FALSE;
setCursor(MainWindow, "Cur_Arrow.bmp");
disconnect();

if ($SinglePlayer) TrainingEndGameCallback() ;

$recordDemo = FALSE;
$recorderFileName = "";

startMainMenuScreen();
deleteServer();
QuickStart();

deleteObject(ConsoleSched uler);
newObject(ConsoleSchedule r, SimConsoleScheduler);

if ($DemoDrop)
{
$DemoDrop = false;
$recordDemo = true;
setupRecorderFile();
connect($Server::Address) ;
}
else if($quitOnDisconnect) schedule("quit();", 0);
}

// -=- AutoNamer -=-
function setupRecorderFile()
{
%str = timestamp();
%time = substr(%str, 0, 4)@ "-" @substr(%str, 5, 2) @ "-" @substr(%str, 8, 2) @ "-" @substr(%str, 11, 2) @ "." @substr(%str, 14, 2) @ "." @substr(%str, 17, 2);

if ($ServerName != "") %time = %time @ "-" @ $ServerName;

$recorderFileName = "recordings\\" @ %time @ ".rec";
echo("Recording to - " @ $recorderFileName);
}

// -=- DropMines -=-
function DropMines()
{
%m = getItemCount("Mine");
while ( %m>1 ) {drop("Mine");%m--; }
}

exec("chat.cs");

this is my edit of andrew's 10k

opsayo
03-09-2009, 04:55 AM
Stripped has a really nice litterbug script, you can essentially hold down the button and it won't stop spewing to save your life. I like that. If I extract drop.cs from stripped.vol is there a way to make it function standalone?

edit: I just did some experimenting and that just seems like a server-side restriction so people don't lag the game. Well that question no longer needs to be answered :)

The vehicle station problem only seems to happen on servers as well. I get different things happening when I enter a vehicle station.

My own hosted game:
1) "Fails to buy repair kits/packs" - the config tries to buy 8 repair kits and spew out 4 packs and fails :( The loud beep of fail to buy sounds is really annoying.
2) The vehicle inventory appears - by default the inventory never appears
3) Upon leaving, my hotkeys function properly.

Through a server (hackington, sanctuary, etc)
1) No messages failing to purchase/litter items
2) The vehicle inventory never shows up - behaves like a regular inventory
3) My hotkeys are fucked up until I pull into a normal inventory station again.

While I was looking through the code trying to find the problem in the code, what would account for the differing behavior here? This is the function within favorites.acs.cs that calls the auto-buying at inventories that *shouldn't* happen at vehicle stations, but otherwise works properly in that my hotkeys don't get fucked.
function Favorite::EnterStation(%t ype)
{
pushActionMap("Favorite.sae");

$Favorite::inStation = %type;
//dont do this at a remote
if (%type == "Inventory")
{
Favorite::cheeserepair(8) ;
Favorite::litteritem("repair pack");
}

if (%type != "Vehicle")
Schedule("Favorite::buyFaves();", 0.1);
}

GreyHound
03-10-2009, 04:27 AM
Once you understood how the event system really works you will be able to solve a lot of this stuff easily. If you already know how it works just skip this reply.

This will describe the passive way.
1) While playing the chat is permanently scanned for certain messages. That happens in OnClientMessage(%msg) ...
2) In OnClientMessage or one of the functions called inside the correct events will be triggered that can be "hooked" from somewhere else. Those events have certain parameters. Often Scriptpacks take use o f the same eventnames but the parameter list is different, in another order or just of another size of parameters.

The active way:
1) Where the passive client would parse chat messages for flag events etc. and then trigger the correct event with the important parameters the active client will be called by the server when important things happen. (Those functions are usually located in active.cs or something similar) and deliver all important parameters so you can skip the parsing for that event.

An example: remoteFlagUpdate(...) etc. will be directly called with all necessary parameters. usually this function will not contain much more then Event::trigger(...)

Note: You need to do something like a 3way handshake with the server to enable active behavior.
And: Fstat/zadmin have differences how active functions are named etc. but can easily be wrapped.

With that in mind you should be able to track down the source of event related problems.

opsayo
03-10-2009, 05:09 AM
That's a really informative post, but you vastly overestimate my understanding of the code i'm looking at.

I see Active, Inactive, and Fstat folders, and I think they're all being loaded too. I really don't know... lol.

Dare
03-10-2009, 03:03 PM
http://www.troc.us/forum/forumdisplay.php?f=158

ren is gay but they have an ok forum for this stuff, so does anni.info u could try asking there?

i learnt how to move my chat thing using tree(); maybe u will learn things about events

what you are asking to do seems very complicated
u should just try andrew's 10k config cuz i dont get any of those issues

if i want more than a cluster of 4 packs i just hit the key twice :)

also i bet you can change a value in it to drop more pretty easily

opsayo
03-10-2009, 06:33 PM
Tribes 101 - TribesOne Community (http://www.troc.us/forum/forumdisplay.php?f=158)

ren is gay but they have an ok forum for this stuff, so does anni.info u could try asking there?

i learnt how to move my chat thing using tree(); maybe u will learn things about events

what you are asking to do seems very complicated
u should just try andrew's 10k config cuz i dont get any of those issues

if i want more than a cluster of 4 packs i just hit the key twice :)

also i bet you can change a value in it to drop more pretty easily

yeah i can actually tweak it but 4 is a nice number, it doesn't empty the remote inven with 4 turrets but it's a lot to spew from a regular inven. the thing is lasthope (or some server protection) only lets you spew 4 times from an inven, regardless of size. i used milk-man's config in a server and if you separate hit the spew button it only lets you toss 1 rep pack 4 times. (of course you can also hold down his spew button but thats something else entirely).

Pak
03-26-2009, 12:12 AM
1) In modules/items.acs.cs there are events to drop both kit and mine, anyone know how I use those? (I looked around and wrote a simple keybind in config.cs to drop mines using drop(mine), but I don't know the syntax to drop a repair kit - and it doesn't make use of Andrew's built-in binds which seems more organized to use in Binds.definitions.cs.




EditActionMap("playMap.sae");

function KitDrop()
{
drop("Repair Kit");
}

bindCommand(keyboard0, make, control, "g", TO, "KitDrop();");

:shrug:

opsayo
03-26-2009, 11:10 AM
EditActionMap("playMap.sae");

function KitDrop()
{
drop("Repair Kit");
}

bindCommand(keyboard0, make, control, "g", TO, "KitDrop();");

:shrug:

Thanks, but Lemon already helped me out. I wanted to use Andrew's built-in Drop function.

I still don't know what's wrong with my vehicle station.