Propst Script Classes

Larsboy

Pinball Nudger
Joined
Mar 14, 2006
Messages
6
Reaction score
0
Points
2
As I have discussed on the FP forums, I have made some useful stand-alone classes based on my work with an advanced script engine. These are components other designers can use when building tables.

From my text-file:
Classes are modules of script code, used to create objects that can then be used by the rest of the script. The Propst classes for Future Pinball are useful components when scripting an advanced pinball table, and help take full advantage of the functionality of Future Pinball. I have made them to suit my own needs when making games, and I hope they can be useful for other designers as well. The script objects work as a layer between the FP objects and the table-specific script, managing the objects and automating advanced tasks. When using the objects, the script uses the methods of these objects instead of using the FP methods directly. You don't need to know anything about the inner workings of the classes to use them.

There are classes for handling lights, timers, music and a two-line segment display. I will release packages with the script, documentation and demo tables to show how it works.

The first package is ready for release, so I was just wondering where I should upload it. I see there is a Libraries-category, would that be right?
 
The Tutorials And Demos section in the Future Pinball section would be the place. I'll keep an eye out for it and once there ,myself or tiltjp will approve it ASAP. Thanks for your efforts in creating such resources.
 
Ok, if you think that's ok, I'll upload it there. But keep in mind, this is neither tutorials nor demos, its pre-made objects to use as building blocks.
 
I've uploaded the first package: Light control classes. This is two classes for managing lights, with the following functionality:

AdvancedLight:
* Keeps separate track of basic state and effect state; basic state is remembered and can be changed while effect is running without interrupting it, effects can be timed, and basic state will be restored when time is up. Basic and effect states have separate blink patterns.
* Effects use priority system, so a call to start an effect only affects the light if the priority is at least as high as an already running effect.
* Can keep track of several lights that should always have the same state, so they can be scripted as a single light, and the object applies the state equally to all.
* Each object can have default blink speeds, to simplify running blink effects.
* Can blink with variable speed - interval dynamically changing.

LightCollection:
* Like AdvancedLight, it uses the priority system for effects and keeps track of basic states while effects are running.
* Manages a group of lights, with an individual basic state for each light. Can set the state of all lights or subgroups with single command. Can create sequence patterns for the basic state.
* Versatile and powerful effect system can do any sequence and use any subgroup of the collection. Speed and direction of sequence effects can be changed at any time, or automatically. Can do random effects. Both simple and advanced functions makes it easy to run regular effects while more advanced things are also possible.

LightCollection is the most interesting of these, as it can do a LOT of different effects. Read the readme-file for more information, and check out the demo table for examples. It demonstrates the different methods and effects, with comments on the display, and you advance the demonstration with the flipper buttons.
 
Larsboy said:
Ok, if you think that's ok, I'll upload it there. But keep in mind, this is neither tutorials nor demos, its pre-made objects to use as building blocks.

Ah, OK, I've approved your upload and placed it in the libraries section.

Thanks.
 
Thanks Larsboy, for making your classes availible here. I'm sure that there are a lot of authors who will find them useful. Thanks for approving them Steve.
 
Thanks for uploading the file Larsboy, there were problems with adding the file which I have corrected.

Jon
 
I've uploaded the second package: Timer classes. This is two classes for running timed events, with the following functionality:

Schedule:
* A general timer for running events once after a specific period of time; eliminates the need to make a timer object for every timed event in the script.
* Very simple to use: simply enter the line of code to run with the time.
* Keeps track of up to 40 timed events at once, and can cancel or immediatly run all waiting events.
* For added control, events can be entered with id so specific events can be cancelled, and as unremovable.

PeriodicEvents:
* Run specific code at regular intervals for as long as the timer is active.
* Run specific code periodically, possibly randomly, when nothing is happening in the game (to remind the player what to do, or do idle effects).
* Manage events that time out, like resetting targetbanks. Can do effects when time is low, reset the timer, and have an extra grace period.
* Can manage up to ten timed events at once. The object as a whole can be paused and reset, and individual timers can be stopped, reset to start and have time added.

The Schedule object should be of interest to most authors, as it is probably the easiest to use and most useful of all my classes. It greatly simplifies running something after a set amount of time, as you don't need to make a timer object, you just say objSchedule.Enter "codeToRun", time
 
I've uploaded the third package: Display classes. This has a display driver handling a two-line segment display - a stand-alone version of what I used in Truxton. Functionality:

Display:
* Manages four FP display objects as a single object in the script - display has two lines, and is replicated on the hud. Hud version always shows the same as backbox version.
* Number of digits and other parameters can be customised.
* Text messages are automatically centered, and scores are correctly formatted.
* Basic in-game function is showing score and ball number, and this screen is always restored when nothing else is going on.
* Timed messages stay for a short amount of time based on priority.
* Constant messages can replace the game status screen until removed, and will be remembered while timed messages use the display.
* A queue system shows a queue of screens, automatically advancing at periodic intervals. It can be paused, and is automatically paused and remembered when the display is used for timed or constant messages.
* Messages use priority system, only replacing a current message if the new message is at least as important. Basic game info, a constant message, a queue and a timed message can all be in display memory at once, and the priority system decides what is shown.
* Automates doing effects for updating score and showing messages.
* Can use all FP display effects. Makes full use of advanced FP effect capabilities, including blinking parts of messages, custom cursors and characters, and boredom effects.
* Coordinates effects for both lines - text can scroll form one to the other, movement can be opposite direction on second line, and a custom cursor can span both lines.

ModeTimers:
* Manages timed modes and other timed events that may need to show time remaining on the display. Up to ten modes can be running at once.
* Can show seconds remaining on the display (timed messages will still get shown if priority is high enough).
* Can run mode code every second, just before timing out, and when timing out.
* Timers can be paused, stopped and have time added.
 
Larsboy, thanks again for sharing your knowledge and Classes with the less experienced FP authors. Just from your posts about them, I can see that you've got an understanding of FP that many others lack. I appreciate your efforts, as I'm sure others do..
 
I've uploaded the last of my script classes. This is just a small class for playing music and sound-effects.

MusicPlayer:
* Manages the music-playing system of FP, providing a single point of interaction with this system in the script to automate using the advanced functions and keep things organised.
* Defines up to 20 music tracks, refered to by number. Makes sure only one is playing at a time, and can stop and pause playing.
* Each track can be defined to fade in at start, or have a special lead-in part that is only played once for a looping track. Each track can be defined to loop or not, and if a non-looping track ends, a specified sub can be called.
* Can change volume and speed of track.
* Advanced PlaySound function uses FP music system to play sound effects. Sound can loop specific number of times, fade in, play at different speeds, and even loop with variable speed. Long sounds can be stopped at any time.

The example file is a bit bigger than the others, as it includes some music for the demonstration. This can also be used as an example of the music functions of FP. It has some cool sound capabilities, like changing the pitch/speed, which hardly anyone have used yet.

Hope someone will find my classes useful. I don't think I'll release my full engine template right now, as its not exactly user-friendly, and very large and complex. These classes should give people enough to play with for a while, if anyone wants to do advanced scripting.
 
Sounds like a good tidea to hold off the full engine template Larsboy, to give everyone a chance to get acquainted with the individual classes first. Until and if FP acquires a few more features and capibilities, I'll be sticking with VP, but i's nice to know your classes and demos will be there if and when I need them. Thanks again for allowing us to host them.
 
Forum activity
Help Users
You can interact with the ChatGPT Bot in any Chat Room and there is a dedicated room. The command is /ai followed by a space and then your ? or inquiry.
ie: /ai What is a EM Pinball Machine?
  • No one is chatting at the moment.
      Mibs Mibs: StevOz has posted a new reply in the thread "Post interesting videos you found on YouTube".
      Back
      Top