My first ffx plug-in for EZ Scripts - dream effect

Started by mac402, March 17, 2015, 02:38:24 PM

Previous topic - Next topic

mac402

Hi! I managed to write a cutscene plug-in for EZ Script, or rather I used a template from the "uses power" plug-in. Anyway this can be used to trigger the dream/hallucination ripple effect seen in some missions in  :ffvstr:. The cutscene commands for EZ Script are <character> dream start and <character> dream end. The character reference should be made obsolete as it is not needed for anything, but I can't find a way to do it without messing up the script.

Here is the code for plug-in (which should be placed in "<modname>\Missions\Scripts\ffxplugins\active\<pluginfoldername>\<pluginfilename>.py" file):


import ff
import js

import m25event
import m25string
import m25cutscene
from m25cutscene import *


m25event.Event_RegisterEvent('pstory_cutsceneline', 'CutsceneDream_Check', persistent=1)

def CutsceneDream_Check(event):
line = event.object
found, user, remainder = m25string.SplitAroundPhrase(line,'dream')
if found:
switch = remainder
target = user
command = 'CutsceneDream_DoDream("%s","%s","%s")'%(user,switch,target)
actors = [user,target]
return [command,actors]
else:
return None

def CutsceneDream_DoDream(cs_num, user, switch, target):
m25event.SetTimer(1, 'PlayCurrentCutscene', user=cs_num)
if switch=='start':
ff.RENDER_WARP = 1
Mission_FadeDreamSinParams(1, .03, .35, .75)
Mission_StartDreamWave(5,-1,0)
if switch=='end':
ff.RENDER_WARP = 1
Mission_FadeDreamSinParams(1, .03, .35, .75)
Mission_StartDreamWave(0,0,1)

Epimethee

FFX add-on for FFvsTTR at ffx.freedomforceforever.com

cmdrkoenig67

Mac, that's a great plug in to have for mods, etc...bravo!

Dana