Observer Commands?

Volt Cruelerz

Legions Developer
Possible to snap to flag carrier(s)? The T:A spec tools are honestly pretty awesome. So if you could bring any features from that over to Legions it'd be pretty cool.

  1. Snap to player by look at them.
  2. Scroll wheel adjusts camera speed.
  3. Holding F+clicking snaps to flag carrier. Doing the same with R would snap to the fastest player.
  4. Z turns off the HUD completely(likely already a script for that)

The player info box would be sorta cool as well. It wasn't really needed in the past, but with the inclusion of Cores it could be handy know which one each player has equipped.

1. figured out how to do this
2. should be possible
3. if a function doesn't already exist, you could scan through players and check their inventory for the flag. If they have it, stop scanning and follow. If not, keep going.
4. there's already a keybinding for this in Legions. It's just not set to anything by default
 

Belberith

Legions Developer
3. if a function doesn't already exist, you could scan through players and check their inventory for the flag. If they have it, stop scanning and follow. If not, keep going.
Even simpler than this since the game keeps track of the carriers:
Code:
%this.flagCarrier[0] = -1;
%this.flagCarrier[1] = -1;
That's in the setup function for CtfGame (so %this is CtfGame).

Also, thanks for all the ideas! I'll see to adding them once the main part of observer mode is complete and functional.
 

Belberith

Legions Developer
Oh, ok. Sorry, I understand what you mean now. It refers to the teamIndex of the flag, so CtfGame.flagCarrier[0] would store the player holding the alpha flag.
 

RockeyRex

Legions Developer
Yeah all this was done till somewhere in the middle of reconstruction of our repo I managed to lose all files that I had modified on my end.
 

57thEnryu

Member
Oh, ok. Sorry, I understand what you mean now. It refers to the teamIndex of the flag, so CtfGame.flagCarrier[0] would store the player holding the alpha flag.
so, whenever I type in commandtoserver('observeclient', CtfGame.flagCarrier[0]) it don't do anything....
 

Belberith

Legions Developer
so, whenever I type in commandtoserver('observeclient', CtfGame.flagCarrier[0]) it don't do anything....
Server side data that.

Yes, it needs to be server side. Also, when you want to reference the main game object, you use Game. If the server is running CTF, Game will refer automatically to CtfGame. One other thing is that the parameter needs to be a client, so you need to say Game.flagCarrier[0].client. This won't work if the flag is not being carried, though, since flagCarrier will be set to -1. (But if you say commandtoserver('ObserveFlag', 0); either the flag or whoever has the flag will be followed.)
 

57thEnryu

Member
Yes, it needs to be server side. Also, when you want to reference the main game object, you use Game. If the server is running CTF, Game will refer automatically to CtfGame. One other thing is that the parameter needs to be a client, so you need to say Game.flagCarrier[0].client. This won't work if the flag is not being carried, though, since flagCarrier will be set to -1. (But if you say commandtoserver('ObserveFlag', 0); either the flag or whoever has the flag will be followed.)
THANK YOU FOR THE OBSERVE FLAG CODE, I LOVE YOU!!!!!
 

57thEnryu

Member
Haha you're welcome, but it's all there for you to find in the .cs files.
yah, found it, couldn't really figure out what it was...

either way, this was one of the biggest problems I had to overcome, now that it is overcome, I can focus on the 2 other things that I need to add:
Fastest Player Finder
Player Loadout
 

57thEnryu

Member
sooo, ive kind of come to a roadblock that I cannot figure out for the life of me. its the part of the script where I have to do this:

%wep0 = %targetPlayer.weapon[0]

if (%wep0 == RocketLauncher)

and there is where the trouble is (after the if %wep0 part) Ive tried everything from == "RocketLauncher", $= RocketLauncher, != RocketLauncher, etc, and it still isnt frikin working. can someone help me out plz...
 
Top