Jump to content

[LE] Simple iMod Script issue


Recommended Posts

Happy easter to everyone !

 

This is a simple "apply iMod OnTriggerEnter & Leave" Script, as it is now works fine, i'm just trying to make it to have already applied the "ImageSpaceModifier" when you enter a cell and the actor is teleported to a door which has the Trigger Box around it.

Now when you enter the cell there is a two seconds delay - fade, as is been scripted to behave.

 

I did put on the script a "OnCellAttach", "OnLoad", "OnCellLoad", i try adding states to it but i have the same problem.
My problem :
When you enter the cell the script will apply two times the iMod, one for the "OnTriggerEnter" and one for the "OnLoad", "OnCellAttach" - ... , so i end up having two times the iMod applyed, and when the player leaves the trigger only one iMod is removed.
Any insights to how i can script this would be greatly appreciated.
This is the Script without the "OnLoad" function which works just fine.

 

Scriptname aXMDimodOnTriggerEnterSCRIPT01 extends ObjectReference  
{Add - Remove ImageSpaceModifier & CamereFX + Fade IN & Out iMod OnTriggerEnter - Leave}
 
ImageSpaceModifier property ImageModFX auto
{ImageSpaceModifier to apply.  Default darkens & desaturates}
 
VisualEffect Property CamAttachFX01 Auto 
{Particle art to attach to camera, fog by default}
 
ImageSpaceModifier property intro auto
{ImageSpaceModifier to FADE IN}

ImageSpaceModifier property outro auto
{ImageSpaceModifier to FADE OUT}
 
 
EVENT onTriggerEnter(objectReference actronaut)
             if actronaut == game.getPlayer()
                intro.apply()
                ImageModFX.applyCrossFade(2.0)
                CamAttachFX01.Play(game.getPlayer())
       endif
endEVENT
 
 
EVENT onTriggerLeave(objectReference actronaut)
             if actronaut == game.getPlayer()
                outro.apply()
                ImageSpaceModifier.RemoveCrossFade(2.0)
                CamAttachFX01.Stop(game.getPlayer())
       endif
endEVENT

Many thanks in advance !
Edited by maxarturo
Link to comment
Share on other sites

So, I had to resort to a simpler solution and make a second small Script just to use it around LOAD DOORS.


Now i'm facing a realy big problem which making different version of the same script is not an option.

My problem is that i can't find a way to "SetAngle" or "Target" to this line :


CamAttachFX01.Play(game.getPlayer())


I use this to apply wind FX but the wind FX dosen't works the same way as the water flow direction... you can't edit it !!... S***T !!.

By "SetAngle" i can change it but i have a cell that is a canyon and the wind has to flow throught the canyon's path. So making 8 Scripts for each direction is not an option here.


Can this be done ? through properties somehow.

This is my main Script so far :





Scriptname aXMDimodOnTriggerEnterSCRIPT01 extends ObjectReference
{Add - Remove ImageSpaceModifier & CamereFX & iMod Fade IN-OUT & Sound FX Looped and Sound FX on Delay - OnTriggerEnter - Leave}

import sound
import utility

ImageSpaceModifier property ImageModFX auto
{Image Space Modifier to apply. Default darkens & desaturates}

VisualEffect Property CamAttachFX01 Auto
{Particle art to attach to camera, fog by default}

VisualEffect Property CamAttachFX02 Auto
{Particle art to attach to camera}

ImageSpaceModifier property intro auto
{iMod to FADE IN}

ImageSpaceModifier property outro auto
{iMod to FADE OUT}

Sound Property EnviSoundFX01 Auto
{Environmental Sound FX to play on Delay}

float property timeBeforePlay = 30.0 auto
{Time before this reference PLAY after Player enters the Trigger. DEFAULT = 30.0}

sound property LoopSound auto
{specify sound fx to play on Loop, set on reference}

int instanceID ;used to store sound ref
int instanceID02 ;used to store sound ref


EVENT onTriggerEnter(objectReference actronaut)
if actronaut == game.getPlayer()
intro.apply()
ImageModFX.applyCrossFade(2.0)
CamAttachFX01.Play(game.getPlayer())
CamAttachFX02.Play(game.getPlayer())
if (LoopSound)
instanceID = LoopSound.Play(game.getPlayer())
if (EnviSoundFX01)
wait(timeBeforePlay)
instanceID02 = EnviSoundFX01. Play(game.getPlayer())
Utility.wait(10.0)
StopInstance(instanceID02)
endif
EndIf
ENDIF
ENDEVENT


EVENT onTriggerLeave(objectReference actronaut)
if actronaut == game.getPlayer()
outro.apply()
ImageSpaceModifier.RemoveCrossFade(2.0)
CamAttachFX01.Stop(game.getPlayer())
CamAttachFX02.Stop(game.getPlayer())
if (LoopSound)
StopInstance(instanceID)
endif
EndIf
ENDEVENT



I would really appreciate some help or advice with this one because i don't know if it can be done and even more doing it myself, since i'm completely clueless with this one.


Many thanks in advance !!.

Edited by maxarturo
Link to comment
Share on other sites

Can you use the akFacingObject parameter of the Play function in some way? Not sure if your effect is one of the ones that qualifies for using it. Might be worth a try? I don't know. Never really scripted with this type of stuff before.

Thanks IsharaMeradin i'll give it a try... at this point there is no turning back, i have to make this work !!!, even if this means making a new particle system from scratch....

Edited by maxarturo
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...