[Info] Shoutcast scripts?

User avatar
Fixious
Posts: 475
Joined: Sat Nov 09, 2013 12:42 am

[Info] Shoutcast scripts?

Post by Fixious »

Anyone have some decent scripts for someone interested in casting T1? Something to easily switch between specific players for instance, instead of having to use the Tab menu. At the very least, a way to switch to either flag carrier. I know 1.40 has a bind to switch to your flag carrier, but only if you're on their team. Not sure how this would work with someone not on a team (observing).
perrinoia
Site Admin
Posts: 3732
Joined: Sun Jul 01, 2012 7:18 pm

Re: [Info] Shoutcast scripts?

Post by perrinoia »

I know how to make server-side scripts that do that...
Image
AnniDv6
Posts: 1031
Joined: Mon Dec 12, 2011 3:25 pm

Re: [Info] Shoutcast scripts?

Post by AnniDv6 »

The observer options are a lot better than they used to be, but some of these things would be really nice to have implemented into the mod. Snap to flag carriers would be great.
User avatar
Fixious
Posts: 475
Joined: Sat Nov 09, 2013 12:42 am

Re: [Info] Shoutcast scripts?

Post by Fixious »

No client-side stuff though? Warwitch (old t1 caster) and phr33ky are planning on casting this Sunday's base pick-ups. Something slightly more useful for them would be awesome. But if nothing client-side exists I suppose they'll just have to deal with it.
AnniDv6
Posts: 1031
Joined: Mon Dec 12, 2011 3:25 pm

Re: [Info] Shoutcast scripts?

Post by AnniDv6 »

None that I've seen. The closest thing would be demo cam which is for recordings.
http://annihilation.info/downloads/plasdemocam_new.zip

Also I know that in the tribes editor you can use Ctrl + 1-9 to set a favorite camera location and Alt + 1-9 to cycle between them.

This is probably it from scripts.vol

Code: Select all


	$ME::camera = editCamera;

	// modifiers
	$ME::Mod1 = false;		// control
	$ME::Mod2 = false;		// shift
	$ME::Mod3 = false;		// alt

   bindAction( keyboard, make, control, TO, IDACTION_ME_MOD1, 1 );
   bindAction( keyboard, break, control, TO, IDACTION_ME_MOD1, 0 );
   bindAction( keyboard, make, shift, TO, IDACTION_ME_MOD2, 1 );
   bindAction( keyboard, break, shift, TO, IDACTION_ME_MOD2, 0 );
   bindAction( keyboard, make, alt, TO, IDACTION_ME_MOD3, 1 );
   bindAction( keyboard, break, alt, TO, IDACTION_ME_MOD3, 0 );

   // bookmark binds
   for( %i = 0; %i < 10; %i++ )
   {
      bindCommand( keyboard, make, control, %i, to, "ME::PlaceBookmark(" @ %i @ ");");
      bindCommand( keyboard, make, alt, %i, to, "ME::GotoBookmark(" @ %i @ ");");
   }
I just don't know how you could translate that into a script that lets you do it on any server without implementing it into the files. Maybe ask plasmatic?
User avatar
DaJ4ck3L
Crow{OZ}
Posts: 3375
Joined: Thu Jul 22, 2010 11:51 pm
Contact:

Re: [Info] Shoutcast scripts?

Post by DaJ4ck3L »

If perr wants to make something for them, I'm sure I could get the admins to add it.

here is a copy of the community code.observer.cs file.

Code: Select all

 $GuiModeCommand    = 2;
$LastControlObject = 0;

function Observer::triggerDown(%client)
{
}

function Observer::orbitObjectDeleted(%cl)
{
}

function Observer::leaveMissionArea(%cl)
{
}

function Observer::enterMissionArea(%cl)
{
}

function Observer::triggerUp(%client)
{
   if(%client.observerMode == "dead")
   {
      if(%client.dieTime + $Server::respawnTime < getSimTime())
      {
         if(Game::playerSpawn(%client, true))
         {
            %client.observerMode = "";
            Observer::checkObserved(%client);
         }
      }
   }
   else if ((%client.observerMode == "observerOrbit") || (%client.observerMode == "observerFirst"))
      Observer::nextObservable(%client);
   else if(%client.observerMode == "observerFly")
   {
      %camSpawn = Game::pickObserverSpawn(%client);
      Observer::setFlyMode(%client, GameBase::getPosition(%camSpawn),
	      GameBase::getRotation(%camSpawn), true, true);
   }
   else if(%client.observerMode == "justJoined")
   {
      %client.observerMode = "";
      Game::playerSpawn(%client, false);
   }
   else if(%client.observerMode == "pregame" && $Server::TourneyMode)
   {
      if($CountdownStarted)
         return;

      if(%client.notready)
      {
         %client.notready = "";
         MessageAll(0, Client::getName(%client) @ " is READY.");
         if(%client.notreadyCount < 3)
            bottomprint(%client, "<f1><jc>Waiting for match start (FIRE if not ready).", 0);
         else
            bottomprint(%client, "<f1><jc>Waiting for match start.", 0);
      }
      else
      {
         %client.notreadyCount++;
         if(%client.notreadyCount < 4)
         {
            %client.notready = true;
            MessageAll(0, Client::getName(%client) @ " is NOT READY.");
            bottomprint(%client, "<f1><jc>Press FIRE when ready.", 0);
         }
         return;
      }
      Game::CheckTourneyMatchStart();
   }
}

function Observer::jump(%client)
{
   //%client.observerTarget = "";

	if(%client.observerMode == "observerFly")
	{
		%client.observerMode = "observerOrbit";
		%client.observerTarget = %client;
		Observer::nextObservable(%client);
	}
	else if(%client.observerMode == "observerOrbit")
	{
		%client.observerMode = "observerFirst";
		//%client.observerTarget = %client;
		//Observer::nextObservable(%client);
		Observer::setTargetClient(%client, %client.observerTarget);
	}
	else if(%client.observerMode == "observerFirst")
	{

      //if (%client.observerTarget != "") {
         //bottomprint(%client.observerTarget, "<jc>Being observed by: <f2>" @ Client::getName(%client), 5);
         //zadmin::ActiveMessage::Single(%client, ObservedBy, %client.observerTarget, false);
      //}

		%client.observerTarget = "";
		%client.observerMode = "observerFly";

		%camSpawn = Game::pickObserverSpawn(%client);
		Observer::setFlyMode(%client, GameBase::getPosition(%camSpawn),
		GameBase::getRotation(%camSpawn), true, true);
	}
}

function Observer::isObserver(%clientId)
{
   return %clientId.observerMode == "observerOrbit" || %clientId.observerMode == "observerFly" || %clientId.observerMode == "observerFirst";
}

function Observer::enterObserverMode(%clientId)
{
   if(%clientId.observerMode == "observerOrbit" || %clientId.observerMode == "observerFly" || %clientId.observerMode == "observerFirst")
      return false;
   Client::clearItemShopping(%clientId);
   %player = Client::getOwnedObject(%clientId);
   if(%player != -1 && getObjectType(%player) == "Player" && !Player::isDead(%player)) {
		playNextAnim(%clientId);
	   Player::kill(%clientId);
	}
   Client::setOwnedObject(%clientId, -1);
   Client::setControlObject(%clientId, Client::getObserverCamera(%clientId));
   %clientId.observerMode = "observerFirst";
   GameBase::setTeam(%clientId, -1);
   Observer::jump(%clientId);
   remotePlayMode(%clientId);
   return true;
}

function Observer::checkObserved(%client)
{
   // this function loops through all the clients and checks
   // if anyone was observing %client... if so, it updates that
   // observation to reflect the new %client owned object.

   for(%cl = Client::getFirst(); %cl != -1; %cl = Client::getNext(%cl))
   {
      if(%cl.observerTarget == %client)
      {
         if(%cl.observerMode == "observerOrbit")
      	   Observer::setOrbitObject(%cl, %client, 5, 5, 5);
         else if(%cl.observerMode == "observerFirst")
      	   Observer::setOrbitObject(%cl, %client, -1, -1, -1);
         else if(%cl.observerMode == "commander")
   		   Observer::setOrbitObject(%cl, %client, -3, -3, -3);
      }
   }
}

function Observer::setTargetClient(%client, %target)
{
	echo ("Entered setTarget...");
	if ((%client.observerMode != "observerOrbit") && (%client.observerMode != "observerFirst"))
		return false;

	%owned = Client::getOwnedObject(%target);
	if(%owned == -1)
		return false;

	if(%client.observerMode == "observerOrbit")
	{
		Observer::setOrbitObject(%client, %target, 5, 5, 5);
		bottomprint(%client, "<jc>Third Person Observing " @ Client::getName(%target), 5);
	}
	else if(%client.observerMode == "observerFirst")
	{
		Observer::setOrbitObject(%client, %target, -1, -1, -1);
		bottomprint(%client, "<jc>First Person Observing " @ Client::getName(%target), 5);
	}

	//mj
	if(%client.observerTarget != %target)
	{
		echo ("sending message to client");
		zadmin::ActiveMessage::Single(%target, ObservedBy, Client::getName(%client));
      //bottomprint(%target, "<jc>Being observed by <f2>" @ Client::getName(%client), 5);
	}
	//endmj

	%client.observerTarget = %target;
	return true;
}

function Observer::nextObservable(%client)
{
   %lastObserved = %client.observerTarget;
   %nextObserved = Client::getNext(%lastObserved);
   %ct = 128;  // just in case
   while(%ct--)
   {
      if(%nextObserved == -1)
      {
         %nextObserved = Client::getFirst();
         continue;
      }
      %owned = Client::getOwnedObject(%nextObserved);
      if(%nextObserved == %lastObserved && %owned == -1)
      {
         Observer::jump(%client);
         return;
      }
      if(%owned == -1)
      {
         %nextObserved = Client::getNext(%nextObserved);
         continue;
      }
      Observer::setTargetClient(%client, %nextObserved);
      return;
   }
   Observer::jump(%client);
}

function Observer::prevObservable(%client)
{
}

}
here are most of the flag calls used in the mod. this mod uses the attachment plugin nofix made a while back. i only added one function just to show an example. probably doing all the edits in attachments / stand alone would be the easiest way for me to get them to add it (all in one file / no overwrite). if i were to do it, i would use remote functions for observers only, and bind them to the number pad. so say someone has the flag, a simple key press of number pad 1 or 2 will take the observer to carrier on team 1 or 2, and if no one has flag, then it just takes you to the flag stand, or wherever it is.

hmmm another idea i just came up with, if the observer presses tab, and selects a name (%clientId.selClient), then presses lets say number pad 3, the remote function will take the observer to that player and close tab. looks like all this can be done with just 3 buttons.

Code: Select all

Attachment::AddAfter("Client::onFlagGrab",					"Flaggie::getSpeed");
Attachment::AddAfter("Client::onFlagPickup",				"Flaggie::getSpeed");

// Flag time
Attachment::AddAfter("Client::onFlagGrab",					"Flaggie::StartTimer");
Attachment::AddAfter("Client::onFlagPickup",				"Flaggie::StartTimer");
Attachment::AddAfter("Client::onFlagCap",					"Flaggie::StopTimer");
Attachment::AddAfter("Client::onFlagDrop",					"Flaggie::StopTimer");

// Position stats
Attachment::AddBefore("Client::onFlagCap",					"Flaggie::DefenseCap");
Attachment::AddBefore("Client::onFlagGrab",					"Flaggie::OffenseGrab");

// Pass detection
Attachment::AddAfter("Client::onFlagDrop",					"Flaggie::GetPasser");
Attachment::AddAfter("Client::onFlagGrab",					"Flaggie::ResetPass");
Attachment::AddAfter("Client::onFlagReturn",				"Flaggie::ResetPass");

function Flaggie::GetSpeed(%team, %name)
{
  %vel = Item::GetVelocity(Client::GetControlObject(%name));
	%speed = Vector::GetDistance("0 0 0", %vel);

	if (%speed > %name.activity["GrabSpeed"]) {
		Stats::Client::replaceScoreNoUpdate(%name, "GrabSpeed", %speed);
	}
}
ps: going to start training sniper tomorrow, to bring my A game this week.
Image
perrinoia
Site Admin
Posts: 3732
Joined: Sun Jul 01, 2012 7:18 pm

Re: [Info] Shoutcast scripts?

Post by perrinoia »

In Tribes v1.40, look at Tribes/config/modules/TV.acs.cs

It contains the scripts for observing other players without switching teams.

I'm not sure what happens if you use it to observe an enemy (or if you are an observer).

If I were you, I'd try to piggyback on that script to accomplish your goals...

You could probably configure it to automatically observe clients when keywords are broadcast in the chat window... Such as someone picked up the flag.

If you've got two players observing/broadcasting, perhaps set each up on a different team, and script them to automatically observe friendly flag carriers... That both team's flag carriers are always observed/recorded/streamed...

Even though they are assigned to a team, they probably shouldn't spawn, if they are just going to be observing... Plus, the TV camera would totally screw them up if they were trying to play and observe simultaneously.
Image
User avatar
DaJ4ck3L
Crow{OZ}
Posts: 3375
Joined: Thu Jul 22, 2010 11:51 pm
Contact:

Re: [Info] Shoutcast scripts?

Post by DaJ4ck3L »

perrs way of saying he not going to write it... damn it... i started writing it from scratch just a min ago. looks pretty good so far, but i havent tested it yet.

and going to keep it all in observer mode. im sure these guys going to be watching the game from there.

ill take a look at the tv script, forgot all about that, but i think what i have so far should work. sent you a pm with my first function.
Image
perrinoia
Site Admin
Posts: 3732
Joined: Sun Jul 01, 2012 7:18 pm

Re: [Info] Shoutcast scripts?

Post by perrinoia »

Yeah, I would write it, but they said it's for tomorrow, and I've had intermittent crippling pain, since noon yesterday, so I can't promise I'll finish anything by tomorrow...

Hopefully I'll pass this fucking kidney stone soon.
Image
User avatar
DaJ4ck3L
Crow{OZ}
Posts: 3375
Joined: Thu Jul 22, 2010 11:51 pm
Contact:

Re: [Info] Shoutcast scripts?

Post by DaJ4ck3L »

Alright sweet. I'll throw you everything I have so far in pm.

and trust me i know the pain lol.
Image
Post Reply