[UT] Item granting spectator-like behaviour

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

draconx

RuneUT
Jun 26, 2002
325
0
0
36
Waterloo, Canada
Okay i'm still working on my RuneUT mod here, and i'm trying to make a rune to do the following (it's kinda hard to explain.... if you've ever played Alliance for Q3, its exactly like the Wizard Eye from that): The rune is activated and the player gets control over a flying camera type thing (like a spectator). It is invisible (or i might give it some sprite or something, but thats not important) and the playerpawn is still at the original location and can still be killed.

Ideally the playerpawn would also automatically feign death when the rune is activated, but this is not important at all until afterwards (I know playerpawn has a FeignDeath() function in the PlayerWalking state, and ive made it feign death normally just fine with that - might work or might not depending how the cam is done)

Okay i took a look at CameraSpot by Mychaeel, and for starters tried running it like this:
Code:
ViewPoint = Spawn(class'RuneUT.CameraSpot', , , Owner.Location, Owner.Rotation);
Viewpoint.CameraSpotSet(PlayerPawn(Owner));
I figured that once the viewpoint is properly set, it can be moved in a similar way to the guided warshell. (Although stopping the playerpawn itself from actually moving might be tricky - perhaps set physics to PHYS_NONE?) - Alas, the viewpoint didnt get set at all, and activating the rune did nothing whatsoever.

So if that is the correct path to be taking when trying to make this, what am i doing wrong? and if not - what should I be doing instead? Any help on this issue is greatly appreciated.
 
Last edited:

draconx

RuneUT
Jun 26, 2002
325
0
0
36
Waterloo, Canada
Okay i've been playing around with it a bit, and i've almost made it work. The catch is, it seems that spawning the CameraSpot when it is needed doesnt work. In my tests, i worked around this by making a tiny map, planting a CameraSpot in the map (with all its default properties to emulate what happens with a Spawn()) Then by using an AllActors iterator, i found the CameraSpot actor, and triggered it. It works when i do this - i got all the code for moving it, turning it, etc all going and all i need is to fix this last thing. Here's what i've got:
Code:
foreach AllActors(class'Actor', Other)
{
	if (Other.IsA('SightCameraSpot'))
	{
		Viewpoint = Other;
		break;
	}
}
Viewpoint.Trigger(Owner, Pawn(Owner));
This works great, but requires a SightCameraSpot to be existant in the map beforehand, and multiple runes = multiple players controlling the same camera. Not good in practice.
Code:
Viewpoint = Spawn(class'RuneUT.SightCameraSpot', , , Owner.Location, Pawn(Owner).ViewRotation);
Viewpoint.Trigger(Owner, Pawn(Owner));
This is where it stops working, the CameraSpot doesnt even appear to spawn at all. I've put a log() statement in the Trigger event of it, and they dont end up in the log with this method (they do with the first of course though). I really don't understand why this thing isnt spawning when i tell it to. I would appreciate any help on the matter with spawning this thing. Thanks.
 

draconx

RuneUT
Jun 26, 2002
325
0
0
36
Waterloo, Canada
Hah i solved my own problem just minutes after posting that. It appears that "InitialState" gets ignored when an actor is spawned. Simply adding Viewpoint.GotoState('RotateNone'); before triggering it did the trick. Thanks anyway :)