Hi gang,
I'm trying to make a rail shooter and have been poking around in the FPSC source to see if there'd be a simple way to mod FPSC to allow for this functionality much easier than stock. I think I've figured out a way, but I need someone who can compile FPSC source in order to try it out (I don't have the necessary plugins or I would do this myself as it's a very minor tweak to the source).
First, some background. In my experimentation with FPI scripting I found that the plrmoveto FPI command works well in conjunction with an invisible entity following waypoints for rail shooter movement. Only one problem though - it also forces the player to the same Y angle (rotation for you non-coders out there) as the entity you've moved to. What I propose is a simple mod that would add one command to the FPI language that would allow you to move to an entity's position without changing the players rotation, leaving them free to use the mouse to look around. In theory, my changes should allow this to happen.
Here's what I propose. First, download the latest FPSC code here: http://code.google.com/p/fpscreatorengine/source/browse/#svn%2Ftrunk
In FPSC-GAME.DBA make the following changes:
1. Insert the following line at line 2026:
#constant AIACTPLRMOVETO2 904
2. Insert the following line at line 12258:
actword$(AIACTPLRMOVETO2)="plrmoveto2"
3. Insert the following code at line 16446:
case AIACTPLRMOVETO2:
foundte=aiactionseq(seq).value
if foundte>0
tranmex#=entityelement(foundte).x
tranmey#=entityelement(foundte).y+75.0
tranmez#=entityelement(foundte).z
meridingtransporter=2
endif
endcase
4. At line 39856, insert the following code:
rem handle transporter mechanism for player (rail shooter mod)
if meridingtransporter=2
rem player coord moved to new location, must deactivate camera collision for movement
position camera tranmex#,tranmey#,tranmez#
cx#=camera position x() : cy#=camera position y() : cz#=camera position z()
cox#=cx# : coy#=cy# : coz#=cz#
camerapositionx=camera position x()+newcamoffsetx
camerapositiony=camera position y()+newcamoffsety
camerapositionz=camera position z()+newcamoffsetz
gosub _ode_playerborble
meridingtransporter=0
endif
Then compile into FPSC-GAME.exe as normal.
This
should add the new command PLRMOVETO2 which will behave exactly like PLRMOVETO except it will not rotate the player or the camera (hence the meridingtransporter=2 instead of 1).
Anyone want to give it a shot? If not I can try it myself, but I don't have darklights and darkai so it will probably suck as I will have to remove that functionality from the code.
Of course if Scene Commander wants to add this to the V1.20 source so that it will become part of vanilla FPSC, that's even better! I'll owe you some of these if you do that, SC!


Thanks for your help everyone!
It compiled! Ship it!