Jump to content
cyrokrypto

CSSA3 - A Spectator Script for Arma 3

Recommended Posts

CSSA3 is an easy to use spectator script for Arma 3.

Images:

Features:

- Smooth, easy to use camera movement.

- Sorted units list with the ability to easily ‘bookmark’ players or AI.

- Settings can be changed on the fly with the settings menu.

- Free cam, First and Third person view modes.

- Compatible with TFAR, AGM, ACRE2 and probably others.

- Experimental click to interact feature which can be used to easily switch to a unit.

- Customizability for mission makers.

Downloads:

Download v0.3 [Armaholic]

Download v0.3 [Dropbox]

Please report any issues or feature requests in this thread.

Known Issues:

- Click to interact on infantry can be unreliable since there is currently no infantry intersect command.

- First person camera placement can be a bit unreliable.

- Click to interact doesn't work under water.

Planned Features:

- Smarter freecam camera placement.

- Adaptive map and HUD updating based on frame rate.

- Improved map markers.

- Improved third person mode.

Installation:

1. Extract the ‘CSSA3’ folder and ‘stringtable.xml’ to your mission directory.

2. Add the following line to the init.sqf file:

[] execVM "CSSA3\CSSA3_init.sqf";

3. Add the following to your description.ext:

respawnDelay = 9999999; // 9999999 = No Respawn;
//Changes respawn, respawnDialog and respawnTemplates parameters.
#include "CSSA3\CSSA3_header.hpp"

Configuration:

Please check the included CSSA3_readme.txt.

Credit:

Created by Cyrokrypto

Thanks to:

- BIS's Karel Moricky for the splendid camera function.

- Zulu Alpha's Phoenix for snippets of code.

- The Zulu-Alpha and BDR communities for testing.

- LordHeart for code recommendations.

- {BDR} Nemesi for the Italian translation.

- Everyone else who helped me out.

Changelog:

Version 0.3

- Fixed slow listbox updating, (onEachFrame and diag_tickTime used instead is spawn and sleep.) Thanks LH.

- Added function to force CSSA3 to close (won't re-open if player is dead): [] call CSSA3_fnc_forceClose;

- Overall performance improvements.

- Fixed compatibility with AGM.

- Minor HUD tweaks.

Version 0.2

- Added variables allowing advanced configuration. (Allowed perspectives, spectatable sides, force players only)

- Rewrote unit list updating (now faster)

- UI positioning fixes.

- Localization fixes.

- Fixed RPT spam.

- Removed filter when player dies under water.

- Mutliple other bug fixes.

Edited by Cyrokrypto

Share this post


Link to post
Share on other sites

Congrats on the release Cyrokrypto. I will give this a try soon.

Share this post


Link to post
Share on other sites

Release frontpaged on the Armaholic homepage.

================================================

You are not registered on Armaholic, or at least not that we are aware of. Soon we offer the possibility to authors to maintain their own pages.

If you wish to be able to do this as well please register on Armaholic and let me know about it.

This is not mandatory at all! Only if you wish to control your own content you are welcome to join, otherwise we will continue to follow your work like we have always done ;)

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

Thanks a lot, Foxhound. I've added the Armaholic download link to the post.

Congrats on the release Cyrokrypto. I will give this a try soon.

Thanks, enjoy. :)

Share this post


Link to post
Share on other sites

Really nice, I like the way you've set it up. I'll definitely be making use of this, thank you.

One thing I'd like to ask however as I don't recall seeing anything in the readme(s)... Is it possable to 'terminate' the spectate scripts/functions on units with a command or similar?

Keep up the good work.

Regards Hawk.

Share this post


Link to post
Share on other sites
Really nice, I like the way you've set it up. I'll definitely be making use of this, thank you.

One thing I'd like to ask however as I don't recall seeing anything in the readme(s)... Is it possable to 'terminate' the spectate scripts/functions on units with a command or similar?

Keep up the good work.

Regards Hawk.

Thanks. You can close it by closing the display:

if (!isNull findDisplay 7810) then {closeDialog 0};

However, if the player is still dead, the script will re-start itself within 5 seconds. So another option would be to set the player's respawn time to 0, forcing the player to spawn (if you do this, the above code will not be required):

setPlayerRespawnTime 0;

Just make sure that you set the respawn time back to what it should be afterwards, since it will now be 0 whenever the player dies.

I will add a way to force close it in the next version.

Edited by Cyrokrypto

Share this post


Link to post
Share on other sites

Thanks for the release!

Sadly I did not find any time to test it yet but maybe you can still answer my question.

Regarding TFAR and CSSA3:

Is it possible to talk with other spectators and at the same time hear alive players talking?

Share this post


Link to post
Share on other sites
Thanks for the release!

Sadly I did not find any time to test it yet but maybe you can still answer my question.

Regarding TFAR and CSSA3:

Is it possible to talk with other spectators and at the same time hear alive players talking?

Currently this is not possible with TFAR. Spectators can hear one another, however. I recall that this was mentioned by the lead TFAR developer on the Github issue tracker a while ago, so it might happen. Once it does, i'll definitely implement it.

Here it is.

Edited by Cyrokrypto

Share this post


Link to post
Share on other sites

Bugreport - when used with AGM it causes screen to go blurry after death:

vcdC787.jpg

Share this post


Link to post
Share on other sites
Bugreport - when used with AGM it causes screen to go blurry after death:

http://i.imgur.com/vcdC787.jpg

Thanks for the report. I could not reproduce this, but looking at the AGM medical functions, it seems as though 'AGM_Unconscious' has been changed to 'AGM_isUnconscious' in one of the latest patches, so this might be the problem. I will fix this in the next version (which i'll try release this weekend), else if you want to fix it yourself for now, you can do the following:

Open CSSA3\functions\fn_CSSA3_mainFunctions.sqf

Go to line 134, you will see this:

player setVariable ['AGM_Unconscious', false];

Replace that line with the following:

player setVariable ['AGM_isUnconscious', False, True];

Please let me know if this works if you do try it. :)

Edited by Cyrokrypto

Share this post


Link to post
Share on other sites

I have updated CSSA3. I recommend that anyone who uses AGM update to the new version. See the post above.

Download v0.3 [Armaholic]

Download v0.3 [Dropbox]

Changelog:

Version 0.3
- Fixed slow listbox updating, (onEachFrame and diag_tickTime used instead is spawn and sleep.) Thanks LH.
- Added function to force CSSA3 to close (won't re-open if player is dead): [] call CSSA3_fnc_forceClose;
- Overall performance improvements.
- Fixed compatibility with AGM.
- Minor HUD tweaks.

Edited by Cyrokrypto

Share this post


Link to post
Share on other sites

New version frontpaged on the Armaholic homepage.

================================================

You are not registered on Armaholic, or at least not that we are aware of. Soon we offer the possibility to authors to maintain their own pages.

If you wish to be able to do this as well please register on Armaholic and let me know about it.

This is not mandatory at all! Only if you wish to control your own content you are welcome to join, otherwise we will continue to follow your work like we have always done ;)

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

Your spectator script might be the thing I've been dying to see for ages. I'm trying to configure a 65+ player mission for our group and every spectator script I've tried doesn't properly hook with TFAR so dead players can watch and can't hear. Once I figure out event handlers to make it so on first death people respawn but second death your spectator script kicks in I'll let you know how it performs with 65+ people!

Share this post


Link to post
Share on other sites
Your spectator script might be the thing I've been dying to see for ages. I'm trying to configure a 65+ player mission for our group and every spectator script I've tried doesn't properly hook with TFAR so dead players can watch and can't hear. Once I figure out event handlers to make it so on first death people respawn but second death your spectator script kicks in I'll let you know how it performs with 65+ people!

Great! That feedback would be very valuable.

The easiest way to set up what you want is the following:

1.) Add the following to the top of your init.sqf:

hasRespawned = false;

2.) Set the respawn time (for first respawn) in the description.ext

respawnDelay = 60;

3.) Now navigate to CSSA3\CSSA3_init.sqf. Go to line 89, where you will find this:

player addEventHandler ["killed", {['killed',_this] spawn CSSA3_fnc_createSpectateDialog}];

4.) Replace line 89 and 90 with the following:

player addEventHandler ["killed", {if (hasRespawned) then {['killed',_this] spawn CSSA3_fnc_createSpectateDialog};}];
player addEventHandler ["respawn", {['respawn',_this] spawn CSSA3_fnc_createSpectateDialog; hasRespawned = true; setPlayerRespawnTime 99999999;}];

This is untested, but it should work.

Edited by Cyrokrypto

Share this post


Link to post
Share on other sites

Finally a decent spectator script.. thank you!

We had 1 script error constantly popping up with rc 3 which was easily resolved by changing the word 'count' on lines 55, 64 and 71 of fn_mainUpdateLoop.sqf to 'forEach'. I assume you're doing this already, but make sure you start the game with -showScriptErrors so you can catch this type of thing without checking your log.

Share this post


Link to post
Share on other sites
Finally a decent spectator script.. thank you!

We had 1 script error constantly popping up with rc 3 which was easily resolved by changing the word 'count' on lines 55, 64 and 71 of fn_mainUpdateLoop.sqf to 'forEach'. I assume you're doing this already, but make sure you start the game with -showScriptErrors so you can catch this type of thing without checking your log.

I am indeed using -showScriptErrors, although I'm unable to reproduce your error. Could you possibly send me the .rpt?

Share this post


Link to post
Share on other sites

I haven't had the chance to try it yet. Does it have a feature to completely disable all UI elements (for improved screenshots/videos)?

Share this post


Link to post
Share on other sites
I haven't had the chance to try it yet. Does it have a feature to completely disable all UI elements (for improved screenshots/videos)?

Yes. The HUD can be hidden by pressing the 'H' key.

Share this post


Link to post
Share on other sites

@Cyrokrypto: The error is as follows:

12:35:50 Error in expression <ve _x) && {isPlayer _x}) then {_players pushBack _x};
} count (units (_this sele>
12:35:50   Error position: <pushBack _x};
} count (units (_this sele>
12:35:50   Error Type Number, expected Bool
12:35:50 File D:\Users\Lecks\Documents\Arma 3\mpmissions\OP_GAMBIT_REFLEX_test1.FDF_Isle1_a\CSSA3\functions\fn_mainUpdateLoop.sqf, line 54

Oddly enough, it only comes up on multiplayer or dedicated, not single player/editor. The reason it's complaining is because it's using { } count (units blah), but the code block is returning the result of the pushback (a number) rather than a bool. I don't really see why you're using count here anyway, forEach would make more sense?

We had lots of positive feedback from our group (ASOR) last night.

A few suggestions (don't take this the wrong way, it's still way better than the alternatives):

1. Defining RscCheckBox etc etc in basic_defines.hpp can make your script conflict with other mods that have done the same thing. We didn't have a problem with this, but I had several map developers complain when I did the same thing with ASOR Gear Selector. Safest to add your tag to them (ie CSS_RscCheckBox).

2. Would recommend removing your respawn lines from CSSA3_header.hpp as it crashes the game if people already have them in their map. I'd just put them in the readme.

3. An option for whether or not to use TFAR_fnc_ForceSpectator might be a good idea. Some Teamspeak servers (such as ours) don't allow serious mode, in which case everyone can hear spectators. We just commented the lines, but some people might not be able to find them.

4. Being able to rotate the camera around the player in chase cam would be awesome (rather than it being stuck on his back).

5. When you close the spectator in 'forced' mode, you get the warning that it'll reopen after 5 secs even though it doesn't.

Whether or not you make these changes, it's still an awesome script that we'll continue to use.

Edited by Lecks

Share this post


Link to post
Share on other sites
@Cyrokrypto: The error is as follows:

12:35:50 Error in expression <ve _x) && {isPlayer _x}) then {_players pushBack _x};
} count (units (_this sele>
12:35:50   Error position: <pushBack _x};
} count (units (_this sele>
12:35:50   Error Type Number, expected Bool
12:35:50 File D:\Users\Lecks\Documents\Arma 3\mpmissions\OP_GAMBIT_REFLEX_test1.FDF_Isle1_a\CSSA3\functions\fn_mainUpdateLoop.sqf, line 54

Oddly enough, it only comes up on multiplayer or dedicated, not single player/editor. The reason it's complaining is because it's using { } count (units blah), but the code block is returning the result of the pushback (a number) rather than a bool. I don't really see why you're using count here anyway, forEach would make more sense?

We had lots of positive feedback from our group (ASOR) last night.

A few suggestions (don't take this the wrong way, it's still way better than the alternatives):

1. Defining RscCheckBox etc etc in basic_defines.hpp can make your script conflict with other mods that have done the same thing. We didn't have a problem with this, but I had several map developers complain when I did the same thing with ASOR Gear Selector. Safest to add your tag to them (ie CSS_RscCheckBox).

2. Would recommend removing your respawn lines from CSSA3_header.hpp as it crashes the game if people already have them in their map. I'd just put them in the readme.

3. An option for whether or not to use TFAR_fnc_ForceSpectator might be a good idea. Some Teamspeak servers (such as ours) don't allow serious mode, in which case everyone can hear spectators. We just commented the lines, but some people might not be able to find them.

4. Being able to rotate the camera around the player in chase cam would be awesome (rather than it being stuck on his back).

5. When you close the spectator in 'forced' mode, you get the warning that it'll reopen after 5 secs even though it doesn't.

Whether or not you make these changes, it's still an awesome script that we'll continue to use.

Thanks for the great feedback!

1.) I'm currently busy cleaning up the defines in order to reduce file size, so I will removed this as you recommended.

2.) Good point, I'll do this for the next release.

3.) I'll add a variable for this in the next version.

4.) This is being worked on, but it's still experimental. I'll try and get it done by the next update.

5.) I'll fix this in the next release.

The original 'count' error was due to the count loops looking for a boolean return value. I have fixed this by simply adding 'false' at the end of the loop. The reason I use 'count' is that it is slightly faster than 'forEach', and speed is my priority for code that runs once every second.

Thanks again. :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×