Zandronum Chat on our Discord Server Get the latest version: 3.2
Source Code

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004007Zandronum[All Projects] Suggestionpublic2022-05-29 07:582022-12-01 18:50
ReporterPenguin 
Assigned ToKaminsky 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version3.1 
Target Version3.2Fixed in Version3.2 
Summary0004007: New actor pointer that can return a player's camera view
DescriptionCurrently TID is required to get the player number that is spying for. Therefore, if players are using the same TID, it cannot be obtained.

Current method
int GetPlayerSpyPN (int MyPN)
{
    SetActivator(CheckPlayerCamera(MyPN)); //TID assignment required
    int SpyPN = ConsolePlayerNumber();
    SetActivatorToPlayer(MyPN);
    
    return SpyPN;
}
Attached Files? file icon 4007.wad [^] (1,946 bytes) 2022-12-01 15:17
? file icon 4007_v2.wad [^] (1,883 bytes) 2022-12-01 18:05

- Relationships

-  Notes
User avatar (0022243)
Penguin (reporter)
2022-05-29 14:53

For server
GetPlayerNumberForSpy()

For client
GetConsolePlayerNumberForSpy()
User avatar (0022262)
Penguin (reporter)
2022-06-04 15:00

I made a mistake. This is correct.
int GetPlayerSpyPN (int PN)
{
    int SpyPN;
    SetActivator(CheckPlayerCamera(PN)); //TID assignment required
    SpyPN = PlayerNumber(); //TID assignment required
    SetActivatorToPlayer(PN);
    
    return SpyPN;
}
User avatar (0022264)
Kaminsky (developer)
2022-06-06 20:11

After some thought and also discussing it with Penguin on Discord, adding a new actor pointer (e.g. AAPTR_PLAYER_GETCAMERA) that returns the actor a player is currently looking from would be more useful, instead of adding one or two new ACS functions that can only return which player is being spied on. As such, this commit adds the new pointer in 3.2:'http://hg.osdn.net/view/zandronum/zandronum-stable/rev/cf213fe93126 [^]'

I updated the ticket info to reflect on the new feature.
User avatar (0022512)
Kaminsky (developer)
2022-12-01 15:23

I uploaded an example WAD to test AAPTR_PLAYER_GETCAMERA. Here's how it works.

1a. If you're spying on yourself, then the message "you are viewing yourself" is displayed on the screen.

1b. If you're spying on another player, then the message "you are viewing another player named {other player's name}." is displayed.

1c. If you're spying on another actor that isn't a player, then the message "you are viewing an actor with the name {actor's name}." is displayed.

2. If you want to change your view to a non-player actor to test 1c, then you can puke the script "ChangeCamera" while an actor is underneath your crosshair. If successful, your view will change complemented by the message "ChangeCamera: found actor with the name {actor's name}." Otherwise, you get the message "ChangeCamera: couldn't find actor."
User avatar (0022516)
WaTaKiD (updater)
2022-12-01 17:38

using ZandroDev3.2-221030-0316windows-x86_64 with the example wad on windows and euroboros linux servers

1a 1b and 1c all work as a spectator at first, but after joining the game the text in the middle of the screen is permanently stuck as "you are viewing yourself" for that client even if going back to a spectator, but can be fixed by reconnecting
User avatar (0022517)
Kaminsky (developer)
2022-12-01 18:07
edited on: 2022-12-01 18:08

I uploaded an updated example WAD that should fix the problem you mentioned. The original script would terminate when the client joined from spectators.

User avatar (0022519)
WaTaKiD (updater)
2022-12-01 18:46

the updated example wad did the trick, things seem peachy now, ty
User avatar (0022520)
Kaminsky (developer)
2022-12-01 18:50

Thanks for checking again, I'll mark this ticket as resolved.

Issue Community Support
This issue is already marked as resolved.
If you feel that is not the case, please reopen it and explain why.
Supporters: No one explicitly supports this issue yet.
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
2022-05-29 07:58 Penguin New Issue
2022-05-29 14:53 Penguin Note Added: 0022243
2022-06-04 15:00 Penguin Note Added: 0022262
2022-06-06 20:11 Kaminsky Note Added: 0022264
2022-06-06 20:11 Kaminsky Assigned To => Kaminsky
2022-06-06 20:11 Kaminsky Status new => needs testing
2022-06-06 20:11 Kaminsky Product Version => 3.1
2022-06-06 20:11 Kaminsky Target Version => 3.2
2022-06-06 20:11 Kaminsky Summary GetPlayerNumberForSpy() => New actor pointer that can return a player's camera view
2022-06-06 20:11 Kaminsky Description Updated View Revisions
2022-12-01 15:17 Kaminsky File Added: 4007.wad
2022-12-01 15:23 Kaminsky Note Added: 0022512
2022-12-01 17:38 WaTaKiD Note Added: 0022516
2022-12-01 18:05 Kaminsky File Added: 4007_v2.wad
2022-12-01 18:07 Kaminsky Note Added: 0022517
2022-12-01 18:08 Kaminsky Note Edited: 0022517 View Revisions
2022-12-01 18:46 WaTaKiD Note Added: 0022519
2022-12-01 18:50 Kaminsky Note Added: 0022520
2022-12-01 18:50 Kaminsky Status needs testing => resolved
2022-12-01 18:50 Kaminsky Fixed in Version => 3.2
2022-12-01 18:50 Kaminsky Resolution open => fixed






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2025 MantisBT Team
Powered by Mantis Bugtracker