View Single Post
Old 12-25-2017, 05:26 AM
shiva's Avatar
shiva shiva is offline
Pinball Wizard

Join Date: Oct 2004
Location: Abbotsford
Posts: 688
Credits: 0.00
Thanks: 1
Thanked 132 Times in 76 Posts
Rep Power: 21
shiva will become famous soon enoughshiva will become famous soon enough

Been busy, but looks like the player memory system is working. When I go for a coffee, I will test it to just make sure, and then FPX will be released. Crossing my fingers (and toes)

The memory system stores the light state as typed into the script when the ball is drained, and then remembers that light state for each player. When a player starts his next ball, the memory will restore the lights made from the previous ball. In the template, you can also add simple code in the AddEvent "New_Ball" to tell the script what to do if certain lights are restored, I use the "Bally 20k Bonus" feature, if the player has made more than 20 bonus, then he will start with 20 bonus points automatically with each ball afterwards. (Paragon use to do this) Maybe I will do a multiball example as well if I have time.

This is a very simple but very powerful feature to use. This can store values for each player, and will remember BulbOn and BulbBlink states as well. It's a lot simpler for a beginner to use lights, as opposed to complex variables or the nvram code in FP. Everything is automated, you just need to type in the lights you want, like this...
' *** START HERE ***

' * Memory System
	' This stores the light state from the previous player ball to his next ball, even with Multiplayer. The script takes a "snap shot" of the lights
	' defined here, and remembers it's state for all players. Just make sure MemorySlot(x) is in numeric order (1,2,3 etc) and you have 99 slots(or 99 lights)
	' This example just remembers the top guide triggers, any lights "on" will be remembered at the start of that players next ball. 
	' You can set any light to be "remembered" and if needed, add custom code in the AddEvent "New_Ball". The engine itself handles the rest.

 	Set MemorySlot(1)=LightTriggerGuide1
	Set MemorySlot(2)=LightTriggerGuide2
	Set MemorySlot(3)=LightTriggerGuide3
	Set MemorySlot(4)=LightTriggerGuide4
	Set MemorySlot(5)=Light20k
Then, in AddEvent "New_Ball" you clear out and reset all the lights, and at the very end of that code, just call the memory system to load the previous balls lights back in for that player, and then type in any code you need to restore the settings, like in the example here, that restores 20 bonus if the player had made 20 or more bonus the previous ball
				' 	Use this to turn on any lights, reset any variables you use, popup targets etc.
					LightTargetC1.State=BulbOff																			' Turn off TargetC1 light 
					LightTargetC2.State=BulbOff																			' Turn off TargetC2 light 
					LightTargetC3.State=BulbOff																			' Turn off TargetC3 light
					LightSpinner1.State=BulbOff																			' Turn off the Spinner Light
					DropTarget1.SolenoidPulse: PlaySound "droptargetreset",(constSoundVolume)				' Drop Targets reset
					CheckDropTarget1=0 																						' DT variable set to off, resets the case settings to start over
					LightRightInLaneTrigger.State=BulbOff:LightLeftInLaneTrigger.State=BulbOff 			' Inlane lights off
					LightTB1_Inlanes.State=BulbOn																			' Turn on the first light for the target bank
					LightTB1_25k.State=BulbOff:LightTB1_ExtraBall.State=BulbOff									' Turn off the target bank lights
					LightTriggerGuide1.State=BulbOff:LightTriggerGuide2.State=BulbOff							' Top lanes

				' * Memory System *
				' This calls the player memory, and restores any lights made during previous player ball.  you set those lights at the top of the script

					MemoryLoad()																								' This calls the system to set up. You need this here, so do not delete

				' This is the example for code using the memory system. What we tell the script is if the player has made 20 bonus the previous ball, then carry that bonus over to the next ball
				' Several Bally games did this (notably Paragon) 

					If Light20k.State=BulbOn then 																		' Set as MemorySlot(5), if that light is on then
						bonus = 0 																								' Clear the bonus completely
						AddBonus(20)																							' And then add 20 bonus back
					End If
I haven't tested this fully yet, but will give it a go shortly, and either upload this new version if it works, or the previous build if the memory system doesn't to Pinball Nirvana today

FaceBook Page for all my Rants,raves and projects
Next project: FPx Template engine.
Reply With Quote