Home
Products
Community
Manuals
Contact
Login or Signup

Worklog for Malice

PARIS Particle Engine

Return to Worklogs

Nothing to see here folks(Posted 2010-08-15)
Summer's been long, hot and sunny. I've been to Wilton Salisbury, London (Twice) and all manner of social events...

Fun=1 Coding =0

As the suntan fades work will resume. For now I've got too much other stuff to deal with.

Immediate concerns are to ensure the base funcitons are complete and all present. I've got a feeling there's a lot I'm missing but cannot seem to think what they are. Regardless, at some stage later, as necessity dictates or as feature requests they will all be identified but I'd rather have the work completed more orderly.

____________________

lawks a lordy, my bottom's on fire!

~marksibly

Intermediate update(Posted 2010-06-29)
It's been a couple of weeks, and whilst it's looked pretty quiet, that's mainly because I'm filling in details of the engine before actually adding anything exciting, new or fun. In short, the multitude of empty methods/functions in the list in the last post ("Outlining Structure")

I am wanting to get this structure fully (or as fully as I can for now, it's likely more may be added at a later date if I think of it, or anyone requests something I haven't considered) developed and in place, before I egt to the more fun stuff of the actual particle motions and updates.
These particle motions should be fairly easy and are simply just cases of number crunching according to the numerous properties assigned. Hopefully, many of these may be understandable just byu looking at the const variable idfentifiers.
As abrief description, though, it may be pertinent to note that for a particular emitter, it has some values ascribed to it to control the movement of the particles emitted, naturally. These values will typically be somerthing like:

Style_Of_Movement
Minimum
Maximumn
Rate_Of_Change
Variation

There may be reasons for more or perhaps less such values for a particular type of description, but generally speaking, the above should serve as a guideline.
It may also be necessary for the descriptions to be duplicated for X, Y, Z translation (or perhaps Pitch, Yaw and Roll rotations) allowing for greater control over the path of the particles, if they may have differing movement patterns or accelerations in different dimensions.

Ultimately, every conceivable pattern of motion should be catered for in some respect.
This may seem daunting and complex at first, but will largely be reserved for the experienced user who chooses to delve deeper into the workings of the PARIS particles.
For the majority of situations, there are some default, standard "PREFAB" particle motion descriptors, which can still be adjusted at any of their descriptor values, but either way, should provide a solution for all manner of typical and common effects.

These, for the sake of completeness are listed here, (You will note that this list is defined as variables under PARIS_S_EMITTER_TYPE_* too)

SPRAY%=1 - The particles are ejected from a point in a single direction, with a slight randomised variation around that axis. One burst, then deactivated.

PARIS_S_EMITTER_TYPE_CASCADE%=2 - The particles fall straight down but from a long, narrow source. A Waterfall effect.

PARIS_S_EMITTER_TYPE_FOUNTAIN%=3 - These particles will be ejected with some initial speed and a randomised direction about the axis. (Works best with gravity).

PARIS_S_EMITTER_TYPE_FLAME%=4 - These particles rise vertically, but will flicker or waft gently. Giving a cotrolled fire effect.

PARIS_S_EMITTER_TYPE_SNOW%=5 - Snowflakes fall gently, floating on unseen wind, and twists

PARIS_S_EMITTER_TYPE_EXPLODE%=6 - Particles are ejected with some energy in random directions. One burst then deactivated.

PARIS_S_EMITTER_TYPE_JET%=7 - A Continuous stream of particles always ejectedd from a localised direction.

PARIS_S_EMITTER_TYPE_ELECTRIC%=8 - The particles join and appear to shift as electricity arcs. Source and Target can both be defined, but only the Source (Emitter) is necesary.

PARIS_S_EMITTER_TYPE_SPHERICAL%=9 - The particles move in circular orbits that gradually change inclination, therefor outlining a sphere around an 'imaginary' point.

PARIS_S_EMITTER_TYPE_TWISTER%=10 - Spiralling particles that move in a wider circumference at the 'top' than the 'base'.

PARIS_S_EMITTER_TYPE_FIREFLY%=11 - These particles hang in the air over a range, and only slightly drift randomly

PARIS_S_EMITTER_TYPE_WASPNEST%=12 - Particles that swarm as a group in 3 dimensions

PARIS_S_EMITTER_TYPE_RATSWARM%=13 - Particles that swarm as a group but only across terrain. (Works best with Gravity, but be sure to check for hill inclines)

____________________

lawks a lordy, my bottom's on fire!

~marksibly

Outlining structure(Posted 2010-06-07)
Everything in PARIS is defined by TYPE. There are no globals nor constants and no extraneous handles to cause conflict or bloat the code/memory. Also, it enables universally portable code so that any exported particle data can be easily transposed into a different project with no risk of bugs or failure. Another advantage of this method is to encapsulate just the right amount of information required, with no space limitations or excess gaps. Lastly, there is the availability to completely free any memory space attributed to PARIS simply and easily maximising the efficiency and maintaining a consistent level of relativity.

Global PARIS_Type.PARIS_SYSTEM=First PARIS_SYSTEM
Global PARIS_Emitters.PARIS_EMITTER=First PARIS_EMITTER

Type PARIS_SYSTEM
	
	Field PARIS_S_NULLREPLACE%
	
	Field PARIS_S_UNIQUE%
	
	Field PARIS_S_ENABLED%
	Field PARIS_S_EMITTERCOUNTER%
	Field PARIS_S_BATCHCOUNTER%
	
	Field PARIS_S_CAMERA%
	
	Field PARIS_S_VIEWPORT_X%
	Field PARIS_S_VIEWPORT_Y%
	Field PARIS_S_VIEWPORT_WIDTH%
	Field PARIS_S_VIEWPORT_HEIGHT%

	Field PARIS_S_WORLD_GRAVITY#
	Field PARIS_S_CURSOR_ENTITY%

	Field PARIS_S_EMITTER_TYPE_SPRAY%=1
	Field PARIS_S_EMITTER_TYPE_CASCADE%=2
	Field PARIS_S_EMITTER_TYPE_FOUNTAIN%=3
	Field PARIS_S_EMITTER_TYPE_FLAME%=4
	Field PARIS_S_EMITTER_TYPE_SNOW%=5
	Field PARIS_S_EMITTER_TYPE_EXPLODE%=6
	Field PARIS_S_EMITTER_TYPE_JET%=7
	Field PARIS_S_EMITTER_TYPE_ELECTRIC%=8
	Field PARIS_S_EMITTER_TYPE_SPHERICAL%=9
	Field PARIS_S_EMITTER_TYPE_TWISTER%=10
	Field PARIS_S_EMITTER_TYPE_FIREFLY%=11
	Field PARIS_S_EMITTER_TYPE_WASPNEST%=12
	Field PARIS_S_EMITTER_TYPE_RATSWARM%=13

	Field PARIS_S_LIFE_MODE_CONST%=0
	Field PARIS_S_LIFE_MODE_TEMPORARY%=1
	Field PARIS_S_LIFE_MODE_DISTANCE%=2
	Field PARIS_S_LIFE_MODE_BLINK%=4
	Field PARIS_S_LIFE_MODE_FADEOUT%=8
	Field PARIS_S_LIFE_MODE_FRAMEEND%=16

	Field PARIS_S_FADE_MODE_STATIC%=0
	Field PARIS_S_FADE_MODE_FADE_IN%=1
	Field PARIS_S_FADE_MODE_FADE_OUT%=2
	Field PARIS_S_FADE_MODE_PAUSE_OUT%=4
	Field PARIS_S_FADE_MODE_PAUSE_OFF%=8
	Field PARIS_S_FADE_MODE_REPEAT%=16
	Field PARIS_S_FADE_MODE_VARYDELAYOFF%=32
	Field PARIS_S_FADE_MODE_VARYDELAYON%=64
	Field PARIS_S_FADE_MODE_VARYINSPEED%=128
	Field PARIS_S_FADE_MODE_VARYOUTSPEED%=256

	Field PARIS_S_COLOUR_MODE_STATIC%=0
	Field PARIS_S_COLOUR_MODE_BOUNCE%=1
	Field PARIS_S_COLOUR_MODE_JUMP%=2
	Field PARIS_S_COLOUR_MODE_RANDOMISE%=3
	Field PARIS_S_COLOUR_MODE_CASCADE%=4
	Field PARIS_S_COLOUR_MODE_SEQUENCE%=5

	Field PARIS_S_MOVETYPE_NONE%=0
	Field PARIS_S_MOVETYPE_SMOOTH%=1
	Field PARIS_S_MOVETYPE_RANDOM%=2
	Field PARIS_S_MOVETYPE_ONEWAY_POSITIVE%=4
	Field PARIS_S_MOVETYPE_ONEWAY_NEGATIVE%=8
	Field PARIS_S_MOVETYPE_ROTATE%=16
	Field PARIS_S_MOVETYPE_TOWARDS%=32
	Field PARIS_S_MOVETYPE_BOUNCE%=64

	Field PARIS_S_SPEED_TYPE_STATIC%=0
	Field PARIS_S_SPEED_TYPE_DECREASE%=1
	Field PARIS_S_SPEED_TYPE_INCREASE%=2
	Field PARIS_S_SPEED_TYPE_VARIABLE%=3

	Field PARIS_S_FRAME_MODE_STATIC%=0
	Field PARIS_S_FRAME_MODE_REPEAT%=1
	Field PARIS_S_FRAME_MODE_STRAIGHT%=3
	Field PARIS_S_FRAME_MODE_BOUNCE%=3
	Field PARIS_S_FRAME_MODE_RANDOM%=4

	Field PARIS_S_TURNTYPE_NONE%=0
	Field PARIS_S_TURNTYPE_SMOOTH%=1
	Field PARIS_S_TURNTYPE_RANDOM%=2
	Field PARIS_S_TURNTYPE_ONEWAY_POSITIVE%=4
	Field PARIS_S_TURNTYPE_ONEWAY_NEGATIVE%=8
	Field PARIS_S_TURNTYPE_TOWARDS%=16
	Field PARIS_S_TURNTYPE_AWAY%=32
	Field PARIS_S_TURNTYPE_BOUNCE%=64
	Field PARIS_S_TURNTYPE_USEENTITY%=128

	Field PARIS_S_CURSOR_LAST_X#
	Field PARIS_S_CURSOR_LAST_Y#
	Field PARIS_S_CURSOR_LAST_Z#
End Type

Type PARIS_COLOURSEQUENCES
	Field PARIS_CS_ParticleEntity%
	Field PARIS_CS_ColourRed%
	Field PARIS_CS_ColourGreen%
	Field PARIS_CS_ColourBlue%
	Field PARIS_CS_Reference%
End Type

Type PARIS_BATCH
	Field PARIS_BATCH_Filename$
	Field PARIS_BATCH_ReferenceNumber%
End Type
	
Type PARIS_EMITTER
	Field PARIS_E_Enabled%
	Field PARIS_E_Active%
	Field PARIS_E_BatchHandle%
	Field PARIS_E_Entity%
	Field PARIS_E_FriendlyName$; 					=			 "E_"+Str(PARIS_TYPE\PARIS_S_BATCHCOUNTER%)+Str(PARIS_TYPE\PARIS_S_EMITTERCOUNTER%)+Str(PARIS_TYPE\PARIS_S_UNIQUE%)
	Field PARIS_E_EmitterType%
	
	Field PARIS_E_GroundLevel

	Field PARIS_E_X#, PARIS_E_Y#, PARIS_E_Z#
	Field PARIS_E_PT#, PARIS_E_YW#, PARIS_E_RL#
	
	Field PARIS_E_Frequency%
	Field PARIS_E_RepeatMode%
	Field PARIS_E_Activated_Millisecs%
	Field PARIS_E_Duration%
	
	Field PARIS_E_Move_Type%
	Field PARIS_E_Move_Speed#

	Field PARIS_E_Rotate_Mode%
	
	Field PARIS_E_Gravity_Active%
	Field PARIS_E_Bounce_With_Gravity%
	
	Field PARIS_E_P_MasterCount%
	
	Field PARIS_E_P_ViewMode%
	Field PARIS_E_P_Animated%
	Field PARIS_E_P_Frames%
	Field PARIS_E_P_FrameDelay%
	Field PARIS_E_P_FrameMode%
	
	Field PARIS_E_P_ColourMode%
	Field PARIS_E_P_ColourChangeDelay%
	Field PARIS_E_P_ColoursequenceCount%
	
	Field PARIS_E_P_InitialAlpha#
	Field PARIS_E_P_FadeMode
	
	Field PARIS_E_P_Lifetime_Min%
	Field PARIS_E_P_Lifetime_Max%
	Field PARIS_E_P_LifeMode%	
	
	Field PARIS_E_P_DistanceKill_X_Min#
	Field PARIS_E_P_DistanceKill_X_Max#
	Field PARIS_E_P_DistanceKill_Y_Min#
	Field PARIS_E_P_DistanceKill_Y_Max#
	Field PARIS_E_P_DistanceKill_Z_Min#	
	Field PARIS_E_P_DistanceKill_Z_Max#	

	Field PARIS_E_P_Global_LocationKill_X#
	Field PARIS_E_P_Global_LocationKill_Y#
	Field PARIS_E_P_Global_LocationKill_Z#

	Field PARIS_E_P_Move_X_Type%
	Field PARIS_E_P_Move_Y_Type%
	Field PARIS_E_P_Move_Z_Type%
	
	Field PARIS_E_P_Speed_Type_X%
	Field PARIS_E_P_Speed_Type_Y%
	Field PARIS_E_P_Speed_Type_Z%
	
	Field PARIS_E_P_Move_X_PARISd_Max#
	Field PARIS_E_P_Move_X_PARISd_Min#
	Field PARIS_E_P_Move_Y_PARISd_Max#
	Field PARIS_E_P_Move_Y_PARISd_Min#
	Field PARIS_E_P_Move_Z_PARISd_Max#
	Field PARIS_E_P_Move_Z_PARISd_Min#
	
	Field PARIS_E_P_Rotate_X_Mode%
	Field PARIS_E_P_Rotate_Y_Mode%
	Field PARIS_E_P_Rotate_Z_Mode%
	
	Field PARIS_E_P_Gravity_Active%
	Field PARIS_E_P_Bounce_With_Gravity%
	
	Field PARIS_E_ParticleCounter%
	
End Type

Type PARIS_MASTER
	Field PARIS_PM_Reference%
	Field PARIS_PM_ParentEmitter%
	Field PARIS_PM_VisualType%
	Field PARIS_PM_VisualHandle%
	Field PARIS_PM_Filepath$
	Field PARIS_P_InitialScaleX#
	Field PARIS_P_InitialScaleY#	
End Type

Type PARIS_PARTICLE
	Field PARIS_P_ParentEmitterHandle%
	Field PARIS_P_Entity%
	Field PARIS_P_Master%
	Field PARIS_P_FriendlyName$
	Field PARIS_P_Shape%
		
	Field PARIS_P_Speed_X#
	Field PARIS_P_Speed_Y#
	Field PARIS_P_Speed_Z#
	
	Field PARIS_P_Accel_X_Direction#
	Field PARIS_P_Accel_Y_Direction#
	Field PARIS_P_Accel_Z_Direction#

	Field PARIS_P_AnimatedEntity%
		
	Field PARIS_P_FadeEntityHandle%

	Field PARIS_P_ColourChangeEntity%	
End Type

Type PARIS_COLCHANGE
	Field PARIS_COL_ParticleEntityHandle%
	
	Field PARIS_COL_ColourRedDirection%
	Field PARIS_COL_ColourGreenDirection%
	Field PARIS_COL_ColourBlueDirection%

	Field PARIS_COL_CurrentRed%
	Field PARIS_COL_CurrentGreen%
	Field PARIS_COL_CurrentBlue%

	Field PARIS_COL_TargetColourRed%
	Field PARIS_COL_TargetColourGreen%
	Field PARIS_COL_TargetColourBlue%
	
	Field PARIS_COL_ColourChangeMode%
End Type	


Type PARIS_LINKS
	Field PARIS_LNK_EmitterHandle%
	Field PARIS_LNK_LinkedEntityHandle%
	Field PARIS_LNK_Method%
End Type

Type  PARIS_ANIMENTITY
	Field PARIS_ANIM_ParticleEntityHandle%
	Field PARIS_ANIM_Brush%
	Field PARIS_ANIM_AnimationMode%
	Field PARIS_ANIM_Frames%
	Field PARIS_ANIM_LastFrameMillisecs%
	Field PARIS_ANIM_FrameDelay%
	Field PARIS_ANIM_CurrentFrame%
	Field PARIS_ANIM_FrameDirection%
End Type

Type PARIS_FADE_ENTITIES
	Field PARIS_FADE_ParticleEntityHandle%
	Field PARIS_FADE_Mode%
	Field PARIS_FADE_InitialAlpha#
	Field PARIS_FADE_CurrentFadeDirection%
	Field PARIS_FADE_CurrentAlpha#
	Field PARIS_FADE_LastFadeMillisecs%
	Field PARIS_FADE_LastPulseMillisecs%	
	Field PARIS_FADE_FadeMin#
	Field PARIS_FADE_FadeMax#
	Field PARIS_FADE_InPARISd#
	Field PARIS_FADE_OutPARISd#
	Field PARIS_FADE_PauseIn%
	Field PARIS_FADE_PauseOff%	
	Field PARIS_FADE_Repeat
End Type

Function PARIS_Front()
	If (KeyDown(59) )
		PARIS_Diagnostics()
	Else
		Flip
	End If
End Function

Function PARIS_Diagnostics()
		;Displays PARIS General information
		Color 224,224,32
		Text 0,0,"PARIS Diagnostic Information"
		Text 0,20,"Total Emitters: "
		Text 0,40,"Emitters Active: "
		Text 0,60,"Current Coordinates: "
		Flip
		WaitKey()
End Function

; QUICK TRANSLATE FUNCTIONS

Function PARIS_GetEmitterHandle%(PARIS_EmitterFriendlyName$)
	DebugLog "PARIS: GetEmitterHandle Parameter: "+Chr(34)+PARIS_EmitterFriendlyName$+Chr(34)
	If (PARIS_EmitterFriendlyName$<>"")
		For PARIS_Emitters.PARIS_Emitter=Each PARIS_Emitter
			If (PARIS_Emitters\PARIS_E_FriendlyName$=PARIS_EmitterFriendlyName$) Then Return Handle(PARIS_Emitters.PARIS_Emitter)
		Next
		DebugLog "PARIS: GetEmitter failed. Emitter does not exist. Invalid Namespace$: "+Chr(34)+Paris_EmitterFriendlyName$+Chr(34)
		Return 0
	Else
		DebugLog "PARIS: GetEmitter failed. Null Namespace parameter"
		Return 0
	End If
End Function

Function PARIS_GetEmitterFriendlyName$(PARIS_EmitterHandle%)
	DebugLog "PARIS: GetEmitterName Parameter: "+Str(PARIS_EmitterHandle%)
	If (PARIS_EmitterHandle%)
		PARIS_Emitters.PARIS_Emitter=Object.PARIS_EMITTER(PARIS_EmitterHandle%)
		If (PARIS_Emitters.PARIS_Emitter<>Null)
			Return PARIS_Emitters\PARIS_E_FriendlyName$
		Else
			DebugLog "PARIS: GetEmitter failed. Emitter does not exist. Invalid Handle: "+Paris_EmitterHandle%
			Return ""
		End If
	Else
		DebugLog "PARIS: GetEmitter failed. Null Handle parameter"
	End If
End Function	

;	USER FUNCTIONS

Function PARIS_Initialise()
	DebugLog "PARIS: Initialise"
	Local BatchCount%=0
	If (PARIS_TYPE.PARIS_SYSTEM<>Null)
		If (PARIS_TYPE\PARIS_S_BATCHCOUNTER%)Then BatchCount=PARIS_TYPE\PARIS_S_BATCHCOUNTER%
		Delete PARIS_TYPE.PARIS_SYSTEM
	End If
	PARIS_TYPE.PARIS_SYSTEM=New PARIS_SYSTEM
	PARIS_TYPE\PARIS_S_ENABLED%=False
PARIS_TYPE\PARIS_S_BATCHCOUNTER%=BatchCount+1
PARIS_TYPE\PARIS_S_EMITTERCOUNTER%=0
PARIS_TYPE\PARIS_S_VIEWPORT_X%=0
PARIS_TYPE\PARIS_S_VIEWPORT_Y%=0
PARIS_TYPE\PARIS_S_VIEWPORT_WIDTH%=GraphicsWidth()
PARIS_TYPE\PARIS_S_VIEWPORT_HEIGHT%=GraphicsHeight()
PARIS_TYPE\PARIS_S_WORLD_GRAVITY#=0
PARIS_TYPE\PARIS_S_CURSOR_ENTITY%=CreateCone()
PARIS_TYPE\PARIS_S_EMITTER_TYPE_SPRAY%=1
PARIS_TYPE\PARIS_S_EMITTER_TYPE_CASCADE%=2
PARIS_TYPE\PARIS_S_EMITTER_TYPE_FOUNTAIN%=3
PARIS_TYPE\PARIS_S_EMITTER_TYPE_FLAME%=4
PARIS_TYPE\PARIS_S_EMITTER_TYPE_SNOW%=5
PARIS_TYPE\PARIS_S_EMITTER_TYPE_EXPLODE%=6
PARIS_TYPE\PARIS_S_EMITTER_TYPE_JET%=7
PARIS_TYPE\PARIS_S_EMITTER_TYPE_ELECTRIC%=8
PARIS_TYPE\PARIS_S_EMITTER_TYPE_SPHERICAL%=9
PARIS_TYPE\PARIS_S_EMITTER_TYPE_TWISTER%=10
PARIS_TYPE\PARIS_S_EMITTER_TYPE_FIREFLY%=11
PARIS_TYPE\PARIS_S_EMITTER_TYPE_WASPNEST%=12
PARIS_TYPE\PARIS_S_EMITTER_TYPE_RATSWARM%=13
PARIS_TYPE\PARIS_S_LIFE_MODE_CONST%=0
PARIS_TYPE\PARIS_S_LIFE_MODE_TEMPORARY%=1
PARIS_TYPE\PARIS_S_LIFE_MODE_DISTANCE%=2
PARIS_TYPE\PARIS_S_LIFE_MODE_BLINK%=4
PARIS_TYPE\PARIS_S_LIFE_MODE_FADEOUT%=8
PARIS_TYPE\PARIS_S_LIFE_MODE_FRAMEEND%=16
PARIS_TYPE\PARIS_S_FADE_MODE_STATIC%=0
PARIS_TYPE\PARIS_S_FADE_MODE_FADE_IN%=1
PARIS_TYPE\PARIS_S_FADE_MODE_FADE_OUT%=2
PARIS_TYPE\PARIS_S_FADE_MODE_PAUSE_OUT%=4
PARIS_TYPE\PARIS_S_FADE_MODE_PAUSE_OFF%=8
PARIS_TYPE\PARIS_S_FADE_MODE_REPEAT%=16
PARIS_TYPE\PARIS_S_FADE_MODE_VARYDELAYOFF%=32
PARIS_TYPE\PARIS_S_FADE_MODE_VARYDELAYON%=64
PARIS_TYPE\PARIS_S_FADE_MODE_VARYINSPEED%=128
PARIS_TYPE\PARIS_S_FADE_MODE_VARYOUTSPEED%=256
PARIS_TYPE\PARIS_S_COLOUR_MODE_STATIC%=0
PARIS_TYPE\PARIS_S_COLOUR_MODE_BOUNCE%=1
PARIS_TYPE\PARIS_S_COLOUR_MODE_JUMP%=2
PARIS_TYPE\PARIS_S_COLOUR_MODE_RANDOMISE%=3
PARIS_TYPE\PARIS_S_COLOUR_MODE_CASCADE%=4
PARIS_TYPE\PARIS_S_COLOUR_MODE_SEQUENCE%=5
PARIS_TYPE\PARIS_S_MOVETYPE_NONE%=0
PARIS_TYPE\PARIS_S_MOVETYPE_SMOOTH%=1
PARIS_TYPE\PARIS_S_MOVETYPE_RANDOM%=2
PARIS_TYPE\PARIS_S_MOVETYPE_ONEWAY_POSITIVE%=4
PARIS_TYPE\PARIS_S_MOVETYPE_ONEWAY_NEGATIVE%=8
PARIS_TYPE\PARIS_S_MOVETYPE_ROTATE%=16
PARIS_TYPE\PARIS_S_MOVETYPE_TOWARDS%=32
PARIS_TYPE\PARIS_S_MOVETYPE_BOUNCE%=64
PARIS_TYPE\PARIS_S_SPEED_TYPE_STATIC%=0
PARIS_TYPE\PARIS_S_SPEED_TYPE_DECREASE%=1
PARIS_TYPE\PARIS_S_SPEED_TYPE_INCREASE%=2
PARIS_TYPE\PARIS_S_SPEED_TYPE_VARIABLE%=3
PARIS_TYPE\PARIS_S_FRAME_MODE_STATIC%=0
PARIS_TYPE\PARIS_S_FRAME_MODE_REPEAT%=1
PARIS_TYPE\PARIS_S_FRAME_MODE_STRAIGHT%=3
PARIS_TYPE\PARIS_S_FRAME_MODE_BOUNCE%=3
PARIS_TYPE\PARIS_S_FRAME_MODE_RANDOM%=4
PARIS_TYPE\PARIS_S_TURNTYPE_NONE%=0
PARIS_TYPE\PARIS_S_TURNTYPE_SMOOTH%=1
PARIS_TYPE\PARIS_S_TURNTYPE_RANDOM%=2
PARIS_TYPE\PARIS_S_TURNTYPE_ONEWAY_POSITIVE%=4
PARIS_TYPE\PARIS_S_TURNTYPE_ONEWAY_NEGATIVE%=8
PARIS_TYPE\PARIS_S_TURNTYPE_TOWARDS%=16
PARIS_TYPE\PARIS_S_TURNTYPE_AWAY%=32
PARIS_TYPE\PARIS_S_TURNTYPE_BOUNCE%=64
PARIS_TYPE\PARIS_S_TURNTYPE_USEENTITY%=128
PARIS_TYPE\PARIS_S_CURSOR_LAST_X#=0
	PARIS_TYPE\PARIS_S_CURSOR_LAST_Y#=0
	PARIS_TYPE\PARIS_S_CURSOR_LAST_Z#=0


	PARIS_TYPE\PARIS_S_UNIQUE%=Handle(PARIS_TYPE.PARIS_SYSTEM)
	PARIS_TYPE\PARIS_S_CAMERA%=PARIS_SetCamera()
End Function

Function PARIS_Enable(PARIS_Enable%=True)
	DebugLog "PARIS: Enable Parameter: "+Str(PARIS_Enable%)
	If (PARIS_GetPARISInitialised) Then PARIS_Type\PARIS_S_Enabled%=PARIS_Enable%
End Function

Function PARIS_GetPARISInitialised%()
	If (PARIS_Type=Null)
		DebugLog "PARIS: PARIS Call failed. PARIS not initialised"
		Return False
	Else
		Return True
	End If
End Function

Function PARIS_GetPARISEnabled%()		;Just added for completeness
	DebugLog "PARIS: GetPARISEnabled"
	If (PARIS_GetPARISInitialised())
		Return PARIS_Type\PARIS_S_ENABLED%
	Else
		Return False
	End If
End Function

Function PARIS_GenerateUniqueEmitterName$()
	DebugLog "PARIS: GenerateUniqueEmitterName"
	Return  "E_"+Right$("000"+Str(PARIS_TYPE\PARIS_S_BATCHCOUNTER%),3)+"_"+Right$("000"+Str(PARIS_TYPE\PARIS_S_EMITTERCOUNTER%),3)+"_"+Str(PARIS_TYPE\PARIS_S_UNIQUE%)
End Function 

Function PARIS_ImportBatch%(PARIS_Filepath$)
	DebugLog "PARIS: ImportBatch Parameter: "+Chr(34)+PARIS_Filepath$+Chr(34)
;	Local PARIS_BatchHandle%
;	Return PARIS_BatchHandle%
End Function

Function PARIS_ExportBatch%(PARIS_BatchHandle%, PARIS_Filepath$)
	DebugLog "PARIS: ImportBatch BatchParameter: "+Str(PARIS_BatchHandle%)+" Filepath Parameter: "+Chr(34)+PARIS_Filepath$+Chr(34)
;
End Function

Function PARIS_UnLoadBatch%(PARIS_BatchHandle%)
	DebugLog "PARIS: UnLoadBatch Parameter: "+Str(PARIS_BatchHandle%)
;	Local PARIS_BatchHandle%
;	Return PARIS_BatchHandle%
End Function

Function PARIS_UnloadAll()
	DebugLog "PARIS: UnloadAll"
	If (PARIS_GetPARISInitialised())
		PARIS_RemoveAllLinks
		PARIS_Enable(False)
	End If
	PARIS_Initialise
End Function

Function PARIS_SetCamera(PARIS_CameraEntityHandle%=0)
			DebugLog "PARIS: SetCamera Parameter: "+Str(PARIS_CameraEntityHandle%)
;	Allows the camera used by PARIS to be set as an existing Camera entity during development.
	If (PARIS_GetPARISInitialised())
		If (Not(PARIS_CameraEntityHandle%))
			DebugLog "PARIS: SetCamera Null parameter. Default PARIS_Camera used"
		Else
			PARIS_TYPE\PARIS_S_CAMERA%=PARIS_CameraEntityHandle%
			Return
		End If
		If (PARIS_TYPE\PARIS_S_CAMERA%)
			DebugLog "PARIS: SetCamera already defined."
			Return
		End If
		PARIS_TYPE\PARIS_S_CAMERA%=CreateCamera()
	End If
End Function

Function PARIS_SetWorldGravity(PARIS_Acceleration#=9.8)
	DebugLog "PARIS: SetWorldGravity Parameter: "+Str(PARIS_Acceleration#)
;	Sets the value for acceleration due to gravity that should be used by PARIS to match that
;	of the current 3D world.
	If (PARIS_GetPARISInitialised()) Then PARIS_TYPE\PARIS_S_WORLD_GRAVITY#=PARIS_Acceleration#
End Function

Function PARIS_CountActiveEmittersInBatch%(PARIS_BatchHandle%)
	DebugLog "PARIS: CountActiveEmittersInBatch Parameter: "+Str(PARIS_BatchHandle%)
;
End Function

Function PARIS_CountTotalActiveEmitters%()
	DebugLog "PARIS: CountTotalActiveEmitters"
;
End Function

Function PARIS_CountTotalInactiveEmitters%()
	DebugLog "PARIS: CountTotalInactiveEmitters"
;
End Function

Function PARIS_CountInactiveEmittersInBatch%(PARIS_BatchHandle%)
	DebugLog "PARIS: CountInactiveEmittersInBatch Parameter: "+Str(PARIS_BatchHandle%)
;
End Function

Function PARIS_CountTotalEnabledEmitters%()
	DebugLog "PARIS: CountTotalEnabledEmitters"
;
End Function

Function PARIS_CountEnabledEmittersInBatch%(PARIS_BatchHandle%)
	DebugLog "PARIS: CountEnabledEmittersInBatch Parameter: "+Str(PARIS_BatchHandle%)
;
End Function

Function PARIS_CountTotalEnabledInactiveEmitters%(PARIS_BatchHandle%)
	DebugLog "PARIS: CountTotalEnabledInactiveEmitters Parameter: "+Str(PARIS_BatchHandle%)
;
End Function

Function PARIS_CountEnabledInactiveEmittersInBatch%(PARIS_BatchHandle%)
	DebugLog "PARIS: CountEnabledInactiveEmittersInBatch Parameter: "+Str(PARIS_BatchHandle%)
;
End Function

Function PARIS_CountTotalLinks%()
	DebugLog "PARIS: CountTotalLinks"
;
End Function

Function PARIS_CountLinksInBacth%(PARIS_BatchHandle%)
	DebugLog "PARIS: CountLinksInBatch Parameter: "+Str(PARIS_BatchHandle%)
;
End Function

Function PARIS_CountTotalEmittersWithLinks%()
	DebugLog "PARIS: CountTotalEmittersWithLinks"
;
End Function

Function PARIS_CountEmittersWithLinksInBatch%(PARIS_BatchHandle%)
	DebugLog "PARIS: CountEmittersWithLinksInBatch Parameter: "+Str(PARIS_BatchHandle%)
;
End Function

Function PARIS_CountTotalEnabledEmittersWithLinks%()
	DebugLog "PARIS: CountTotalEnabledEmittersWithLinks"
;
End Function

Function PARIS_CountEnabledEmittersWithLinksInBatch%(PARIS_BatchHandle%)
	DebugLog "PARIS: CountEnabledEmittersWithLinksInBatch Parameter: "+Str(PARIS_BatchHandle%)
;
End Function

Function PARIS_CountTotalEnabledInactiveEmittersWithLinks%()
	DebugLog "PARIS: CountTotalEnabledInactiveEmittersWithLinks"
;
End Function

Function PARIS_CountEnabledInactiveEmittersWithLinksInBatch%(PARIS_BatchHandle%)
	DebugLog "PARIS: CountEnabledInactiveEmittersWithLinksInBatch Parameter: "+Str(PARIS_BatchHandle%)
;
End Function

Function PARIS_CountTotalEmittersWithLinksToEntity%(PARIS_EntityHandle%)
	DebugLog "PARIS: CountTotalEmittersWithLinksToEntity Parameter: "+Str(PARIS_EntityHandle%)
;
End Function

Function PARIS_CountTotalEnabledEmittersWithLinksToEntity%(PARIS_EntityHandle%)
	DebugLog "PARIS: CountTotalEnabledEmittersWithLinksToEntityParameter: "+Str(PARIS_EntityHandle%)
;
End Function

Function PARIS_CountTotalEnabledInactiveEmittersWithLinksToEntity%(PARIS_EntityHandle%)
	DebugLog "PARIS: CountTotalEnabledInactiveEmittersWithLinksToEntity Parameter: "+Str(PARIS_EntityHandle%)
;
End Function

Function PARIS_CountEmittersWithLinksToEntityInBatch%(PARIS_BatchHandle%,PARIS_EntityHandle%)
	DebugLog "PARIS: CountEmittersWithLinksToEntityInBatch Batch Parameter: "+Str(PARIS_BatchHandle%)+" Entity Parameter: "+Str(PARIS_EntityHandle%)
;
End Function

Function PARIS_CountEnabledEmittersWithLinksToEntityInBatch%(PARIS_BatchHandle%,PARIS_EntityHandle%)
	DebugLog "PARIS: CountEnabledEmittersWithLinksToEntityInBatchBatch Parameter: "+Str(PARIS_BatchHandle%)+" Entity Parameter: "+Str(PARIS_EntityHandle%)
;
End Function

Function PARIS_CountTotalEntitiesWithLinksToEmitter%(PARIS_EmitterFriendlyName$)
	DebugLog "PARIS: CountTotalEntitiesWithLinksToEmitter Parameter: "+Chr(34)+PARIS_EmitterFriendlyName$+Chr(34)
;
End Function

Function PARIS_CountTotalEntitiesWithLinks%()
	DebugLog "PARIS: CountTotalEntitiesWithLinks"
;
End Function

Function PARIS_GetLinkedEntity%(PARIS_EmitterFriendlyName$,PARIS_LinkReference%=1)
	DebugLog "PARIS: GetLinkedEntity Emitter Parameter: "+Chr(34)+PARIS_EmitterFriendlyName$+Chr(34)+" Link Parameter: "+Str(PARIS_LinkReference%)
;
End Function

Function PARIS_GetLinkedEmitter$(PARIS_EntityHandle%,PARIS_LinkReference%)
	DebugLog "PARIS: GetLinkedEmitter Entity Parameter: "+Str(PARIS_EntityHandle%)+" Link Parameter: "+Str(PARIS_LinkReference%)
;
End Function

Function PARIS_DisableEmitter(PARIS_FriendlyName$, PARIS_DeActivateToo%=False, PARIS_PauseParticles%=False,PARIS_SnapTime%=True)
	DebugLog "PARIS: DisableEmitter Parameters: "+Chr(34)+PARIS_FriendlyName$+Chr(34)+", "+Str(PARIS_DeActivateToo%)+", "+Str(PARIS_PauseParticles%)+", "+Str(PARIS_SnapTime%)
;	Disables a specified emitter. However, unless specified otherwise by the second parameter, the emitter will maintain its current Active state.
;	The Third Parameter determines whether any existing particles emitted (if the emitter is 'Active') should be paused where they are (True) or 
;	destroyed and removed from rendering (False). Destroying these particles will not require any re-loading or re-initialisation if the Emitter is Enabled again.
;	Lastly, the SnapTime parameter is important for time-related emitters/particles. If for example, a particle or emitter activity state has a lifetime set for a 
;	specific duration, then this paramater defines whether the lifetime should be frozen (SnapTime=True) so that events may continue as normal afterwards,
;	or, whether, due to the delay between Disabling/Re-Enabling should count when calculating the lifetime duration (SnapTime=False).End Function
End Function

Function PARIS_EnableEmitter(PARIS_FriendlyName$,PARIS_ActivateToo=False)
	DebugLog "PARIS: EnableEmitter Parameters: "+Chr(34)+PARIS_FriendlyName$+Chr(34)+", "+Str(PARIS_ActivateToo%)
;	Enables the given emitter. However, unless specified otherwise by the second parameter, the emitter will have its current Active state.
End Function

Function PARIS_DisableAllEmitters%(PARIS_DeActivateToo=False, PARIS_PauseCurrentParticles=False, PARIS_SnapTime=True)
	DebugLog "PARIS: DisableAllEmitters Parameters: "+Str(PARIS_DeActivateToo%)+", "+Str(PARIS_PauseParticles%)+", "+Str(PARIS_SnapTime%)
;	Disables all emitters across all batches. However, unless specified otherwise by the first parameter, the emitters will have their current Active state.
;	The Second Parameter determines whether any existing particles emitted (if the emitter is 'Active') should be paused where they are (True) or 
;	destroyed and removed from rendering (False). Destroying these particles will not require any re-loading or re-initialisation if the Emitter is Enabled again.
;	Lastly, the SnapTime parameter is important for time-related emitters/particles. If for example, a particle or emitter activity state has a lifetime set for a 
;	specific duration, then this paramater defines whether the lifetime should be frozen (SnapTime=True) so that events may continue as normal afterwards,
;	or, whether, due to the delay between Disabling/Re-Enabling should count when calculating the lifetime duration (SnapTime=False).
End Function

Function PARIS_EnableAllEmitters%(PARIS_ActivateToo=False)
	DebugLog "PARIS: EnableAllEmitter Activate Parameter: "+Str(PARIS_ActivateToo%)
;	Enables all emitters across all batches. However, unless specified otherwise by the parameter, the emitters will have their current Active state.
End Function

Function PARIS_DisableEmittersInBatch%(PARIS_BatchHandle%,PARIS_DeActivateToo=False, PARIS_PauseCurrentParticles=False, PARIS_SnapTime=True)
	DebugLog "PARIS: DisableEmittersInBatch Parameters: "+Str(PARIS_BatchHandle%)+", "+Str(PARIS_DeActivateToo%)+", "+Str(PARIS_PauseParticles%)+", "+Str(PARIS_SnapTime%)
;	Disables all emitters within a batch. However, unless specified otherwise by the second parameter, the emitters will have their current Active state.
;	The third Parameter determines whether any existing particles emitted (if the emitter is 'Active') should be paused where they are (True) or 
;	destroyed and removed from rendering (False). Destroying these particles will not require any re-loading or re-initialisation if the Emitter is Enabled again.
;	Lastly, the SnapTime parameter is important for time-related emitters/particles. If for example, a particle or emitter activity state has a lifetime set for a 
;	specific duration, then this paramater defines whether the lifetime should be frozen (SnapTime=True) so that events may continue as normal afterwards,
;	or, whether, due to the delay between Disabling/Re-Enabling should count when calculating the lifetime duration (SnapTime=False).
End Function

Function PARIS_EnableEmittersInBatch%(PARIS_BatchHandle%,PARIS_ActivateToo=False)
	DebugLog "PARIS: EnableEmittersInBatch Batch Parameter: "+Str(PARIS_BatchHandle%)+"Activate Parameter: "+Str(PARIS_ActivateToo%)
;	Enables all emitters within a batch. However, unless specified otherwise by the second parameter, the emitters will have their current Active state.
End Function

Function PARIS_UnloadAllEmittersLinkedToEntity(PARIS_EntityHandle%,PARIS_RemoveParticlesToo=True)
;	Removes all emitters with Links to the specified entity from memory. If the secondary parameter is set to False, the program will retain the
;	video memory of the related particle media.
End Function

Function PARIS_UnloadEmitter(PARIS_EmitterFriendlyName$,PARIS_RemoveParticlesToo=True)
;	Removes aa specific emitter from memory. If the secondary parameter is set to False, the program will retain the
;	video memory of the related particle media.
End Function

Function PARIS_UnloadEmitterBatch(PARIS_EmitterBatchHandle%,PARIS_RemoveParticlesToo%=True)
;	Removes all emitters within a particular batch from memory. If the secondary parameter is set to False, the program will retain the
;	video memory of the related particle media.
End Function

Function PARIS_LoadEmitterBatch%(PARIS_Pathname$,PARIS_LoadParticlesToo%=True)
;	Imports a PARIS batch file. The secondary parameter if set to False, will attempt to use existing particle media.
End Function

Function PARIS_LinkAllEmittersInBatchToEntity(PARIS_BatchHandle,PARIS_EntityHandle%)
;	Sets a Link from All the Emitters in a specified Batch to a specified Entity.
End Function

Function PARIS_ActivateEmitter(PARIS_EmitterFriendlyName$)
	DebugLog "PARIS: ActivateEmitter Parameter: "+Chr(34)+PARIS_EmitterFriendlyName$+Chr(34)
;	Sets an Emitter's Active status to True.
;	**** Note ****
;	Whatever criteria may normally De-Activate the emitter will still apply.
End Function

Function PARIS_DeActivateEmitter(PARIS_EmitterFriendlyName$)
	DebugLog "PARIS: DeActivateEmitter Parameter: "+Chr(34)+PARIS_EmitterFriendlyName$+Chr(34)
;	Sets an Emitter's Active status to False.
;	**** Note ****
;	Whatever criteria may normally Re-Activate the emitter will still apply.
End Function

Function PARIS_LinkEmitterToEntity(PARIS_EmitterFriendlyName$,PARIS_EntityHandle%)
	DebugLog "PARIS: LinkEmitter Emitter Parameter: "+Chr(34)+PARIS_EmitterFriendlyName$+Chr(34)+" Entity Parameter: "+Str(PARIS_EntityHandle%)
;	Sets a Link from All the Emitters in a specified Batch to a specified Entity.
End Function

Function PARIS_CountLinksToEmitter%(PARIS_EmitterFriendlyName$)
	DebugLog "PARIS: CountLinksToEmitter: "+Chr(34)+PARIS_EmitterFriendlyName$+Chr(34)
;
End Function

Function PARIS_LinkAllEmittersToEntity(PARIS_EntityHandle%)
	DebugLog "PARIS: LinkAll Parameter: "+Str(PARIS_EntityHandle%)
;	
End Function

Function PARIS_RePickGroundLevel(PARIS_EmitterFriendlyName$)
;	Sends a linepick vertically down (global negative Y axis) from the emitter and sets the height of the first contact.
End Function

Function PARIS_ValidateAllLinks()
	DebugLog "PARIS: ValidateAll"
;
End Function

Function ValidateLinksToEnabledEmitters()
	DebugLog "PARIS: ValidateLinksToEnabledEmitters"
;
End Function

Function DestroyLinkToEmitter(PARIS_EmitterFriendlyName$,PARIS_LinkReference%)
	DebugLog "PARIS: DestroyLink Emitter Parameter: "+Chr(34)+PARIS_EmitterFriendlyName$+Chr(34)+" Link Parameter: "+PARIS_LinkReferernce%
;
End Function

Function DestroyLinkToEntity(PARIS_EntityHandle%,PARIS_LinkReference%)
;
End Function

Function DestroyBatchLinksToEntity(PARIS_BatchHandle%,PARIS_EnittyHandle%)
;
End Function

Function DestroyBatchLinks(PARIS_BatchHandle%)
;
End Function

Function DestroyEmitterLinksToEntity(PARIS_EmitterFriendlyName$,PARIS_EntityHandle%)
;
End Function

Function PARIS_PositionEmitter(PARIS_EmitterFriendlyName$,PARIS_X#,PARIS_Y#,PARIS_Z#)
;
End Function

Function PARIS_MoveEmitter(PARIS_EmitterFriendlyName$,PARIS_X#,PARIS_Y#,PARIS_Z#)
;
End Function

Function PARIS_MoveEmitterToLinkedEntity(PARIS_EmitterFriendlyName$,PARIS_LinkReference,PARIS_ReOrient=False)
;
End Function

Function PARIS_TranslateEmitter(PARIS_EmitterFriendlyName$,PARIS_X#,PARIS_Y#,PARIS_Z#)
;
End Function

Function PARIS_RotateEmitter(PARIS_EmitterFriendlyName$,PARIS_PT#,PARIS_YW#,PARIS_RL#)
;
End Function

Function PARIS_TurnEmitter(PARIS_EmitterFriendlyName$,PARIS_PT#,PARIS_YW#,PARIS_RL#)
;
End Function

Function PARIS_PointEmitterAtLocation(PARIS_EmitterFriendlyName$,PARIS_X#,PARIS_Y#,PARIS_Z#,PARIS_Roll=False)
;
End Function

Function PARIS_PointEmitterToEntity(PARIS_EmitterFriendlyName$,PARIS_Entity%,PARIS_Roll=False)
;
End Function

Function PARIS_ReSetParticleCollisions(PARIS_EmitterFriendlyName$,PARIS_CollisionType%,PARIS_CollisionResponse%)
;	This function allows for particles to interact via the Blitz3D collision system. All particles emitted by the specified emitter are
;	given the same definition. The parameters CollisionType and CollisionResponse match the EntityType and Collision values.
End Function

Function PARIS_RemoveLinksFromEntity(PARIS_EntityHandle%)
;
End Function

Function PARIS_RemoveAllLinks()
;
End Function

Function PARIS_ReplaceEmitterParticleSpriteWithSprite(PARIS_EmitterFriendlyName$,PARIS_SpriteHandle)
;
End Function

Function PARIS_ReplaceEmitterParticleSpriteWithImage(PARIS_EmitterFriendlyName$,PARIS_ImageHandle)
;
End Function

Function PARIS_ReplaceEmitterParticleSpriteWithAnimatedImage(PARIS_EmitterFriendlyName$,PARIS_AnimImageHandle)
;
End Function

Function PARIS_ReNumberParticleFrames(PARIS_EmitterFriendlyName$,PARIS_NewNumberOfFrames%)
;
End Function

Function PARIS_ReplaceEmitterParticleSpriteFrame(PARIS_EmitterFriendlyName$,PARIS_FrameNumber%)
;
End Function

Function PARIS_Clear()
;	A more final approach than PARIS_UnloadAll and PARIS_Enable(False), Although PARIS_Clear does wrap these too.
;	This clears all PARIS information and removes/deletes all PARIS related content. This function is absolute and cannot be recovered
;	without re-initialising. Any linked entities will require re-linking.
;	Useful for end-of-game situations, Or memory management.
End Function


____________________

lawks a lordy, my bottom's on fire!

~marksibly

The Basics(Posted 2010-06-07)
This is a complete and highly powerful Particle Engine which not only autonomously controls all particle activity autonomousy, but can be easily integrated into ANY existing codebase. So it's not only good for starting off, but can quickly be added to existing projects, or replace less advantageous solutions.

Also featuring a unique ability to generate and modify particle effects within the runtime of your code, so for example, emitters can be visually placed accurately within the current 3D world.

Batch processing and eficient links to existing media as well as interaction with any in-game entities or game states is all possible as well as traditional user abilities to manipulate Emitters during the gameplay.

Will be VERY easy to control, but huge potential.

PARIS can be loaded/unloaded wholly or inpart within the code to preserve memory at all times, making it the most powerful, AND eficient Particle solution for Blitz 3D in existence.

____________________

lawks a lordy, my bottom's on fire!

~marksibly