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 Product Chat / Attn Modders: FPSC Custom Compile request

Author
Message
Anigma
15
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 18th May 2012 21:25
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!
The Zombie Killer
15
Years of Service
User Offline
Joined: 27th Mar 2011
Location: Gold Coast, Australia
Posted: 19th May 2012 04:01 Edited at: 19th May 2012 04:14
@Anigma
I'll be glad to make a compile for you. Coming right up.
EDIT: It's compiling, and it's on the latest v1.20 source code.

-TZK

The Zombie Killer
15
Years of Service
User Offline
Joined: 27th Mar 2011
Location: Gold Coast, Australia
Posted: 19th May 2012 04:31 Edited at: 19th May 2012 04:34
@Anigma
Here you go, it's attached to this post.

https://forumfiles.thegamecreators.com/download/2351330

-TZK

Anigma
15
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 20th May 2012 05:44
You rock TZK, thank you! Downloading now!

It compiled! Ship it!
The Zombie Killer
15
Years of Service
User Offline
Joined: 27th Mar 2011
Location: Gold Coast, Australia
Posted: 20th May 2012 05:46
@Anigma
No problem.

-TZK

That Guy John
16
Years of Service
User Offline
Joined: 30th Apr 2010
Location: United States
Posted: 20th May 2012 08:17
... Whoa... wait.. what?
Is this being added to the actual FPSC product source code?

And Here Is A Penguin:
FPSC OneSource [DeskTop App] - Bringing everything together into one.
The Zombie Killer
15
Years of Service
User Offline
Joined: 27th Mar 2011
Location: Gold Coast, Australia
Posted: 20th May 2012 08:19
@That Guy John
No, Anigma asked any modder to add it and then compile it for him, and that's all I did. It would be good if it was implemented though, I would have quite a few uses for it.

-TZK

That Guy John
16
Years of Service
User Offline
Joined: 30th Apr 2010
Location: United States
Posted: 20th May 2012 08:27
Okay good lol
No .. please. No more "features" for FPSC, please...

And Here Is A Penguin:
FPSC OneSource [DeskTop App] - Bringing everything together into one.
The Zombie Killer
15
Years of Service
User Offline
Joined: 27th Mar 2011
Location: Gold Coast, Australia
Posted: 20th May 2012 08:33
@That Guy John
ha ha lol, I get what you mean and I agree. For the most part, I want performance and bugfixes now, v119 has actually accomplished 99% of all I've ever wanted to do with FPSC.

-TZK

Stalker93
17
Years of Service
User Offline
Joined: 1st Sep 2008
Location: Italy
Posted: 20th May 2012 15:48
@The Zombie Killer
I've tried your compiled version just to check out the current r644 update, but it does not work..I click test game, and then it just hangs there, the loading bar completely empty..Could you post a compiled version of the standard r644 update? Thx
JD2
16
Years of Service
User Offline
Joined: 13th Feb 2010
Location:
Posted: 20th May 2012 17:15
Rather than adding yet another command to FPSC, wouldn't it be more efficient to simply add "meridingtransporter" or "lockcamera=0/1" as a definable property to the existing plrmoveto command?
Anigma
15
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 20th May 2012 18:51
Hi TZK,

The compiled version runs for me, so no issues there, but plrmoveto2 doesn't do anything. Did I miss something in my mod? Here's the FPI I'm trying the new command with.



RailController is a little sphere I've made for the purpose of making a rail shooter that in the finished script will be spawned with no shadow and scaled to 0 to make it invisible. It's following the waypoints fine, and plrmoveto works, just not plrmoveto2.

Any ideas?

Thanks again for your help!

It compiled! Ship it!
Anigma
15
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 20th May 2012 19:00
Quote: "Okay good lol
No .. please. No more "features" for FPSC, please..."


OK, LOL then let's "fix" plrmoveto so that it doesn't rotate the player.

It compiled! Ship it!
Hockeykid
DBPro Tool Maker
18
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 21st May 2012 08:37
It would be much easier to just change the "AIACTPLRMOVETO" case to:



While I didn't test it, logically it should make it so doing something like this:



Will stop the camera from rotating.

Sean

Stalker93
17
Years of Service
User Offline
Joined: 1st Sep 2008
Location: Italy
Posted: 21st May 2012 11:36
It's still not working for me, which is weird, since the 1.19 final works perfectly...maybe I'm missing some .dll files..which are needed to run fps creator correctly?
Anigma
15
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 21st May 2012 19:20
Quote: "While I didn't test it, logically it should make it so doing something like this will stop the camera from rotating."


No, meridingtransporter=1 forces the x and z angles to 0:



That's why I added in the meridingtransporter=2 code. But that doesn't seem to work either, so I dunno. At this point I'm ready to strip out all the AI and roll my own mod strictly for making rail shooters so that I can make a two player coop game anyway using a gamepad and mouse or two gamepads (or two lightguns but I don't have the money for that yet lol).

Getting back to stock FPSC, I'd be good with fixing PLRMOVETO in the production source code so that it doesn't turn the player backwards. That's the whole reason I can't use plrmoveto in the first place. I can live with the X and Z axis being locked down while moving.

Pretty please? Technically, it's a "fix" and not a new feature....

It compiled! Ship it!
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 21st May 2012 20:09
Quote: "Getting back to stock FPSC, I'd be good with fixing PLRMOVETO in the production source code so that it doesn't turn the player backwards."


The reason why the player is turned backwards is because of this line:

Quote: "tranmeangley#=entityelement(foundte).ry+180"


First, the fix that we did was to remove the "+180". Second, we created an arrow entity with a transparent texture, making sure the entity's y angle was at 0 (in other words, the arrow's point is at 0 on the y axis). The arrow shows black in the editor so we can see what direction the player will face when using the "plrmoveto" command. We can rotate the arrow in any direction we want. No matter what direction we hit the trigger (i.e. head-on, sideways, backwards), we will move to the entity arrow and always face the way the arrow is pointing.

A simple solution requiring little coding.


Twitter: @NFoxMedia
Anigma
15
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 21st May 2012 20:28
Hi Blackfox,

Yep, I saw the culprit when creating my code.. It's a very easy fix for anyone with darklights and darkai installed. However, I don't have either and don't have the money to buy them at this time. So I can't compile FPSC and get all the functionality of the latest source included with this minor change. Hence the request for someone else to compile it for me. TZK was kind enough to do so but unfortunately the mod I wrote didn't work and the new command does nothing. It's not a huge deal and if someone wants to debug it, great but I'm not expecting anyone to do that. However, for the benefit of others, it would be a great "fix" for v120 if PLRMOVETO didn't turn the player around so others could make use of it for more than just transporters and such.

It compiled! Ship it!
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 21st May 2012 20:39
Quote: " it would be a great "fix" for v120 if PLRMOVETO didn't turn the player around so others could make use of it for more than just transporters and such."


We fixed it ourselves for our source with our traversing levels. As we go back and forth in the multiple levels, my wife noticed the player always faced the door they just came from instead of the direction they were heading into. Hence our fixing that command to work properly, and using the arrow entity to show what direction the player will face exactly. The key is not only the line of code in the source to remove the "+180", but using an entity to move to where the Y angle is at zero, thus our arrow.


Twitter: @NFoxMedia
The Zombie Killer
15
Years of Service
User Offline
Joined: 27th Mar 2011
Location: Gold Coast, Australia
Posted: 22nd May 2012 09:24
@Anigma
If you can supply me with what you want edited, I'll be glad to make another compile for you.

-TZK

Anigma
15
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 22nd May 2012 18:47
Quote: "@Anigma
If you can supply me with what you want edited, I'll be glad to make another compile for you."


Hmmm, OK let's give Hockeykid's idea a shot. In the prod code (line 16503 in r645), just replace the stock AIACTPLRMOVETO case statement with this:



And then in the if statement for meridingtranspoter=1, comment out this line (line 40019 in r645 source):



That should do it.

Thanks again TZK (and Hockeykid also), I really appreciate the help!

It compiled! Ship it!
JD2
16
Years of Service
User Offline
Joined: 13th Feb 2010
Location:
Posted: 22nd May 2012 19:40
Since you are not resetting the camera by commenting out that rotate command, you don't need the "else tranmeangley#=camera angle y()" statement because you are not using it.
JD2
16
Years of Service
User Offline
Joined: 13th Feb 2010
Location:
Posted: 22nd May 2012 19:57 Edited at: 22nd May 2012 23:58
Actually you shouldn't comment out that rotate camera line because it will break the "PLRMOVEIFUSED" command since it was not changed by your modification. Also, you shouldn't commented it out because the whole point of Hockeykid's modification was to add the optional boolean parameter to the "PLRMOVE" command so developers could determine whether to set the rotation of the camera or not in their FPI scripts instead of hardcoding it into the source code.

Rather than comment out the rotate command, you should make it conditional based upon the boolean used with PLRMOVE. If 0, rotate the camera. If 1, don't. That would preserve backward compatibility with FPI scripts that use PLRMOVE and PLRMOVEIFUSED without the additional parameter.

(By the way moderators, get me out of the newbie post sandbox so I can edit my posts. Right now I can't see my pending posts to edit them, so I have to make additional posts like this one.)
Anigma
15
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 22nd May 2012 22:13 Edited at: 23rd May 2012 02:57
Hi JD2,

Definitely agree with you there, but this is a special one-off version of FPSC that I am modding for my own use (anyone else is free to play with it too of course). As far as I know, none of these modifications are going into the production source code.

I'm in newbieville too - can't edit posts. Can a mod fix that for me too? Edit: Fixed! Thanks!

Thanks all!

It compiled! Ship it!
JD2
16
Years of Service
User Offline
Joined: 13th Feb 2010
Location:
Posted: 23rd May 2012 00:05
Quote: "Anigma - As far as I know, none of these modifications are going into the production source code."

Actually I'd like to see the PLRMOVE and PLRMOVEIFUSED commands modified in the official code because they should be more flexible with regards to the camera as your game example demonstrates.

Quote: "BlackFox - The reason why the player is turned backwards is because of this line..."

The real question is why was the camera's y rotation ever flipped 180 to begin with. What was the rationale for always doing that?
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 23rd May 2012 04:11
Quote: "The real question is why was the camera's y rotation ever flipped 180 to begin with. What was the rationale for always doing that? "


That I am not too sure on. We stumbled across the issue with the "plrmoveto" command during one of our developments. We had the player play in part of the level, then after a "briefing" there was a fade hud (black showing for 5 seconds), and we had the player moved to a trigger point. It was there we discovered each time the player was facing backwards. We tried with the win zone or another entity, and each time the player was facing the opposite way. During our "traversing levels, we decided to fix it since we felt if you move from level 5 back to 4, you should be facing the direction you are traveling in, not where you just came from. That led to us creating the arrow and removing the "+180" as I discussed earlier, and have never had an issue since then.


Twitter: @NFoxMedia
JD2
16
Years of Service
User Offline
Joined: 13th Feb 2010
Location:
Posted: 23rd May 2012 07:32
I asked the question about the default behavior because I would like the PLRMOVETO and PLRMOVETOIFUSED commands changed in the official source to be something like:

PLRMOVETO=<entity to move to> <nocameralock 0/1/2>

with the command moving the player to the entity specified and either locking the camera rotation to the entity's camera with 180 degree rotation on y/no rotation on y/no camera lock at all.

so the commands would be more flexible without requiring a source code mod.

Not specifying the second parameter or using 0 would result in the current default behavior of locked camera with 180 degree rotation, which would preserve backward compatibility as it is the current behavior.

A value of 1 would be the same as your fix of removing the 180 degree rotation without changing the source code.

A value of 2 would be no change to the player's camera, which would be what Anigma wants for his rail shooter without changing the source code.
The Zombie Killer
15
Years of Service
User Offline
Joined: 27th Mar 2011
Location: Gold Coast, Australia
Posted: 23rd May 2012 13:53
@Anigma
Here you go, it's compiled.

Attached to post.

-TZK

Anigma
15
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 23rd May 2012 18:26
@TZK

This is AWESOME!!! It works PERFECTLY! Thank you!!

For those interested in using this mod, here's the script and controller object that I'm using with it.

Save in scriptbank as RailController.fpi:


Save in Entitybank as RailController.fpe:


It takes a bit more than this to make a decent rail shooter, as the controller will need to stop when it encounters enemies and that sort of thing, but this will get you the basic movement.

I also noticed that when I tried to build a test game, FPSC crashed. It may just be this computer, but just in case, save the compiled exe as FPSC-Game-Rail.exe to preserve the old FPSC-game.exe file so you are still able to build your game, then use the rail mod to run/test it.

Thank you everyone for your input and help with this! I owe you each some of these!

It compiled! Ship it!
The Zombie Killer
15
Years of Service
User Offline
Joined: 27th Mar 2011
Location: Gold Coast, Australia
Posted: 24th May 2012 10:51
@Anigma
I have recompiled the code as an actual mod, it now adds your modifications via a new command "railmoveplr"
I also made the script more complex to allow the player to stop the movement etc, I'm still working on it though, but I'll give it out to you here when I'm done.

-TZK

The Zombie Killer
15
Years of Service
User Offline
Joined: 27th Mar 2011
Location: Gold Coast, Australia
Posted: 24th May 2012 11:19
@Anigma
Here you go, attached.

-TZK

Anigma
15
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 24th May 2012 18:56
Wow, TZK this is way cool! Plus the source is included, awesome! I really need to get my hands on DarkAI and Darklights, because I think I've been bitten by the "mod" bug. I tried to create my own one-off by commenting out all the DAI and Lightmapper stuff but something went wrong and I now have an open if statement somewhere. Ugh.

Do you happen to know what the latest version of the FPSC source code is that didn't need DarkAI? I might start there and see what I can do on my own. I know I'll need to download and install that version of FPSC also to build maps for it, but that's OK - it'll just be for my own use and for fun.

One thing to report about the previous version you built - for some reason, it won't run on my desktop machine. the stock FPSC-Game.exe runs fine but yours just sits there and won't open. I checked the application logs and it says it encountered a fault in an unknown module (real helpful, thanks Microsoft). Anyway just thought I would mention it in case anyone else reports the same thing. I'll report back what this one does.

Thanks again for all the awesome work! This is great stuff.

It compiled! Ship it!
The Zombie Killer
15
Years of Service
User Offline
Joined: 27th Mar 2011
Location: Gold Coast, Australia
Posted: 25th May 2012 06:32
@Anigma
I have no idea, I think v1.16 was the last version that didn't need DarkAI, but it's a terrible version to use.
I really wouldn't recommend commenting out the other lines, a lot of them are required now. Fault in an unknown module, probably means there was an error with a DLL.
I may soon remove the need to purchase DarkLIGHTS from the X9 Modder's Kit, but DarkAI, you'll probably always need.

-TZK

Anigma
15
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 25th May 2012 23:02
Hi TZK,

What I'm finding as I go along is that rail shooters and FPS's have simularities but are in reality two very different genres. Hence the idea of compiling without the DARK AI commands. To really make a decent rail shooter out of FPSC I need to build it so that all it does is load the level and all the entities, and then my own custom code would take over from there. That's not a simple mod though so I'm probably better off starting fresh with my own program that just loads the level geometry and maybe the entities/doors/etc.

Might make for a good project for the long weekend. We'll see.

Since you're a seasoned modder, if you can point me to the relevant parts that deal with loading a level and the entities, that'll save me some time. No big deal though if that's asking too much - I'll eventually figure it out.

Thanks again!

It compiled! Ship it!
The Zombie Killer
15
Years of Service
User Offline
Joined: 27th Mar 2011
Location: Gold Coast, Australia
Posted: 26th May 2012 03:56 Edited at: 26th May 2012 10:13
@Anigma
I believe it's in the gosub routine "_load_game_scene", so just do a search for "_load_game_scene:" in the DBP or X9 Modder's Kit editor.

-TZK

Marc Steene
FPSC Master
20
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 27th May 2012 11:10
TZK, would it be possible for you to do a custom source compile for me aswell? I've written the code for a command which allows an entity to emit a constant light (so you can use it for flashlights, TOD systems etc).

Insert these two lines into the lists of actions



Insert this just below the code for ACACTFLASH:



Add this just below the code for _lighting_spotflash




Official LightStorm Engine BETA Tester
/?m=forum_view&t=190541&b=21
The Zombie Killer
15
Years of Service
User Offline
Joined: 27th Mar 2011
Location: Gold Coast, Australia
Posted: 27th May 2012 11:23 Edited at: 27th May 2012 11:55
@Marc Steene
Sure, no problem. I'll do it as soon as I can.

EDIT: I also added in a few things you forgot, or didn't know that was required, you always need a "return" after the end of a gosub, and you need "endcase" after the end of a case. Also, AIACTLAST needs to be one number higher, not equal to the last action constant.
Just letting you know in case you didn't know. I've done it already and it's compiling right now, I'll upload it once it's compiled.

EDIT2: Here you go Marc:
All edited lines start with "rem steene start" and end with "rem steene end"
Source code included.

http://dl.dropbox.com/u/70702956/CustomBuild_MarcSteene.rar

-TZK

Marc Steene
FPSC Master
20
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 27th May 2012 12:41 Edited at: 27th May 2012 12:49
Thanks TZK, I'll give it a test now I'm no expert at this, just playing around with a few of the commands so thanks for your changes.

EDIT: Awesome, it works Only a few issues like only one light being active at a time, not taking colour or range information from setflashred etc but other than that it works perfectly.


Official LightStorm Engine BETA Tester
/?m=forum_view&t=190541&b=21
The Zombie Killer
15
Years of Service
User Offline
Joined: 27th Mar 2011
Location: Gold Coast, Australia
Posted: 27th May 2012 12:46
@Marc Steene
No problem, glad to be of help.

-TZK

Login to post a reply

Server time is: 2026-07-03 15:30:53
Your offset time is: 2026-07-03 15:30:53