Google+

forums

Third Party Tools / FPI to LUA converter - version 1.0

Author
Message
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 23rd Aug 2017 08:03 Edited at: 29th Sep 2017 09:46
** currently FREE with purchase of SegAutoWelder + other tools and freebies @ this link http://www.gamegurutools.co.uk/ **

Converter now being worked on again from where I left off some time ago. The old thread is now locked so started a new one here.
The app is still WIP and any FPSC commands not converted, a FUNCTION is generate where code can be added. I will doing some of these where possible.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT

Attachments

Login to view attachments
PM
granada
GameGuru TGC Backer
15
Years of Service
Recently Online
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 23rd Aug 2017 10:13 Edited at: 23rd Aug 2017 10:14
Great work mike,nice the way you keep these apps alive and updated.

Dave
Windows 10 Pro
GeForce GTX 1050 Ti
AMD FX (tm)-9590 Eight-core Processor
31.96 GB RAM
1920x1080,60 Hz
PM
GraPhiX
3D Media Maker
12
Years of Service
User Offline
Joined: 15th Feb 2005
Location: Old Trafford - Lancashire
Posted: 23rd Aug 2017 12:30
brilliant stuff got the email thank you
Welcome to the real world!
Windows 10 Pro x64 - Core i7-7700K @4.2GHz - 32GB DDR4 RAM - GeForce GTX 1060-6G 6GB - 1TB NVe SSD
MK83
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 10th Jun 2006
Location: Greeneville, TN USA
Posted: 23rd Aug 2017 18:55
This is what I have been waiting on. Great work.
AMD Phenom x4 9850 2.70 Ghz , 6 Gb ram, 2GB EVGA Geforce GTX 750, Win 10 x64



PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 23rd Aug 2017 19:31
great stuff, I'll keep this thread updated with progress made. Time to get these FPI's converted into LUA as best as possible, will certainly be challenging. First thing to do is rewrite some of the initial code that handles the tokenising of FPSC conditions/actions as I've found a much better and efficient way of doing it. Tons of ideas, it's a case of realising them.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 24th Aug 2017 09:12 Edited at: 24th Aug 2017 09:18
some of the basics in place and I have generated a very crude LUA file , still lots to do and get right, but it's a start.
Here are a couple of pics showing the FPSC door1.fpi script and then a very crude and not fully converted LUA script. The commands in the LUA script have not yet been converted to the GameGuru equivalent (if the comands exist in GG) and also you will notice the the "=" sign in the condition should be "==". The FPSC keywords you see in the LUA script are stored in the program along with the GameGuru equivalents, it's just a matter of changing the FPSC keywords to the stored GG ones i.e. both condition/action keywords.
This will get a little more trickier as the FPI script become more complex as some "STATE" statements can have the same value over multiple lines and these have to be grouped under one condition block in the LUA script.

There are some really odd and unneccesary code in the FPSC FPI script such as ":STATE=4, STATE=0" on a line of it's own. Removing this line from the FPI script does not alter the functionality of the FPI script at all when running in FPSC. The door still opens and shuts no problem when you get close or move away from it.

Any unrecognised actions will be converted to functions. That will be interesting, but with the FPSC source code at hand and tons of programming experience I will get this all working and functional. It will also be interesting what will/won't work in GG.

So I can see a few quirks in the FPI scripts.
After work, I will play around with the code a bit more and see what progression can be made.

Enjoy the day
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT

Attachments

Login to view attachments
PM
Sharey
User Offline
Joined: 24th Aug 2017
Location:
Posted: 24th Aug 2017 16:07
[/quote]Converter now being worked on again from where I left off some time ago. The old thread is now locked so started a new one here.
Will upload some pics as soon as there is something worth looking at. The program reads in the FPI file and splits the conditions/actions as well as storing dictionary information i.e. FPSC standard action/condition commands and GameGuru current commands and replaces the equivalent if it exists. Not very exciting at the moment but will allow multi FPI file select / drag n drop. Any commands that don't have a GameGuru equivalent command will be generated as a LUA function where code will be required to be added. Will see how this all pans out. As GameGuru LUA commands are added, there will also be a way of assigning these to an FPSC equivalent command if it exists and does the same function.
The current program as it stands already needs some big updates as it's not that flexible. Obviously there will be tons of features added as it progresses. I had originally done a GUI for this but for some reason can't find the Tibet 3D Pro code

More to come soon....

[update-found the GUI code I had originally so can start from there, well that will save time]
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT[quote=]
good job, I really admire with your work. Hope to see more your great works!
PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 24th Aug 2017 18:49
@Sharey-thanks for your kind words.

After my dinner will do more coding on this and a rescan of all GameGuru LUA commands as quite a lot have been added since I started this project.
Did some code between my real job and lunch break, which converts the "=" to "==" and adds "end" to end of the condition block.
More to come and hopefully more eye candy.

Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 25th Aug 2017 08:37
LUA file now looking more complete as I add more code. As LUA doesn't like the "$" sign, I will remove these e.g. sound = $0 in FPI file. So some checking of illegal characters needs to be done and handled appropriately. Managed to convert a basic door script and get into GG without any issues and after some minor tweaking got the states to change and display a debug message to show whats going on. Far from perfect yet, but it's a start. Looking at the FPSC source code to see how some FPI commands work/handled, so I can see there being a large library of functions where GG doesn't have the equivalent FPSC command/functionality. Hopefully there will be more flexibility in GG as the LUA commands library grows. I will try to convert/adapt some of the missing commands where possible and turn them into LUA functions. Shame TGC didn't keep the FPI System in some ways, but I think that was down to community vote.


Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
JPH-GAMES
GameGuru TGC Backer
2
Years of Service
User Offline
Joined: 13th Feb 2015
Location: Belgique
Posted: 25th Aug 2017 12:50
You are always great Bored of the Rings
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 26th Aug 2017 09:22 Edited at: 26th Aug 2017 09:40
@JPH-GAMES- thanks , I'm not sure about great but I appreciate the kind words.

More progress with this converter tool and the basic structure is starting to come together quite nicely, far from perfect , but here's a screen shot showing the autodoor.fpi converted to LUA so far. Lots of little things to do such as assigning the "v" in "SetAnimationFrame(e,v)" to the FPI value and getting the operator logic corrected/removed where applicable and some keywords that are in uppercase have not been converted to GG equivalent. The dollar signs have now been replaced by a blank character as it's not valid in LUA. I've compressed the LUA file in the screenshot to get it all in the screen. As you can see in the LUA file it's expanded considerably due to each if...then...end blocks and also I need to add "AND" operator for sub conditions so these will come out wrong at the moment. Some blocks where the "STATE" has the same value will be placed into one if..then..end block instead of coming out multiple times. One thing I noticed when I converted an animated ceiling fan over is that the animation would only loop/play if the PlayAnimation/LoopAnimation LUA commands were in the _INIT section. This was something I had done a video on in the past with the twisterblades. So maybe in some instances it may be that I will place these commands in the _INIT section if this is the only command in the FPI file, so that will be interesting to do. Other things I noticed is that for sounds e.g. a telephone ringing when you get close by will only work if you assign the sound .wav file in the editor. PlayGlobalSound doesn't seem to work at all in GameGuru but the GetGlobalSoundExist ( 1 ) LUA command works which checks to see if the file is loaded/exists when using debug info on screen.
Any I shall endeavor to get more done over this bank holiday weekend between other stuff going on. More updates/news soon.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT

Attachments

Login to view attachments
PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 26th Aug 2017 12:07
Here is a "first glimpse" video of the FPI->LUA converter program and a demo of a simple Payphone LUA script working in GameGuru.
WARNING: there is some technical detail that I go into, if it's not for you and feel it will probably bore the tears out of you, please feel free to not watch or skip the boring bits ha

Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 27th Aug 2017 09:29
LUA conditions/actions now grouped/formatted better that previous draft version and the logical operators now coming out correctly.
The pics below shows current layouts for payphone.fpi->lua and door1.fpi->lua:

More to come soon.

Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT

Attachments

Login to view attachments
PM
JPH-GAMES
GameGuru TGC Backer
2
Years of Service
User Offline
Joined: 13th Feb 2015
Location: Belgique
Posted: 27th Aug 2017 12:10
Very good introduction.
I am really happy with this kind of work
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 27th Aug 2017 14:25
@JPH-GAMES-many thanks, seems to be going quite well so far.

Just converted a trapdoor and animates ok and plays trapdoor sound with a couple of small tweaks to the LUA script.
Off out with my wife for a stroll in the park and a cuppa

enjoy your Sunday
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 27th Aug 2017 20:50 Edited at: 27th Aug 2017 20:51
ok so normally, I don't have a lot of time usually to do small tutoring videos , but will do one soon as may be useful to anyone who wants to get stuck into LUA but are a little unsure where to start or what the syntax/structure is etc. Watch this space.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
seppgirty
Game Guru Backer
8
Years of Service
User Offline
Joined: 3rd Jul 2009
Location: pittsburgh, pa.
Posted: 27th Aug 2017 21:30
Quote: "but will do one soon as may be useful to anyone who wants to get stuck into LUA but are a little unsure where to start or what the syntax/structure is etc. Watch this space."


Excellent. can always use a good tutorial.
Windows 7 Home Premium Service Pack 1.Intel core i5-2300cpu @2.80 GHz 2.80 GHz
RAM 16 gb G-Skill G.SKILL Ripjaws Series 16GB (4 x 4GB) 240-Pin DDR3 SDRAM DDR3 1066 (PC3 8500) Desktop Memory






Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 28th Aug 2017 17:15 Edited at: 28th Aug 2017 17:20
I will be posting a LUA tutorial here shortly. The video will be in parts as it describes how to get started in LUA and uses an example FPSC FPI script (converted to LUA) and will teach you how to get HUDs working (with sound and alphafade effect) in GameGuru.

[update:Here is the video link]


Part 1:
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
granada
GameGuru TGC Backer
15
Years of Service
Recently Online
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 28th Aug 2017 17:23
Cool mike,I will watch this on on my comp.cant code anything at the moment .

Dave
Windows 10 Pro
GeForce GTX 1050 Ti
AMD FX (tm)-9590 Eight-core Processor
31.96 GB RAM
1920x1080,60 Hz
PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 28th Aug 2017 17:45
@Granada: No worries Dave, not sure of your LUA experience, but if you are quite fluent in LUA you probably can skip some of it.

In the video, for the image file reference, replace the '\' to '\\'. Forgot to show that in the video, but will show in the next one.

Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 28th Aug 2017 19:04
Part 2: Getting the HUD to show/position and a trick to hide the HUD/Sprite:

Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 31st Aug 2017 06:23
Part 3 still to come got sidetracked with other stuff.

Some improvements done to the code and I will be now introducing the GUI back in now the main basics seem to be working quite well.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 31st Aug 2017 09:10
Here is Part 3:

Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 1st Sep 2017 09:45
Last LUA tutorial for a while. This video shows how to step through each animation slot (in the FPE i.e. Anim0-Anim4) and step through each animation frame using the E key (step through each frame) and SHIFT (select next animation slot) keys. There is a .lua script available in the default scriptbank, but I decided to create my own, which I've attached here.



Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT

Attachments

Login to view attachments
PM
granada
GameGuru TGC Backer
15
Years of Service
Recently Online
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 1st Sep 2017 12:07
Thanks mike,these are good for me.As I don't have a clue when it comes to any sort of coding.

Dave
Windows 10 Pro
GeForce GTX 1050 Ti
AMD FX (tm)-9590 Eight-core Processor
31.96 GB RAM
1920x1080,60 Hz
PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 3rd Sep 2017 10:23 Edited at: 3rd Sep 2017 11:09
you can also replace g_KeyPressedE etc with GetScancode() == 18 or use other key scancodes. I've updated my code to now use the +/- keys to increment/decrement through anim frames using the GetScancode() command. It's totally up to you though how you want to tackle key presses.

I want to get my character and also third person characters to perform a "breach" on a wall or door so getting back into LUA a bit more. Hopefully will have something working soon.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
MK83
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 10th Jun 2006
Location: Greeneville, TN USA
Posted: 3rd Sep 2017 18:22 Edited at: 3rd Sep 2017 18:22
my head is spinning, so cool!
AMD Phenom x4 9850 2.70 Ghz , 6 Gb ram, 2GB EVGA Geforce GTX 750, Win 10 x64



PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 5th Sep 2017 13:12 Edited at: 5th Sep 2017 13:13
@MK83-hope you're head isn't spinning too much.........

For those that purchased the SegAutoWelder tool, hope to release the first version of the converter in the next few days...maybe sooner so you can have a play around. It's far from perfect yet, but will get you started.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
MK83
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 10th Jun 2006
Location: Greeneville, TN USA
Posted: 5th Sep 2017 16:16
Quote: "For those that purchased the SegAutoWelder tool, hope to release the first version of the converter in the next few days...maybe sooner so you can have a play around."
Just passed out.lol.
AMD Phenom x4 9850 2.70 Ghz , 6 Gb ram, 2GB EVGA Geforce GTX 750, Win 10 x64



PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 5th Sep 2017 21:34
@MK83 -

Here's a progress update vid....getting there. Some more adjustments to do tomorrow and then add in the multi file selector code so you can convert a bunch all in one go....

Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
granada
GameGuru TGC Backer
15
Years of Service
Recently Online
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 6th Sep 2017 00:24
Another great tool on the way .

Dave
Windows 10 Pro
GeForce GTX 1050 Ti
AMD FX (tm)-9590 Eight-core Processor
31.96 GB RAM
1920x1080,60 Hz
PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 6th Sep 2017 08:32 Edited at: 6th Sep 2017 08:34
thanks Dave, I've already (well almost) converted a small level that The Scary Thinker had created. I used the level exporter in Autowelder (or SegAutoWelder) and then converted some FPI scripts with some minor or no tweaking at all. The power puzzle works fine along with the script which when completed opens up a remote door. So am pleased with the progress so far. loads to do and need to apply another small fix to the filename convention as LUA doesn't like script names that begin with a numeric which some FPI scripts seem to have. Plus some small mods here and there.
I was going to start the tool program using the GUI code I originally had in place, but put that on the backburner till I get the main code perfected as close as possible. The GUI can come later.


Maybe if there is enough interest, I might make a vid showing how to take a Scary Thinker level and totally convert it using all the tools. I hope everyone sees where I'm going with this.

Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 7th Sep 2017 08:07 Edited at: 7th Sep 2017 08:08
configuration code now added and multi FPI file select working fine. Drag n drop also works fine. Just need to decide where in GG to dump these converted files out. The safest place so that the program doesn't overwrite any existing LUA scripts with the same name could possibly be /scriptbank/fpitolua/[<any subfolder>]/<.LUA file name>. Any preferences you guys?
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 7th Sep 2017 10:05 Edited at: 7th Sep 2017 11:18
Testing the app now and seems to work smoothly enough for release. so at some point today, I will send out to all purchasers of the SegAutoWelder tool.
Apart from the Autowelder, I will not be working on any more tools other than fixes etc.

[update-window is now hidden but you will still see the file dialog boxes and messages.]
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 7th Sep 2017 18:08
Converter tool v1.0 now sent out to all SegWelder purchasers. Please check your junk email folders just in case. The files have been scanned for viruses.

bw
Mike

Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
MK83
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 10th Jun 2006
Location: Greeneville, TN USA
Posted: 7th Sep 2017 19:27 Edited at: 7th Sep 2017 19:28
Got it, and converted my first script. It worked. See pic attached, why does (state 1) show up in front of the wall. The script I converted was DTIwalkthru wall form the dark egypt pack. Great program. thanks for this.
AMD Phenom x4 9850 2.70 Ghz , 6 Gb ram, 2GB EVGA Geforce GTX 750, Win 10 x64



Attachments

Login to view attachments
PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 7th Sep 2017 19:41
@MK83-glad it works for you. Although they do get more complex and modifications will be necessary.....

the "state" text is called from the PromptLocal command. You can comment this out with "--" without double quotes.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
MK83
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 10th Jun 2006
Location: Greeneville, TN USA
Posted: 7th Sep 2017 20:25
I tried what you said, then tried it, now it says state=0, so I commented out state=0, now when it tries to load the map it gives a .lua error. here's a copy of the script.

--[[ LUA Script converted from FPSC to GameGuru by M.Fowler (c) 2017
Original FPI file can be found under:
F:\Program Files (x86)\The Game Creators\FPS Creator\Files\scriptbank\Dark Egypt-V2\DTIWalkThru.fpi
]]


function dtiwalkthru_init(e)

state = 0 ;

end

function dtiwalkthru_main(e)

if state == 0 then
state = 1
CollisionOff(e)
end


PromptLocal (e,'state=' .. state )

end

function dtiwalkthru_exit(e)

end


--*** ALL FPSC CONDITION/ACTION KEYWORDS CONVERTED ***
AMD Phenom x4 9850 2.70 Ghz , 6 Gb ram, 2GB EVGA Geforce GTX 750, Win 10 x64



PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 7th Sep 2017 20:29
you only need to comment out the "PromptLocal (e,'state=' .. state )" -> "--PromptLocal (e,'state=' .. state )".

Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
MK83
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 10th Jun 2006
Location: Greeneville, TN USA
Posted: 7th Sep 2017 20:34
okay, I see now, thank you so much.
AMD Phenom x4 9850 2.70 Ghz , 6 Gb ram, 2GB EVGA Geforce GTX 750, Win 10 x64



PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 7th Sep 2017 20:48
@MK83- no worries , always good to put some debug variables in a prompt or promptlocal command. You can also use TEXT type commands too.

Global.LUA is the bible of GameGuru LUA.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
MK83
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 10th Jun 2006
Location: Greeneville, TN USA
Posted: 7th Sep 2017 23:00
got another, hopefully you can help, as Im no scripter.

--[[ LUA Script converted from FPSC to GameGuru by M.Fowler (c) 2017
Original FPI file can be found under:
F:\Program Files (x86)\The Game Creators\FPS Creator\Files\scriptbank\Bonus-Egypt\Dark lift-bamboo.fpi
]]


function darklift_bamboo_init(e)

state = 0 ;

end

function darklift_bamboo_main(e)

if state == 0 and (g_PlayerPosY - g_Entity[e]['y']) > == 10 and GetPlayerDistance(e) < 50 then
state = 6
CollisionOff(e)
end

if state == 1 then
MoveUp(e,1)
end

if state == 1 and RAYCASTUP == 20 100 then
state = 2
end

if state == 2 and GetPlayerDistance(e) > 55 and PLAYERASSOCIATED then
state = 3
UNASSOCIATEPLAYER
CollisionOn(e)
end

if state == 3 and (g_PlayerPosY - g_Entity[e]['y']) > == 10 and GetPlayerDistance(e) < 50 then
state = 7
CollisionOff(e)
end

if state == 4 then
MoveUp(e,-1)
end

if state == 4 and RAYCASTUP == 20 0 then
state = 5
end

if state == 5 and GetPlayerDistance(e) > 55 and PLAYERASSOCIATED then
state = 0
UNASSOCIATEPLAYER
CollisionOn(e)
end

if state == 6 and GetPlayerDistance(e) < 50 then
PlaySound(e,audiobank\Bonus-Egypt\lift up-bamboo.wav)
state = 1
ASSOCIATEPLAYER
end

if state == 6 and GetPlayerDistance(e) > 55 and PLAYERASSOCIATED then
state = 0
CollisionOn(e)
end

if state == 7 and GetPlayerDistance(e) < 50 then
PlaySound(e,audiobank\Bonus-Egypt\lift down-bamboo.wav)
state = 4
ASSOCIATEPLAYER
end

if state == 7 and GetPlayerDistance(e) > 55 and PLAYERASSOCIATED then
state = 3
CollisionOn(e)
end

if g_Entity[e]['activated'] == 1 then
state = 11
SetEntityActivated(e,0)
end

if state == 11 and (g_PlayerPosY - g_Entity[e]['y']) > == 100 then
state = 21
end

if state == 11 then
state = 31
end

if state == 21 and RAYCASTUP == 20 100 then
state = 3
end

if state == 21 then
state = 1
end

if state == 31 and RAYCASTUP == 20 0 then
state = 0
end

if state == 31 then
state = 4
end


PromptLocal (e,'state=' .. state )

end

function darklift_bamboo_exit(e)

end


--*** UNCONVERTED FPSC CONDITION KEYWORDS ***

function RAYCASTUP(e)
end

function PLAYERASSOCIATED(e)
end

--*** END OF UNCONVERTED FPSC CONDITION KEYWORDS ***


--*** UNCONVERTED FPSC ACTION KEYWORDS ***

function UNASSOCIATEPLAYER(e)
end

function ASSOCIATEPLAYER(e)
end

--*** END OF UNCONVERTED FPSC ACTION KEYWORDS ***
AMD Phenom x4 9850 2.70 Ghz , 6 Gb ram, 2GB EVGA Geforce GTX 750, Win 10 x64



Attachments

Login to view attachments
PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 8th Sep 2017 06:35 Edited at: 8th Sep 2017 06:38
yes so there are 3 unconverted FPSC commands at the moment. RAYCASTUP, ASSOCIATEPLAYER and UNASSOCIATEPLAYER. For now to get it to compile, you will need to comment out the RAYCASTUP == 20 100 code as LUA/GG won't understand it. And the same for the other 2 commands. These need to have alternative code put in place to work. If I get some time, I will look at those commands, but from what I recall there might not be a GG equivalent command but need to investigate the global.lua a bit further and the FPSC source code will help.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 8th Sep 2017 12:21
Now we should be in luck as there are a couple of commands in GG LUA that could be used with some additional code to replace the FPS ASSOCIATEPLAYER / UNASSOCIATEPLAYER:

Something like:
if associateplayer == 1 then
SetFreezePosition ( new_entityX, new_entityY, new_entityZ )
TransportToFreezePositionOnly()
end

Some math will most likely be involved and luckily that should be no problem with me. If you look at the floating platform.LUA script that will give you some idea of what's involved.

Once I have some more progress with the tool and these commands above, I'll post again here on this thread.
Fun and games with LUA.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 8th Sep 2017 14:39 Edited at: 8th Sep 2017 14:40
for the FPSC commands ANYFURTHER and ANYWITHIN, in GG LUA these can be replaced with the following functions:

+ Code Snippet

Add this global array variable above your _init section of code:
g_ente = {}

Add this variable/initialise in the _init section of your LUA code:

function <your script name>_init(e)
g_ente[e] = e
end

To call these 2 functions use the following in your _main section of LUA code:

function <your script name>_main(e)
if ANYWITHIN(e,g_ente[e],110) == 1 or ANYFURTHER(e,g_ente[e],110) then
--Destroy(e)
end
PromptLocal(e,g_ente[e])
end
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
MK83
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 10th Jun 2006
Location: Greeneville, TN USA
Posted: 8th Sep 2017 17:44
I'll see what I can do, this is all greek to me. Oh, I can't speak greek. lol
AMD Phenom x4 9850 2.70 Ghz , 6 Gb ram, 2GB EVGA Geforce GTX 750, Win 10 x64



PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 8th Sep 2017 18:44
@MK83-don't worry, I will be adding the converted functions for FPSC commands where possible with each release.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 9th Sep 2017 07:17 Edited at: 9th Sep 2017 07:40
You may see commands such as :

GLOBALVAR =
VAREQUAL =
LOCALVAR =
etc

These are built into the FPSC engine and so I will also automatically generate variable tables (arrays) for you to access. In the LUA converted scripts, this will look something like:

g_varindex = {}
for idx = 0 , 99 do
i=idx ; vname = "var"..idx ; vval = idx;
g_varindex[idx]={i=i ; vname = vname; vval=vval ;}
end

The above code is just example only as I am experimenting.

For now you can just add your own global and local variables.
For global variables, you would normally add these above the _INIT section of the code e.g.

g_myglobalvar1 = 0;
g_myglobalvar2 = CurrentPlayerHealth;

For local variables, you could place these within functions such as:

function myfunc()
local l_mylocalvar1 = 0;
local l_mylocalvar2 = l_mylocalvar2 + 1;
return l_mylocalvar2;
end
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 9th Sep 2017 11:13 Edited at: 9th Sep 2017 11:15
Here's a LUA tutorial showing how to access GLOBAL arrays (or tables in LUA) and detect killing 5 zombies that will open a door so that you can get to the next level. The FPI script is Kasseyus's Space Derelict KillCount Door.FPI. This shows how to implement/modify the FPSC legacy commands GLOBALVAR and SETVAR. I've also attached the GameGuru mapfile .FPM and associated .LUA scripts for you to mess around/do whatever with:




The code to handle the GLOBALVAR and SETVAR is subject to change for the next release of the FPI2LUA program. This is all still WIP.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT

Attachments

Login to view attachments
PM
Bored of the Rings
Valued Member
12
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 12th Sep 2017 09:00 Edited at: 12th Sep 2017 09:05
The FPSC keyword ANIMATE now produces the following code to bring it in line with GameGuru, for example the lightmove.fpi is converted from :

+ Code Snippet

(ignore the reference to Ammo pickup, the lightmove.fpi looks as if it just got renamed and modified from the ammo.fpi)

to:

+ Code Snippet

So as you can see the SetAnimation command has been added and the value incremented to 2 instead of 1. This is because Anim0 = 1 and Anim1 = 2 in GameGuru. You can also decide whether to replace PlayAnimation with LoopAnimation GameGuru command. This has all been tested in GameGuru and works fine. Had to turn off "Occludee" parameter to 0 otherwise the entity disappears after animation finishes.

The interpreter code seems to work pretty well now so it's just a case of continuing to convert commands and add functions where possible to replace or add missing functionality.

Hopefully this is going in the right direction. Old FPSC lift scripts now work with some modifications at the moment.

More news hopefully in the coming days....
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: AutoWelder/SegAutoWelder, Entity+Weapon Welder, FPEtoBAT
PM

Login to post a reply

Server time is: 2017-10-24 10:44:30
Your offset time is: 2017-10-24 10:44:30