Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / How to change camera angle using internal variables?

Author
Message
007
13
Years of Service
User Offline
Joined: 22nd Aug 2011
Location:
Posted: 2nd Oct 2011 07:55
Hello Friends,

I am tweaking the Conjured Chopper, it`s working fine.

I added this line ate the begin of the script:



So if the entity is activated (this happens after player presses "0") the player will be locked on to the chopper and the camera will have an inclination simulating 3rd person view.

I used this because by default this script uses the command associateplayer, and this command does not work good because the entity will move a lot of times faster than the player, so the player (now the player is our camera view) will never be able to follow the chopper, so we wont be able to simulate 3rd person view.

So my solution is working almost perfect, the only problem is that the player never faces the chopper from backwards (like in race games), the player (camera view) will be facing the opposite direction of the movement, so you see like if you were moving backwards:

player facing backwards chopper facing forward
<--------------------- --------------------->

movement direction
--------------------------------------------->

I tried a lot of things, i tried inverting the model direction in 3dsmax, tried fixnewy= 180 / 90 / -90 / 270 on fpe, but also not working.

So my idea is to change the value of the internal variable for camera angle and even position ($CAY, $CPZ,...), so this way we can "create" a 3rd person camera like in racing games.

But as i am new to script, i don`t now how to work with those internal variables.

I tried this:

:activated=13:plrmoveto=chopper,$CAY=180, but nope

Also tried this:

:activated=13:plrmoveto=chopper,globalvar=$CAY,state=90
:state=90:setvar=180

I am not knowing how to change those internal variables, so i ask you dear folks if someone can help me.

Thanks.

007

Goldenye 007 N64
Ched80
14
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 2nd Oct 2011 11:08
I'm afraid you can't change the internal variables, or rather you can't change them to affect the game. The internal variables are, in effect, read only. You can test them, but you can't change them because the values they contain are copied from the 'real' internal variables.

For example, the real player's health value, used by the engine, is copied to the variable $PH so that you can test it within a script. If you use setvar=$PH 8 the value 8 is not copied to the real player's health.

007
13
Years of Service
User Offline
Joined: 22nd Aug 2011
Location:
Posted: 2nd Oct 2011 11:41
Thanks for the repply Ched80,

So internal variables are read only?

Hum,

Ok, but, how can i solve this problem then, that the player view is facing the opposite direction when i use plrmoveto=chopper?

How can i make the player view follow this entity to simulate a 3rd person camera?

Cheers,

Goldenye 007 N64
Ched80
14
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 3rd Oct 2011 08:52
That is a strange one. I can't think of any script commands that can come to the rescue. It must be possible as I've seen CE's racing demo in FPSC - I'd try contacting him directly.

Login to post a reply

Server time is: 2024-11-24 04:23:39
Your offset time is: 2024-11-24 04:23:39