Scripts / [STICKY] Visual LUA designer for Game Guru

Author
Message
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 24th Feb 2014 00:45 Edited at: 28th May 2014 21:47
Hello everyone!



I have finally finished this after a weekend of work, so wanted to share it with you. Actually, this is far from finished but it's first usable version. Visual LUA designer for FPSC Reloaded is drag'n'drop tool for creating LUA scripts for FPSC:R, for all those who are not familiar with LUA or programming itself, or are simply afraid of programming or find it boring.





Visual LUA designer with FPSC:R / Core category open



For those who have never written a line of code I suggest checking out code.org introduction tutorial that will give you good entry point for programming and this puzzle-based visual code designer, as I am using it for this project too.



That puzzle on the image above will generate code like this:







Note: Required vld_helpers.lua file currently contains only one function, but the plan is to add more helper functions in future, as LUA support in FPSC:R grows. This file is required only if you use PlayerDist function (for now).



I'm tired and sleepy right now so I won't bother you anymore, here's the link: http://vld.fpscr.tk/



I haven't tested ALL blocks, but this simple demo (and couple of others) worked for me. Let me know if you have any questions or new ideas

TattieBoJangle
10
Years of Service
User Offline
Joined: 7th Jan 2014
Location: United Kingdom
Posted: 24th Feb 2014 00:57 Edited at: 24th Feb 2014 00:58
This is so awesome will you be making it a exe when it is finished many thanks





PC SPECS: Windows 8 Pro 64-bit, Intel I7 4GHz CPU, Asus R9 3GB GPU, 32GB DDR3 MEM
J0linar
GameGuru TGC Backer
14
Years of Service
User Offline
Joined: 3rd Feb 2010
Location: Vienna, AT
Posted: 24th Feb 2014 00:58
Thats a great idea, well done!



suggestions...they gonna come

http://j0linar.blogspot.co.at/



PC SPECS: Windows 8 Pro 64-bit, Intel I7-3630QM 4.8GHz CPU, Nvidia GTX 675M - 2048MB GPU, 16GB DDR3 RAM
PM
Emrys
10
Years of Service
User Offline
Joined: 4th Nov 2013
Location: UK
Posted: 24th Feb 2014 10:48
Great work !



I can see this being a great help to members and growing to be a fantastic tool



PC - Windows 7 64bit, Intel i5, 12Gb Ram, 1TB WD Black, Evga Gefore 760gtx 3GB

Laptop - Windows 7 32Bit, Intel Core 2 Quad Q9000, 4GB Ram, 500Gb WD, ATI Mobility Radeon HD 4850
PM
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 24th Feb 2014 12:03
Thanks guys! FPSC:R/Core category contains all the variables and functions located in FPSCR's global.lua file, and FPSC:R/Helper category shows some helper blocks that can make your game making easier. For example, it would be too hard to access entity's X coordinate without helper block even if the code for that is very simple. Now look at the following picture:







Both of these blocks will generate almost same code, but the second block is much more readable than the first one.







TattieBoJangle wrote: "This is so awesome will you be making it a exe when it is finished many thanks "




I don't think so. This whole system is based on JavaScript (the web browser language) and it will stay that way... I was thinking to add save/edit option for the blocks, but that requires to set up full user account system with registration, login, password reminder, etc... and I don't have enough free time to work on that now, but that should be available in the future.

no signature
MadLad Designs
GameGuru Master
17
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside......
Posted: 24th Feb 2014 13:02
This is great! For those who can't code this is an ideal way to get the best out of reloaded. Something like this should really be integrated into Reloaded itself.



Well done and keep at it!





"I find your lack of grammar disturbing..."



Check out the [FPSC Reloaded FAQ]!
BarZaTTacKS
10
Years of Service
User Offline
Joined: 3rd Feb 2014
Location:
Posted: 24th Feb 2014 19:52
@Avram : This is amazing, I have it bookmarked and think that it should most definitely be eventually built into FPCR. This is great work and I hope you can work with them to have it included.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 25th Feb 2014 00:20
very nice, will definitely suit the FPSC style of gamebuilding

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Fane
11
Years of Service
User Offline
Joined: 9th May 2012
Location: Deutschland
Posted: 26th Feb 2014 08:46
Haha what a great and simple idea I like it. I dont want to use your tool because I code rather myself but I think this tool will help a lot of people here

System: Win 8.1 64 / i5 @ 3,9GHz / GeForce 760 GTX 192 Bit / 8GB RAM
PM
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 26th Feb 2014 21:59
Thanks for the feedback! Well, I'm not using it either because I'm faster at writing codes than assembling blocks (and these blocks can't cover all the magic that can come out of my fingers ), but this is intended to be used by newbies who don't have experience with programming (using visual editor gives less chance for errors).



Anyway, I can't wait for next beta! Hopefully, TGC will add greater LUA support in the upcoming beta, so I can add more core and helper blocks.

spudnick
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 2nd Mar 2014 20:57
What a great tool.

As mentioned it would be a good feature to have in the end product,

Fpscr has such a great community and can't wait to see what else can be created to make this engine so versatile and simple to create amazing games.

So thank you for.
PM
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 3rd Mar 2014 01:09
Looks interesting to me. I don't know anything about coding.



Great tool.



Harry

Harry
PM
Jerry Tremble
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 5th Nov 2012
Location: Sonoran Desert
Posted: 4th Mar 2014 03:11
I can code, but any tool I find that can simplify any job I do goes in my belt. Whether I use it or not depends on the job and the time available. That looks like it may be quite useful. Thank you!
PM
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 7th Mar 2014 22:31
Just so you don't think I'm not doing anything these days... I'm working on visuals and script/user management system while waiting for new beta. Here are two screenshots:





Go Devils
11
Years of Service
User Offline
Joined: 13th Aug 2012
Location: Phoenix Arizona USA
Posted: 9th Mar 2014 17:59
Ok, so I am just getting started with the scripting stuff. My objective was to follow a U-Tube video on how to move a .x file from blender and get it to work in FPSCR. In looking at the entitybank, every .x object has an FPE file. I also noted that the FPE file includes references to LUA scripts such as appear, default, and disappear.



The example in the video showed these reference scripts as FPI scripts rather than LUA. When I finally got the FPE script set correctly (using the LUA rather than the FPI) the object loaded as anticipated. so far so good.



Questions

Even with the change to LUA, will FPE files still be needed to facilitate loading entities going forward?



Is there any tutorial which describes the structure, relationships, and commands for FPE, FPI, and LUA scripts?



What is the difference between FPE and FPI scripts?



With the switch to LUA, will FPI and/or FPE scripts still be acceptable or needed in the future, or is it time to drop these and learn LUA?



Sorry for the new-bee-ish, but I am making progress.

Thanks
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 9th Mar 2014 19:54 Edited at: 9th Mar 2014 19:56
I think you have missed the topic. I am not related to TGC in any way, and this thread is about my Visual LUA designer for FPSCR (WIP).



...but from my humble knowledge:



1) FPI stands for "first person intelligence [script]" and it is being completely thrown out and replaced with LUA programming language. FPI was used to control behavior of entities within your game in old FPSC - in FPSCR, it'll be LUA's job.



2) FPE stands for "first person entitiy" and is basically a config file that describes how is your .x model imported and used within FPSC[R]. FPE is not related to FPI/LUA scripts, except both of these file types are used on game entities, and FPE may reference what scripts are going to be used on entity.

DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 15th Mar 2014 10:11
Looks great Avram. I must admit to preferring to do things the old fashioned way and have never got into these types of system in the past. I'm sure a lot of people would prefer this though, so you are onto a winner!

almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 19th Mar 2014 08:57
ok im confused as always lol, but will try that 1 hour coding lessons thing you linked... thanks





ok 1 hour or so later and I have finished the angry bird and zombie lessons lol... was fun ish, and kinda helpful lol.

but im still not to sure on how to use the lua scripter you made lol, I was going to try and make a loop sound script for reloaded so I can loop sound effects while the player is in the general area. but im not sure what parts I need to use lol..

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 19th Mar 2014 11:02 Edited at: 19th Mar 2014 11:03
I'm not quite sure you can loop sounds in reloaded yet, but you can play sound when player is near your entity. It'd look something like the default code (when you open visual editor), but with "PlaySound0(entity)" instead of "Prompt(Hello world)":







p.s. This isn't tested... I haven't tried to play with sounds in fpscr/lua yet. And the distance of 50 is too small, you'd probably use distance of 300-400 or something like that.

AuShadow
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 19th Mar 2014 13:34
I use player in zone to play sounds, works a treat

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 19th Mar 2014 13:42 Edited at: 19th Mar 2014 14:00
Quote: "I use player in zone to play sounds, works a treat"




me to m8, works fine for me, trouble is its impossible to loop a sound with the engine so far as I can tell.



whats the difference with playsound 0 and playsound 1 please?

also will you be making a key or legend for the meanings of those < > and such?, you know the people who have not 1 bit of coding knowledge lol like me will need such extra help lol.



EDIT





this code above (if I added it to forums right) is a loop sound until player is to far away attempt.

but I have to change some things but not sure how to do it right lol...



so the script_main(e) that needs to be changed right? to what something like loopsound_main(e)?

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 19th Mar 2014 17:14
First, each entity in FPSC can have two sound files assigned to it. PlaySound0 plays first one, PlaySound1 second one.



Second, you need to understand how games generally work and how FPSC reloaded calls LUA code for entities. Generally, each game runs in a endless loop which runs until you pause game or exit game (or win/lose, whatever). This means that your game code will be called again and again, as fast as possible. Now, when you assign a script named "my_custom_behavior.lua" to an entity in FPSC, it will, in each game (endless) loop iteration, call function "my_custom_behavior_main(e)", with "e" being the entity on which the script is operating. So, your function name must match your file name, except you change ".lua" file extension with "_main(e)" in your function name.



Now, if you have infinite loop (and "while true" IS infinite loop, because true is always true) inside the entity function, it may crash whole game, because the engine will call your function, and instead of proceeding with calling other functions, it will wait for your (endless) loop to finish, which will never happen.



So, you need to change your way of thinking. You are always in the game loop, so no need to do something while something else is true. As your function is called numerous times per second, all you need to do is check if the player is near, and then play the sound. Logic tells me that you need to check if the sound is playing too (so it doesn't start it over and over in each function call), but since there is no way to check this in current version of FPSC, I guess FPSC takes care of that automatically.



And yes, I think you can't loop sound in this version of FPSC reloaded.

almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 21st Mar 2014 05:31
hmm ok m8 thanks



i was trying to get this script to work with the sound marker.

or that was the plan at least, no idea if possible though lol, new to all this game making stuff so have no ideas about doing a lot of the things that probably need to be done but it is fun learning and reading everything.

thanks for explaining some of it

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 22nd Mar 2014 02:03
have been working on another script idea, but the builder tool lacks some functions maybe they are called?, its a destroy and replace block I need for a damaged entity to a repaired entity model swap script. the repaired model would then open a gate or activate something else perhaps a gun turret or something like that. kinda like fallout 3 with the safe opening computer or similar thing.

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 22nd Mar 2014 10:20 Edited at: 22nd Mar 2014 10:20
The Visual LUA designer has all FPSC:R functions listed under FPSC:R/Core category. I think what you are trying to achieve is impossible with current version of FPSC:R. I'm sure you can't replace (re-spawn) entities yet and there is also no way to activate another entity... maybe with some hacking, like setting global variable from one script (activating) and checking that variable (if activated) from another script, but there is no "regular" way to activate entities, like we could in old FPSC with FPI scripts.



At this time FPSC:R LUA is very limited. LUA as a language is really powerful, however there are still no ways to call most of the FPSC:R functions from LUA. We just need to wait for TGC to extend number of FPSC:R functions in LUA, and that's very annoying, I know

almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 22nd Mar 2014 11:33
ok avram m8 thanks for reply



wonder how long before we see more script potential

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 23rd Apr 2014 18:23
Looks Fantastic..



Hopefully it will help me greatly to learn as somebody who knows very little about scripting really...



How much is it likely to be ?
PM
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 23rd Apr 2014 21:48
Quote: " How much is it likely to be ? "




How much what?



The access to this web app is free and will remain free (as in free beer). However, as I live by doing programming, I have many other things on my mind these days. Apart from that, I am working on set of OOP LUA classes for FPSC (FPSC:R OOP Framework) and on this one in my free time, so it's all going really slow.

synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 23rd Apr 2014 22:12
Quote: "The access to this web app is free and will remain free "




Really !!



I Was not expecting that .. Incredible work
PM
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 25th Apr 2014 18:01 Edited at: 25th Apr 2014 19:01
The web server where my web site was hosted was compromised this morning and all websites (including my own) were removed from the web server. I don't have a backup of my website (huh), but I do have newer version of the visual designer which still needs some work to make it usable. I will update first post once it's ready and available online.



Sorry for the inconvenience.

almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 30th Apr 2014 16:28
that sucks avram m8 sorry to hear that..

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 1st May 2014 13:07 Edited at: 1st May 2014 16:02
Not a huge issue as other (more important) websites were backed up and I have Visual Lua Designer on my computer. I "just" need to add registration, login and option to save/browse your scripts online hopefully I'll do part of that during next weekend and I could put it back online again soon after that.

almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 10th May 2014 16:06
hows this working out avram m8?, I tried the 1st link and its not working yet

or did you change the link adi?

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
MadLad Designs
GameGuru Master
17
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside......
Posted: 16th May 2014 20:27
I, for one, would love to see this back up and running so I can mess around with scripting, otherwise I'm afraid I'll have to unstick this which would be a shame.

Check out the [FPSC Reloaded FAQ]!



Also check out my YouTube Gaming Channel: /user/MadLadDesigns
BarZaTTacKS
10
Years of Service
User Offline
Joined: 3rd Feb 2014
Location:
Posted: 16th May 2014 22:29
I second that, when I finally went to use it I found out it was down.
PM
0Alemar0
17
Years of Service
User Offline
Joined: 25th Jan 2007
Location:
Posted: 17th May 2014 15:40
+1

I'm look on this right now with 007...
Yurif74
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Aug 2013
Location: italy
Posted: 26th May 2014 16:19 Edited at: 26th May 2014 16:22
*post removed*



Amiga 4000 CSMK1 68060@50mhz, 200mb fast, CV64 4mb, Scandoubler, MiniThylacine 4 port USB, FastAta MKVI 4000, DVD+RW, HDD 120gb pio 5.
Yurif74
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Aug 2013
Location: italy
Posted: 27th May 2014 13:59
Any news about that script editor? link still doesn't work..



Amiga 4000 CSMK1 68060@50mhz, 200mb fast, CV64 4mb, Scandoubler, MiniThylacine 4 port USB, FastAta MKVI 4000, DVD+RW, HDD 120gb pio 5.
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 27th May 2014 15:15
Hello again!



Sorry for not being around, after my server crashed (which I mentioned in one of my previous replies), Serbia was hit by worst floods ever (these two events are not related, I hope ), and about a quarter of my country was affected. Last 10 days I dedicated myself to help by running Ushahidi platform for others so they can ask for help online.



As a result, the Serbian police thanked our online community for saving more than 1500 lives! I even got interviewed on Belgrade's local TV station (live)



Now back to the topic: I literally forgot about FPSC and other joys of my life in the past 10 days or so, but the email I received yesterday (about new beta version) reminded me of you guys, so here I am!



I am uploading Visual LUA designer as-is on my server at the moment, and will have to deal with new LUA functions later. I will update this (or post another) reply when it's all up and ready (so you can, hopefully, re-stick this thread).

J0linar
GameGuru TGC Backer
14
Years of Service
User Offline
Joined: 3rd Feb 2010
Location: Vienna, AT
Posted: 27th May 2014 15:20
Glad you are alright and great job on helping the people

kudos

http://j0linar.blogspot.co.at/



PC SPECS: Windows 8 Pro 64-bit, Intel I7-3630QM 4.8GHz CPU, Nvidia GTX 675M - 2048MB GPU, 16GB DDR3 RAM
PM
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 27th May 2014 15:58
wow nice work m8!!



1500 is ALOT of people

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
ozziedave
17
Years of Service
User Offline
Joined: 20th Apr 2006
Location: Australia
Posted: 28th May 2014 04:38
Hi Avram,



Great to hear that you helped in your recent bad floods.



I really like your Visual Designer, and think that it is a great Idea.



I would be prepared to pay for something as easy as that, as I do not know

LUA and don't really want to learn it.



Regards

Ozzie Dave
PM
Yurif74
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Aug 2013
Location: italy
Posted: 28th May 2014 12:37
Hello Avram,

Great job saving lifes!

I heard a little about that flood unfortunately.



i never tried your Visual Designer, i even know a little of lua programming.

your software does appear very useful and, like ozziedave, i would pay for it.



Juri



Amiga 4000 CSMK1 68060@50mhz, 200mb fast, CV64 4mb, Scandoubler, MiniThylacine 4 port USB, FastAta MKVI 4000, DVD+RW, HDD 120gb pio 5.
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 28th May 2014 21:45 Edited at: 28th May 2014 21:46
Ok, here it is, stripped down for basic usability... still needs alot of work done on the user/script management, plus I need to support all the new functions :S



http://vld.fpscr.tk/

smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 29th May 2014 00:04
welcome back! impressive work outside of reloaded too then? just another day for avram

let's hope next month is easier for you though

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 29th May 2014 12:35
Hahaha... far from that...



Anyway, for these guys who would like to pay me, sure... but not for Visual Lua Designer at least not at this stage of development

MadLad Designs
GameGuru Master
17
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside......
Posted: 1st Jun 2014 10:07
Well done for your work outside of FPSCR.



I've re-stuck this Avram.



I've give it a try but it says "you need vld_helpers.lua included to use some functions". Where would i get that from?

Check out my YouTube Gaming Channel: /user/MadLadDesigns



W7 Home 64-bit, Intel i5-3330 quad-core 3.20GHz, nVidia GTX660 2Gb, 8Gb ram
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 3rd Jun 2014 01:33
As I said, it's still WIP and uploaded as-is, so pretty much nothing is linked appropriately. You can find this file here: http://vld.fpscr.tk/vld_helpers.lua

However! The new beta 1.007 does not allow "require" statement in LUA. Some users reported to have it working with some tweaks, but I have not succeeded. But as that file contains only one function, you can copy it to the bottom of your scriptbank/global.lua and it will work.

tomjscott
User Banned
Posted: 3rd Jun 2014 01:42
Quote: "However! The new beta 1.007 does not allow "require" statement in LUA. Some users reported to have it working with some tweaks, but I have not succeeded."


Yes, it does work if you provide the package.path command. I saw it wasn't working for me right off and really needed it so I spent one morning finding the cause and a solution.



Note that the require only needs the file prefix and not the .lua. That may be where you were thrown.

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.007
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 3rd Jun 2014 02:41
Yup, I figured that out myself now I will update the require statement in the generated code.

Login to post a reply

Server time is: 2024-03-29 11:15:36
Your offset time is: 2024-03-29 11:15:36