Freedom Reborn

Freedom Force Forums => Scripting Forum => Topic started by: mac402 on March 17, 2015, 02:38:24 PM

Title: My first ffx plug-in for EZ Scripts - dream effect
Post by: mac402 on March 17, 2015, 02:38:24 PM
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)
Title: Re: My first ffx plug-in for EZ Scripts - dream effect
Post by: Epimethee on March 24, 2015, 01:02:05 AM
Good idea, Mac!
Title: Re: My first ffx plug-in for EZ Scripts - dream effect
Post by: cmdrkoenig67 on April 02, 2015, 02:32:52 PM
Mac, that's a great plug in to have for mods, etc...bravo!

Dana